WORKSHOP 15 USER SUPPLIED SUBROUTINES. WS15-2 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation.

Презентация:



Advertisements
Похожие презентации
WORKSHOP 20 SINDA TRANSLATION OF A PWB MODEL. WS20-2 PAT312, Workshop 20, December 2006 Copyright 2007 MSC.Software Corporation.
Advertisements

WS9-1 WORKSHOP 9 TRANSIENT THERMAL ANALYSIS OF A COOLING FIN NAS104, Workshop 9, March 2004 Copyright 2004 MSC.Software Corporation.
WORKSHOP 1 GETTING STARTED CREATING A CONDUCTION MODEL WS1-1 NAS104, Workshop 1, March 2004 Copyright 2004 MSC.Software Corporation.
WORKSHOP 11 USING CONVECTION CORRELATIONS. WS11-2 PAT312, Workshop 11, December 2006 Copyright 2007 MSC.Software Corporation.
WS8-1 WORKSHOP 8 TRANSIENT THERMAL NAS104, Workshop 8, March 2004 Copyright 2004 MSC.Software Corporation.
WORKSHOP 6 COMPARISON OF TWO HEAT SINK DESIGNS. WS6-2 PAT312, Workshop 6, December 2006 Copyright 2007 MSC.Software Corporation.
WS17-1 WORKSHOP 17 IMPORT IGES FILE AND AUTO-TET MESH THE GEOMETRY NAS104, Workshop 17, March 2004 Copyright 2004 MSC.Software Corporation.
WORKSHOP 10 TIME DEPENDENT BOUNDARY CONDITIONS. WS10-2 PAT312, Workshop 10, December 2006 Copyright 2007 MSC.Software Corporation.
WS15-1 WORKSHOP 15 THERMAL STRESS ANALYSIS WITH DIRECTIONAL HEAT LOADS NAS104, Workshop 15, March 2004 Copyright 2004 MSC.Software Corporation.
WS1-1 WORKSHOP 1 IMPORTING A TEMPERATURE FIELD PAT 328, Workshop 1, September 2004 Copyright 2004 MSC.Software Corporation.
WORKSHOP 1 CONSTRUCT HYBRID MICROCIRCUIT GEOMETRY.
WORKSHOP 19 ANIMATING RESULTS. WS19-2 PAT312, Workshop 19, December 2006 Copyright 2007 MSC.Software Corporation.
WS11-1 WORKSHOP 11 HEATING A BLOCK OF ICECREAM NAS104, Workshop 11, March 2004 Copyright 2004 MSC.Software Corporation.
WORKSHOP 22 STEADY STATE RADIATIVE BOUNDARY CONDITIONS.
WORKSHOP 13 NORMAL MODES OF A RECTANGULAR PLATE. WS13-2 NAS120, Workshop 13, May 2006 Copyright 2005 MSC.Software Corporation.
WS1c-1 WORKSHOP 1C NORMAL MODES ANALYSIS WITH FINE MESH NAS122, Workshop 1c, August 2005 Copyright 2005 MSC.Software Corporation.
WORKSHOP 8 TEMPERATURE DEPENDENT MATERIAL PROPERTIES.
Workshop 9-1 NAS101 Workshops Copyright 2001 MSC.Software Corporation WORKSHOP 9 Buckling Analysis of Plate.
WS1a-1 WORKSHOP 1A NORMAL MODES ANALYSIS NAS122, Workshop 1a, August 2005 Copyright 2005 MSC.Software Corporation.
PAT312, Section 18, December 2006 S18-1 Copyright 2007 MSC.Software Corporation SECTION 18 LOADS & BOUNDARY CONDITIONS.
Транксрипт:

WORKSHOP 15 USER SUPPLIED SUBROUTINES

WS15-2 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation

WS15-3 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Model Description In this exercise the Convection Correlation will be supplied by the user. You will write the necessary code to evaluate the Convection Correlation in the user subroutine UHVAL. This Qtran subroutine will compute the values for the heat transfer coefficient and return those values to the main program. An iron slab is modeled in 2-dimensions. A heat flux of 1000w/m 2 is imposed on the bottom edge of the slab. The top surface convects heat to the ambient temperature at 300K with a heat transfer coefficient defined by a user supplied subroutine.

WS15-4 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Objective Create a user subroutine UHVAL that computes the values for the heat transfer coefficient. Exercise Overview 1. Start MSC.Patran and create a new database named exercise_15.db. 2. Create the 2D model geometry. 3. Mesh the geometry with Quad4 elements and a Global Edge Length of Create an ambient node for convection boundary conditions. 5. Apply properties. 6. Create values for distance from the leading edge using Fields and Create/Spatial/ PCL Function. 7. Define boundary conditions in Loads/BCs. 8. Copy ulib.f. 9. Modify and compile ulib.f. 10. Prepare and submit the model for analysis. 11. Read the results file and plot temperature and heat transfer coefficient results. 12. Quit MSC.Patran.

WS15-5 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 1: Create a New Database Create a new database called exercise_15.db. a. File / New. b. Enter exercise_15 as the file name. c. OK. d. Choose Default Tolerance. e. Select MSC.Thermal as the Analysis Code. f. Select Thermal as the Analysis Type. g. OK. a b c d e f g

WS15-6 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 2: Create Plate Geometry Create the 2D model geometry. a. Geometry. b. Create/Surface/XYZ. c. Enter for Vector Coordinates List. d. Apply. a b c d

WS15-7 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 3: IsoMesh the Surface Mesh the surface with IsoMesh using Quad4 elements. a. Finite Elements. b. Create/Mesh/Surface. c. Enter 0.2 for Global Edge Length. d. Select Surface 1 for Surface List. e. Apply. a b c d e

WS15-8 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 4: Create Node for Ambient Temperature Create an ambient node for convection. a. Finite Elements. b. Create/Node/Edit. c. Enter 999 for Node lD list. d. Deselect Associate with Geometry. e. Use the Screen Position icon and select somewhere above the models center for Node Location List. f. Click Apply. g. To better visualize the Nodes location select the following icon to increase the node display size. a g b c d e e f

WS15-9 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 5: Apply Element Properties Apply properties to the quad4s. a. Properties. b. Create/2D/Thermal 2D. c. Enter Prop1 for Property Set Name. d. Input Properties… e. Enter 18 for Material Name. f. OK. g. Select Surface 1 for Select Members. h. Add. i. Apply. a e f b c d g i h

WS15-10 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 6: Create Micro-Function Create values for distance from the leading edge. a. Fields. b. Create/Spatial/PCL Function. c. Enter X_Dist for Field Name. d. Select Scalar for Field Type. e. Input X+1.0 for Scalar Function. f. Apply. a b c e f d

WS15-11 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 7: Apply Boundary Conditions Define boundary conditions. a. Loads/BCs. b. Create/Heating/Element Uniform. c. Select Flux, Fixed for Option. d. Enter Bott_Surf_Flux. e. Select 2D for Target Element Type. f. Click Input Data… g. Enter 1000 for Fixed Heat Flux. h. OK. i. Select Select Application Region… j. Select bottom edge of Surface 1, Surface 1.4, for Select Surfaces or Edges, using Edge icon from the select menu. k. Add. l. OK. m. Apply. a b c d e f g h i j l m k

WS15-12 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 7: Apply Boundary Conditions (Cont.) Apply the ambient temperature. a. Loads/BCs. b. Create/Temperature/Nodal. c. Set Option to Fixed. d. Enter Temp_amb for New Set Name. e. Click Input Data… f. Enter 300 for Fixed Temperature. g. OK. h. Click Select Application Region… i. Select FEM geometry filter. j. Select Node 999 for Select Nodes. k. Add. l. OK. m. Apply. a b c d e f g h i j l m k

WS15-13 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 7: Apply Boundary Conditions (Cont.) Apply the convection coefficient. a. Loads/BCs. b. Create/Convection/Element Uniform. c. Select Template, Convection for Option. d. Enter Conv_Coeff_Spatial for New Set Name. e. Select 2D for Target Element Type. f. Click Input Data… g. Deselect Fixed. h. Click Select Spatial Field… and select X_Dist. i. Enter 1 for Convection Template ID. j. Select Node 999 for Fluid Node ID. k. OK. l. Click Select Application Region… m. Select Geometry Filter. n. Under Select Surfaces or Edges select the top edge of Surface 1, Surface 1.2. o. Add. p. OK. q. Apply. a b c d e f g i j k l m n p q o h

WS15-14 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 8: Copy File ulib.f Before programming the correlation create a job name subdirectory. In the directory where the MSC.Patran database is create a subdirectory named exercise_15. Change to that subdirectory. Now, copy the file ulib.f from the MSC.Patran Thermal library. a. > mkdir exercise_15 b. > cd exercise_15 c. > get_qtran d. Enter utility e. Enter ulib.f OR, ulib.f can be copied using the copy command or, in Windows, by dragging it from the installation directory which is something like this: D:\MSC.Software\MSC.Patran\2006\p3thermal_files\examples\qtran\utility\ulib.f The file ulib.f contains, among other things, the subroutine UHVAL and several sample subroutines. Modify the subroutine UHVAL to create the convection correlation

WS15-15 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 9: Modify and Compile ulib.f Modify and compile ulib.f. 1. Using the system editor open ulib.f and find the UHVAL subroutine. Three example configurations, with CFIDs of 1000, 1001, 1002, are already programmed but commented out. 2. Note: The CFIDs will be defined in the Convection Template and are passed to the subroutine UHVAL with the three configurations. The following two values are always returned from the subroutine: Conductance:GVALH = h*Area Heat Transferred:Q=GVALH*(T 1 -T 2 ) c. In any Convection Configuration that is defined, these two variables must be calculated and returned to the solver. d. To compute the h value (h=(T surf + 100)/L) the following two inputs are needed: 1) RL, the distance from the leading edge to a particular element, and 2) T surf, the temperature of the element edge (surface). e. The distance from the leading edge will be passed from the field (X_Dist) input in the Convection Coefficient data box in the Loads/BCs form. The average distance from the slabs leading edge to each element will be calculated from: RL=(GP2 +GP3)/2 f. GP2 and GP3 are the distances from the models leading edge to the leading and trailing edges of each element. g. GP1 is automatically passed from MSC.Patran as the cross sectional or surface area of each element. h. Now, write the FORTRAN code to calculate GVALH, Q, and H. With the systems editor open the file ulib.f. Scroll down the file or search for the second occurrence of UHVAL in the file to locate the UHVAL subroutine. After the following line, C*C1000CONTINUE i. Type the following lines of code while taking care to place all your code beyond column 7. Remember this is FORTRAN. DOUBLE PRECISION RL, AREA RL=(GP(IRESIS,2)+GP(IRESIS,3))/2.0 AREA=GP(IRESIS,1) H=(T )/RL GVALH=H*AREA Q=GVALH*(T1-T2)

WS15-16 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 9: Modify and Compile ulib.f (Cont.) Modify and compile ulib.f. (continued) a. Save the file and quit the editor. b. Now, compile the user routine. Delete any existing ulib.a that may have been previously created. Type the command > ulib ulib.f c. After successful compilation a new ulib.a will be present in the subdirectory. If there are any syntax errors scroll through the window during compilation, then re-edit the file and repeat the above compilation step.

WS15-17 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 10: Create File template.dat.apnd Create a link between the convection coefficient just defined using ulib.f and QTRAN. a. Analysis. b. Build Template. c. Click Create Template File… d. Create/CONV/Data Entry. e. Enter 1 for CONV ID. f. Enter 1000 for CFIG ID. g. Apply. h. Click Write File… i. Enter template.dat.apnd j. OK. k. Cancel. l. Cancel. a b c d e f g

WS15-18 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 11: Prepare and Submit for Analysis Prepare and submit the model for analysis. a. Analysis. b. Analyze/Full Model/Full Run. c. Click Translation Parameters… d. Select 2D Plane Geometry, X Y Co- ordinates (Unit Thickness in Z). e. OK. f. Click Output Requests… g. Click Nodal Results File Format… h. Select first 8 items under Select Thermal Entries to Output. i. OK. j. OK. k. Apply. a b c d f k h i

WS15-19 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 12: Read Result File Read the results file and plot results. a. Analysis. b. Read Result/Result Entities. c. Click Select Results File… d. Under the directory find the path that leads to exercise_15. e. Under available files select nr0.nrf.01 f. OK. g. Click Select Rslt Template File… h. Select pthermal_nod_T.res_ tmpl under Files. i. OK. j. Apply. a b c d f g h i j e

WS15-20 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 13: Display Results Plot the results. a. Results. b. Create/Quick Plot. c. Select Time: D+ 00S…for Select Result Cases. d. Select Temperature for Select Fringe Result. e. Select the Fringe Attributes icon. f. Select Element Edges for Display. g. Click Label Style. h. Select Fixed for Label Format. i. Use the slider bar to select 4 for Significant figures. j. OK. k. Apply. a b f g h i j k

WS15-21 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 13: Display Results (Cont.)

WS15-22 PAT312, Workshop 15, December 2006 Copyright 2007 MSC.Software Corporation Step 14: Quit MSC.Patran Quit MSC.Patran. a. Select File. b. Click Quit from the drop down menu.