Thermal > PATQ Preference Program > Template File (TEMPLATEDAT)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Template File (TEMPLATEDAT)
The TEMPLATE file is probably the most difficult concept in the entire Patran Thermal system to learn. It is, however, an extremely powerful technique for linking the large quantities of data required for a sophisticated nonlinear analysis to the relatively simple data supplied the Patran. The ability to treat the TEMPLATE file as a library of data is also extremely useful and greatly reduces the man-hours involved in setting up similar analyses.
The concept of the TEMPLATE file is as follows. In the Patran model, supply very short and simple data such as integer numbers (template IDs) to identify materials or to specify boundary conditions. These template ID's (TIDs) are used by PATQ as pointers. Each TID refers to a particular template in the TEMPLATE file. PATQ will use the data in the template identified with the TID number to get additional necessary data for a material or boundary condition.
There are currently seven different types of templates in the TEMPLATE file. These five types are as follows.
 
MID Templates
MACRO Templates
CONV Templates
VFAC Templates
VTRA Templates
VNEV Templates
FLUID Templates
(Material Identification)
(Heat, Temperature, Pressure, Mass Flow Rate Variations)
(Convective Boundary Conditions)
(Radiative Boundary Conditions, P/THERMAL)
(Radiative Boundary Conditions, TRASYS)
(Radiative Boundary Conditions, NEVADA)
(Hydraulic Element Definitions)
Each of these template types is explained in the following subsections. Note that while unique TID numbers for each template type must be used, the same TID numbers for different template types can also be used. For example, there may be only one MID template with a TID of 1. However, there can be an MID template with a TID of 1 and a MACRO template with a TID of 1.
Templates do not have to be sequentially ordered, nor do the template types have to be in any particular order.
A sample TEMPLATE file is provided with the Patran Thermal software and may be accessed with the “GET_QTRAN STARTUP” command at the system level.
Comments can be entered into the TEMPLATE file by beginning any line with an asterisk (*) or semicolon (;). The remainder of any such line will be ignored.
The TEMPLATE file accepts free format input. Free format may be used to input data to the TEMPLATE file.
MID Templates
MID templates supply an intermediate “missing link” between Patran MID (material ID) numbers and QTRAN MPID (material property ID) numbers. Since Patran is based upon material numbers and QTRAN is based upon property numbers, and since it takes up to (6) property numbers to define a material for the solid part of the model (thermal conductivity in the local X', Y', and Z' directions, density, specific heat, and phase change data set), a way is needed to bridge this gap. The solution was to use an MID template. Build one MID template for each material in the model. The MID template consists of the characters “MID” and the template TID number followed by (6) MPID numbers. The MID number that is assigned on the Element Properties form refers to an MID template with the same TID number.
The linkage system between Patran MID numbers and QTRAN material property data is as follows:
1. Assign MID numbers to the model with the Patran Element Properties form.
2. Build an MID template for each MID assigned to the model with Patran.
3. PATQ uses the MID templates to get the MPID numbers for the conductive resistors and capacitors that PATQ will generate for QTRAN. This is done when the Patran Neutral File is translated into VIEW FACTOR and QTRAN data files.
4. Build material property definitions. Each material property definition contains an MPID number as part of the definition.
5. When QTRAN is executed, QTRAN will read in the material property definitions.
6. QTRAN will then match the material property definitions with the MPID numbers in the conductive resistor and capacitor data files.
When PATQ is executed to translate the neutral file for the model, PATQ will read in the MID templates and use the MPID numbers for the QTRAN data whenever it encounters an MID number in the neutral file.
When QTRAN is executed and encounters the MPID numbers (and PHID numbers) in the resistor and capacitor data, it matches these MPID numbers (and PHID numbers) with material property definitions that have been supplied in a QTRAN input data file. These definitions are typically constants or data tables of property vs. temperature, but the specifications may be any QTRAN material property evaluation option. See Material Properties, 263.
For example, suppose 101 was entered in the material name data box on the Element Properties form. A MID template 101 must be built prior to translating the model’s neutral file. Suppose that material 101 uses mopeds 1, 2, 3, 4, and 5 for thermal conductivity in the local X', Y', Z' directions, density, and specific heat, respectively, and that it also will use phase change data set 121. The following MID template could be used for this material.
The lines beginning with a semicolon are comments and may be omitted.
Prior to executing QTRAN and running an analysis, material properties 1, 2, 3, 4, 5 and 121 must be defined. This is typically done in the $INSERT file MATDAT. $INSERT files are referenced by QTRAN input file(s) at execution time. See the introduction in Thermal/Hydraulic Input Deck (Ch. 8) for more information about the $INSERT command. This chapter also contains additional data about material property definitions.
If no phase changes are to be considered for a material, the PHID number for that material’s MID template should be given as a zero. If the material is isotropic (Kx = Ky = Kz), the same MPID number should be repeated three times for Kx, Ky, and Kz. For example, the following template specifies an isotropic material with no phase changes allowed.
MACRO Templates
MACRO templates are used in conjunction with the Patran loads and boundary data to specify variable heat source, temperature, pressure or mass flow rate boundary conditions. To explain what a MACRO template is, it is required that you first understand the manner in which variable heat, temperature, mass flow or pressure boundary conditions are applied with QTRAN. See Boundary Conditions, 322 for more information.
Consider the following problem. You have a very complex time-dependent tabular heat source that you wish to apply to a number of nodes. But each node is to get this time-dependent heat source scaled by an equally complex temperature-dependent function, and further be scaled by the surface area associated with each node. One way not to approach this problem is to build separate data table functions for each node, especially if there are many nodes. Instead, it is more efficient to build the time-dependent data table once and the temperature-dependent function once and assign function IDs to the time-dependent and temperature-dependent functions. Let us call these little functions “microfunctions” since they will be the little building block functions that we will use to build a complete heat source (or temperature source). We will call the complete heat (or temperature) source a macrofunction (since it is made up of one or more microfunctions).
You could then assign a unique heat source to each node merely by referencing the microfunctions by their ID numbers (MFIDs) and using a scale factor to account for the surface area associated with each node. The scale factor could also account for any other constant scaling that must be performed (for example, units conversions).
MACRO templates are used to define QTRAN macrofunctions. Macrofunctions are used by QTRAN to specify heat source or temperature boundary conditions. See Heat Source/Sink Macrofunction Definition, 325 and Temperature Control Macrofunctions, 327 for more information about macrofunctions. The macrofunction templates consist of the following data:
1. MACRO keyword.
2. Template ID number (TID).
3. The number of microfunctions that will be used to build the macrofunction.
4. Node numbers NODE1 and NODE2. NODE1 and NODE2 will be used as arguments for any temperature dependent microfunctions.
5. A scale factor for the macrofunction.
6. A list of the ID numbers of the microfunctions that will be used to build the macrofunction (MFIDs).
The scale factor that you use in the macrofunction template does NOT need to account for length, surface area, or volume scaling. Patran and PATQ automatically account for this part of the macrofunction scale factor. Instead the MACRO template scale factor is used as an additional constant scale factor to compute the final macrofunction scale factor.
For example, suppose that a node has a surface area of 1.12 associated with it and that a heat source macrofunction is being applied on a surface area basis. PATQ will take the surface area of 1.12 and multiply it by the MACRO template’s scale factor. This product will be used in the macrofunction that is assigned to this node by PATQ. Normally the MACRO scale factor is simply 1.0, but it may be any value that you choose.
The NODE1 and NODE2 node numbers (see Boundary Conditions, 322) may be 0 or any valid node number defined for your model. If either NODE1 or NODE2, or both NODE1 and NODE2, are entered as zero, PATQ will supply the node number that the function is being assigned to in place of the zeros.
An example MACRO template is as follows.
The lines beginning with semicolons are comments and are optional. This MACRO template has a TID of 7, the number of microfunctions used to define the macrofunctions will be 3 (MFIDs 1, 2024, and 18), NODE1 and NODE2 are given as 0 and 4157 (0 will be replaced by the node number to which the macrofunction(s) is assigned), and a template scale factor of 1.0 (which will be used in addition to any length-area-volume scale factors). The product of the macrofunction will be the output of microfunctions 1, 2024, and 18 and the resultant scale factor multiplied together.
Example
Suppose you wish to assign a distributed heat source boundary condition on a surface area basis to all elements along edge 1 of patch 4. You would click on Loads/BCs on the main menu bar and select Action: Create, Object: Heat Flux (pthermal), Type: Element Uniform or Element Variable. Select target element type as 2D, then click on the Input Data and enter 23.7 for heat flux, 7 for template ID. Then select edge 1 of patch 4 as application region and then click the apply button.
This command states MACRO template 7 will be used to build heat source macrofunctions on edge 1 of patch 4. It will use the product of the scale factor in MACRO template 7 multiplied by the surface area associated with each element and also multiplied by 23.7. This command is entered while still in Patran. After the model is completed and a Patran Neutral File has been completed, add a MACRO template with a TID of 7 to the TEMPLATE file. Let us assume the previous example template is used, but in a slightly more compact form without the optional comments. The template would look like this:
MACRO 	7	3	0	4157	1.0
	1	2024	 	18
The next thing necessary to do is to define what microfunctions 1, 2024, and 18 are (see Microfunction Data, 322 and Microfunction Library, 450 for information about how to define microfunctions). After this step, the distributed heat source boundary conditions that were assigned in Patran Loads/BCs form have been completely defined. This is not particularly simple, but it is extremely versatile.
There are more examples of assigning MACRO boundary conditions in the Patran Thermal Tutorial, complete with Patran commands, session files, TEMPLATE data files, and MICROFUNCTION data files.
Variable temperature sources that are assigned use the same procedure, as do variable nodal heat sources.
CONV Templates
Convective templates are used to specify variable convective boundary conditions. Remembering that all you specify with Patran is a TID number and possibly some constant (or spatially varying) data, a nonlinear convective analysis is obviously going to require more information such as material ID numbers (MPIDs) and geometric properties (GPs). The template corresponding to the TID number entered in Patran provides this information.
An example of a convective template is given below.
This convection template will be used by any Loads & Boundary Condition referencing TID number 1. It states that the convective boundary condition uses QTRAN configuration 13 convective resistors (natural convection from flat plates; see Reading Results (Ch. 6) which are for isothermal plates with natural convection. Configuration 13 resistors require a total of 5 GP values, and you will notice that only 2 are given in this template. This is because the Patran always supplies GP #1 (surface area) and will optionally supply GP #2 and GP #3 from the convection coefficient field of the convection loads and boundary conditions (both GP #2 and GP #3 receive the same Cdata value). This template therefore assumes GP #2 and GP #3 with the Cdata field will be provided, and the template then provides GP #4 and GP #5. For convective configuration 13 (natural convection from flat plates), the GP values are defined by QTRAN to be:
GP #1 - The surface area associated with the node is always provided by Patran and PATQ.
GP #2 - A characteristic length of the plate (see Microfunction Library (Ch. 10)) (taken from the convection coefficient value used in Patran convection loads and boundary conditions referencing this template).
GP #3 - A second characteristic length (see Microfunction Library (Ch. 10)). This GP value is taken from the convection coefficient field used in the Patran convection loads and boundary conditions referencing this template. The GP #3 value provided by Patran and PATQ via the Cdata field of the Patran convection loads and boundary conditions will always be the same as the GP #2 value.
GP #4 - Plate inclination angle in degrees. This value is given as 10.0 in the above template.
GP #5 - Local gravitational constant, given as 9.8 from the above template.
This CONV template also states that MPIDs 1041, 1042, 1043, 1000, and 1110 will be used for the convective resistors. Configuration 13 resistors require MPIDs for density, viscosity, coefficient of thermal expansion, specific heat, and thermal conductivity. As an example of convection loads and boundary conditions, enter 298.7 for convection coefficient, a convection template ID of 1 and fluid node ID of 1000 on the convection Loads/BCs form in Patran. Then select edge 2 of patch 1 as application region.
This command will assign convective resistors to edge 2 of patch1. GP #2 and GP #3 will be given values of 298.7, CONV template number 1 will be used, and the resistors will be connected between the surface nodes of edge 2 of patch 1 and bulk fluid node number 1000.
If no convection coefficient value had been given in Patran convection Loads/BCs form, the template would have had to provide GP #2 and GP #3 as well. The template would then have looked as follows:
Convection loads and boundary conditions data using this second template would be 1 for convection templateID, 1000 for fluid node ID and the convection coefficient data box left blank.
The first Loads & Boundary Condition and the first CONV template have exactly the same effect as the second Loads & Boundary Condition and the second CONV template. They are simply different ways of doing the same thing.
In many configurations, GP #2 and GP #3 refer to the shortest and longest distances to the leading edge of the convective boundary layer. This is obviously something that varies from element to element, and may be entered as a Patran data line or data patch. To provide the same data supplying GP #2 and GP #3 in the template, it would require one template per element. This is somewhat less than ideal. We have therefore provided the ability to assign spatially varying data for GP #2 and GP #3 from a Patran data entity such as a data line or data patch. This is available but not necessary. For many analyses, simply assume constant values of GP #2 and GP #3 and supply them from the template. There are also certain configurations that do not require spatially varying information and it is very convenient to simply include their GP #’s 2 & 3 directly in the template.
VFAC Templates
Radiative templates are used to specify all radiation boundary conditions. In addition to the data supplied in the Patran View Factor Loads/BCs form (TID, MEDNOD, AMBNOD, CNVSID, NDB_Flags, and ENCL_ID), additional data is necessary for radiation analysis. Specifically, either constant or variable material property data is necessary for the emissivities and transmissivities (for either gray or wavelength-dependent models) as well as the manner in which the transmissivities (if any) are to be calculated. In addition, whether or not the model is gray or wavelength-dependent needs to be specified, and also, what are the wave band boundaries. This additional information is supplied using the VFAC templates.
The format for VFAC templates is given as follows. The square bracket nesting [ ] indicates successive levels of optional parameters.
The parameters for the VFAC template are listed below.
 
TID
REQUIRED: VFAC template ID number.
Nbands
OPTIONAL--DEFAULT = 0: number of wavelength bands associated with the Radiative boundary condition. If Nbands = 0, the boundary condition is assumed to be gray. If Nbands is greater than 0, it will be assumed that there will be Nband sets of Ec/Tc/Empid/Lambda_1/Lambda_2/Kflag data lines following.
Eic
REQUIRED: Constant emissivity value used for the (1-e)/(e*A) surface resistance Radiative resistors if Empid was entered as 0. If Empid is entered as 0 and Emissivity is given as 1.0, no (1-e)/(e*A) surface resistors are generated (the surface is assumed to be black).
Tc
OPTIONAL--DEFAULT = 1.0: constant transmissivity value used for the 1/(F*A*tau) and 1/(F*A*(1-tau)) view factor resistors.
Empid
OPTIONAL--DEFAULT = 0: emissivity MPID number (see Section 5.3 for MPID numbers). If Empid = 0, the emissivity will be taken from the constant value entered for Emissivity in the template.
Tmpid
OPTIONAL--DEFAULT = 0: transmissivity MPID number (see Section 5.3 for MPID numbers). If Tmpid = 0, the transmissivity data will be taken from the constant value entered for Transmissivity in the template.
Lambda-1
OPTIONAL--DEFAULT = 0.0: shortest wavelength associated with the current wave band being described, if and only if Nbands > 0.
Lambda-2
OPTIONAL--DEFAULT = 0.0: longest wavelength associated with the current wave band being described, if and only if Nbands > 0.
Kflag
OPTIONAL -- DEFAULT = 0, where:
0 --> The transmissivity for the view factor resistors will be calculated directly from the material property referenced by the number or from the constant transmissivity value (given in the below template as 0.915) if the number is 0.
1 --> The transmissivity for the view factor resistors will be calculated using either the material property referenced by the number or the constant transmissivity value as an extinction coefficient coupled with the view factor distance.
Collapse
OPTIONAL--DEFAULT = 0, where:
0 --> Do not collapse radiosity nodes associated with a given surface node.
>0 --> Collapse radiosity nodes with the same collapse field value. This is a feature to reduce the size of the radiation network.
An example of an VFAC template is as follows:
This template will be used by Patran View Factor Loads/BCs form referencing VFAC template number 1. It declares that the radiative boundary condition is gray (Nbands = 0), that the transmissivity of the view factor resistors will be calculated from an extinction coefficient (Kflag = 1) and that the extinction coefficient is a constant of 0.915, and that the emissivity of the surface resistors will be taken from material property MPID 9275609. The collapse value of 5 will be used as an ID to flag radiosity nodes which can be collapsed to a single radiosity node associated with a surface node.
VFAC template 2 above defines a gray surface (Nbands = 0) using variable material properties for emissivity (MPID 7) and transmissivity (MPID 23). The transmissivity will be calculated using MPID 23 as an extinction coefficient (Kflag = 1) along with the view factor distance.
VFAC template 3 above assigns a gray radiative boundary condition with a constant emissivity of 0.95 and a constant transmissivity of 1.00. No 1/(F*A*(1- τ)) resistors will be generated from this template.
Radiative template 4 above assigns a black radiation boundary condition with a constant transmissivity value of 1.0. No 1/(F*A*(1-τ)) resistors will be generated by this template.
VFAC template 5 above defines 3 wave bands: 0.0-1.7, 1.7-5.2, and 9.9-1.0E+10 microns. Wave band #1 uses MPID 7 as the emissivity material property, and MPID 9 as the extinction coefficient. Wave band #2 uses 1.0 as the emissivity (black surface, no (1-e)/(e*A) resistors generated for this wave band) and 0.915 as a constant extinction coefficient. Wave band #3 uses MPID 19 for emissivity and a constant 1.0 for the transmissivity (no 1/(F*A*(1-τ)) resistors generated for this wave band). Note that this template does not define any wave bands between 5.2 and 9.9 microns. Presumably, this surface either does not radiate in this wave band, or else the surface will have a view factor boundary condition, using at least one other template to define the radiative boundary conditions within the 5.2-9.9 micron band. Normally, an analysis will require one template for the entire spectrum, but cases do arise (e.g., greenhouse effects) where the problem may need to be defined a little more creatively. Patran Thermal gives you great flexibility.
VTRA Templates
This template defines the surface properties required by TRASYS. The radiation boundary condition is specified the same as boundary conditions are defined for P/THERMAL and P/VIEWFACTOR. The surface properties are treated as constant in two different wavelength bands. One, the solar region which is from 0 to a cutoff wavelength define in the TRASYS input and the IR region which is everything from the cutoff wavelength to infinity.
The format for VTRA templates is given as follows. The square bracket nesting [] indicates successive levels of optional parameters.
The parameters for the VTRA template are listed below.
 
TID
REQUIRED: VTRA template ID number.
Alpha
Solar Absorptivity of surface
Emiss
IR Emissivity of surface
Trans
Solar Transmissivity of surface material
Trani
IR Transmissivity of surface material
sprs
Solar Specular reflectivity of surface
spri
IR Specular reflectivity of surface
An example of a VTRA template is as follows:
This template defines 0.2 as the surface absorptivity for diffuse surfaces with incident solar radiation and 70 percent of the solar energy will be transmitted through the material. If a specular analysis is performed, the surface reflectivity will be 0.1. Corresponding values for the IR waveband are a surface emissivity of 0.8, and opaque surface (transmissivity = 0.0) and if a specular surface is define the reflectivity will be 0.2. In this case, the reflectivity would be the same for both a diffuse or specular surface.
VNEV Templates
This template defines the surface properties required by NEVADA. The radiation boundary condition is specified the same as boundary conditions are defined for P/THERMAL and P/VIEWFACTOR. The surface properties are treated as constant in two different wavelength bands. One, the solar region which is from 0 to a cutoff wavelength define in the NEVADA input and the IR region which is everything from the cutoff wavelength to infinity.
The format for VNEV templates is given as follows. The square bracket nesting [] indicates successive levels of optional parameters.
The parameters for the VNEV template are listed below.
 
TID
REQUIRED: VNEV template ID number.
Alpha
Solar Absorptivity of surface
Emiss
IR Emissivity of surface
Trans
Solar Transmissivity of surface material
Trani
IR Transmissivity of surface material
sprs
Solar Specular reflectivity of surface
spri
IR Specular reflectivity of surface
iors
Solar index of refraction of surface
iori
IR index of refraction of surface
An example of a VNEV template is as follows:
As with the TRASYS input, this template defines 0.2 as the surface absorptivity for diffuse surfaces with incident solar radiation and 70 percent of the solar energy will be transmitted through the material. If a specular analysis is performed, the surface reflectivity will be 0.1. Corresponding values for the IR waveband are a surface emissivity of 0.8, and opaque surface ( transmissivity = 0.0 ) and if a specular surface is define the reflectivity will be 0.2. In this case, the reflectivity would be the same for both a diffuse or specular surface. NEVADA actually calculates the absorptivity and emissivity from the transmissivity and reflectivity data if they are variable. The reflectivity can be calculated from the specified index of refraction. Currently, if variable reflectivity is to be specified ( a function of incident angle ), the user will have to edit the NEVADA input file. Variable fields are not defined and translated.
FLUID Templates
Fluid templates are used to specify all geometric and material property data necessary to evaluate the variable hydraulic elements. Different fluid element options have different template formats and those fluid options that have all constant properties do not require a fluid template.
The general format of the Fluid template is the FLUID keyword, the template ID, TID number of material properties specified, and the option flag followed by the number of records necessary to indicate all of the material properties desired. The template requirements are defined in Getting Started (Ch. 2).
Below are some examples which show the input for various fluid templates.
Example Template File
The following file is an example of what a complete TEMPLATE file might look like.