You may define constant parameters within a keyword file, and reference these parameters when defining input variables. If you choose to define any such parameter, their definitions must appear at the beginning of the keyword file, under the $PREPROCESSOR section. When referencing a parameter, the variable definition must be preceded by the characters =[ and followed by the ] character. Specifically the variable definition will appear in the format =[Parameter], rather than just having an explicitly specified value. The facility is best illustrated via a simple example. Consider the following environmental specification:
–Ocean depth = 500m
–Seawater density = 1025 kg/m3
–Acceleration due to Gravity = 9.81m/s
This may be specified directly in numerical format as follows:
$MODEL
*OCEAN
500, 1025.0, 9.81
Alternatively, parameters may be defined initially, and then referenced subsequently:
$PREPROCESSOR
*PARAMETERS
OceanDepth, 500
SeawaterDensity, 1025
Gravity, 9.81
$MODEL
*OCEAN
=[OceanDepth], =[SeawaterDensity], =[Gravity]
You can mix parameters with standard inputs also – the following is another valid specification:
$PREPROCESSOR
*PARAMETERS
OceanDepth, 500
Gravity, 9.81
$MODEL
*OCEAN
=[OceanDepth], 1025, =[Gravity]
Unlike most inputs in Flexcom (e.g. line length, element diameter), user-defined parameters do not have any default units associated with them. This is because it is possible in theory to use a single parameter to define more than one, possibly unrelated, entries in the Flexcom input file. For example, you could define a parameter called 'General', and assign it a value of 5. This could then be used to define a length of 5m, a mass of 5kg, or even a time of 5s. Needless to say, this is not good practice.
In order to eliminate any possible ambiguity, it is highly recommended that you explicitly associate units with every parameter definition (assuming you are using a Keyword File with Explicit Units). For example:
$PREPROCESSOR
*PARAMETERS
C Base Parameters
E, <207GPa>
G, <80GPa>
rho, <7850kg/m^3>
Do, <8in>
Di, <6in>
All parameters are then automatically converted by Flexcom into the relevant base units. Given that the above is a metric file (file extension .keyxm), Flexcom automatically converts these parameters into SI base units as follows:
E 207000000000 Pa
G 80000000000 Pa
rho 7850 kg/m^3
Do 0.203199918720813 m
Di 0.15239993904061 m
Any of these intrinsic conversions may be verified by hovering the mouse cursor over a parameter definition in the Keyword Editor or Table Editor, or perhaps more conveniently, all of them may be checked via the Parameter Values window. For example, Do has been converted from 8 inches to 0.203m in the following example...
Even though rho is already in standard units, it is good practice to explicitly state the relevant units for clarity. This will also prevent rho being used subsequently to define any Flexcom input where the base units are not [mass/length3].
Naturally it follows that you may wish to define some derived parameters based on these fundamental entries. For example:
$PREPROCESSOR
*PARAMETERS
C Base Parameters
E, <207GPa>
G, <80GPa>
rho, <7850kg/m^3>
Do, <8in>
Di, <6in>
C Derived Parameters
I, =[PI/64*(Do^4-Di^4)]
J, =[2*I]
A, =[PI/4*(Do^2-Di^2)]
EI, =[E*I]
EA, =[E*A]
GJ, =[G*J]
Explicitly specifying units along with parameter definitions ensures consistency of any further computations and derived parameters. For example, even though Do and Di have both been specified in inches, they are immediately converted internally into metres (the base unit for length in the SI system), and consequently any derived parameters such as I, J and A are computed correctly.
If you have several parameters which are related in some way, it may be more convenient to define them in a list format. This allows you to assign a common prefix to each parameter, and is a more economical way of writing as several parameter definitions may be included on the same line. For example:
$PREPROCESSOR
*PARAMETERS
Pipe, / Do:<8in>, Di:<6in> /
Cable, / Do:<2in>, Di:<0in> /
In this case Flexcom creates four separate parameters - Pipe_Do, Pipe_Di, Cable_Do and Cable_Di. This is equivalent to the following individual definitions, but the list type above possibly looks neater.
$PREPROCESSOR
*PARAMETERS
Pipe_Do, <8in>
Pipe_Di, <6in>
Cable_Do, <2in>
Cable_Di, <0in>
It is also possible to use equations in the list type format, but you will need to include the full names of any parameters used in the equations, and the list inputs become more cumbersome in this case.
$PREPROCESSOR
*PARAMETERS
Pipe, / Do:<8in>, WT:<0.5in>, Di:=[Pipe_Do-2*Pipe_WT] /
NB: More importantly, if you are planning to use variations, then you should not use the list format as the equations are evaluated within the template file, and the evaluated values will not reflect any variations defined.
For example, the following syntax will not function properly.
$PREPROCESSOR
*PARAMETERS
Pipe, / Do:<8in>, WT:<0.5in>, Di:=[Pipe_Do-2*Pipe_WT] /
*VARIATION
NAME=Wall_Thick
PARA=Pipe_WT, VALUE=0.3,0.4,0.5
Instead you must use the following syntax.
$PREPROCESSOR
*PARAMETERS
Pipe_Do, <8in>
Pipe_WT, <0.5in>
Pipe_Di, =[Pipe_Do-2*Pipe_WT]
*VARIATION
NAME=Wall_Thick
PARA=Pipe_WT, VALUE=0.3,0.4,0.5
Checking Parameter Definition
When you are referencing a parameter, you can quickly check how the parameter has been defined. Simply right-click on the parameter reference in the Keyword Editor, and select Go to 'Parameter' Definition, as illustrated below...
You can also use the Smart Select feature to highlight all instances of the parameter within the keyword file.
•*PARAMETERS is used to define parameters whose names may be referenced subsequently in the definition of other input variables.
If you would like to see an example of how this keyword is used in practice, refer to C02 - Multi-Line Flexible System or C03 - Turret Disconnect.