Appendix: Velocity and Scalar Boundary Condition Specification
There are several ways of specifying velocity and scalar values for boundary conditions. This appendix describes the available value forms; the documentation for each boundary condition identifies which options it accepts.
The direct v="file.dat" form described below is a temporal, spatially uniform velocity-vector history. The Cartesian and axisymmetric file
forms describe spatial profiles. The two-column temporal files used by massFlux, mdot, volFlux, and vdot are described separately
in Time-dependent flow-rate specifications.
Velocity Boundary Conditions
Specification of the velocity is accomplished using the v= option. The following sections use incompressibleInlet for the examples.
Constant Specification
With the constant velocity specification, the velocity for all grid faces on the boundary is assigned to the single specified value. The
following example shows the three ways of assigning a constant velocity of 1 ft/s in the x-direction.
BC_1=incompressibleInlet(v=0.3048 m/s)
BC_1=incompressibleInlet(v=[1.0 ft/s, 0.0, 0.0])
BC_1=incompressibleInlet(v=polar(1.0 ft/s, 0.0 deg, 0.0 deg)
Functional Specification
A functional form of velocity specification is available where an expression of space and time can be provided for each velocity component.
The velocity at each grid face on the boundary is assigned by evaluating the expressions at the coordinates of the face center. Valid variables
are x, y, z, and t. The time variable t is the simulation time in seconds, and x, y, and z are the face-center
coordinates in meters. An example of specifying a functional velocity that varies in space and time is shown below.
BC_1=incompressibleInlet(v=function(vX="-1.0+3.0*x+2.0*x*y+4.0*x*y/z-0.01*t", vY="0.0", vZ="0.0"))
If any component (such as vX) is not specified, it is assumed to be zero. The mathematical functions are written using common programming
symbols as shown above. Units are not supported inside the expressions, so results are assumed to be in m/s. Available functions are shown in
the table below.
Form |
Description |
|---|---|
pow(expr,2) |
Raises |
sin() |
Sine (argument in radians) |
cos() |
Cosine |
tan() |
Tangent |
asin() |
Arcsine |
acos() |
Arccosine |
atan() |
Arctangent |
sinh() |
Hyperbolic sine |
cosh() |
Hyperbolic cosine |
tanh() |
Hyperbolic tangent |
exp() |
Exponential |
log10() |
Base 10 logarithm |
ln() or log() |
Natural logarithm |
sqrt() |
Square root |
Time-History Specification
A spatially uniform velocity vector may be supplied as a function of time using a direct file specification:
BC_1=subsonicInlet(v="inlet_velocity.dat", T=300 K)
The file contains exactly four numeric columns: simulation time in seconds followed by the Cartesian velocity components vX, vY, and
vZ in m/s.
# time [s] vX [m/s] vY [m/s] vZ [m/s]
0.00 1.0 0.0 0.0
0.05 1.5 0.1 0.0 # ramp and turn
0.10 2.0 0.2 0.0
Times must be strictly increasing. Blank lines are allowed, and a # begins a comment. Stream linearly interpolates each velocity component
between adjacent entries, uses the first vector before the first listed time, and uses the last vector after the last listed time. A file with one
data row therefore specifies a constant vector.
This form assigns the same Cartesian vector to every face on the boundary. It does not use the boundary area, density, flowDir, or local face
normal to convert the input. The resulting normal volumetric flow is determined from the normal component of the specified velocity on each face.
Use the Cartesian or axisymmetric forms below when the velocity must vary spatially over the boundary.
Cartesian Specification
With the Cartesian specification, one can specify a one-dimensional velocity profile with respect to a single coordinate direction (either x, y, or z). The following example shows how this form is used.
BC_1=incompressibleInlet(v=cartesian(file="file.dat"))
The data file specified can be of any name. The format for this data file is shown in the figure below. In the figure, the variable n represents
the number of data pairs in the file. A data pair consists of a xyz-coordinate and the components of a vector velocity value. The
variable f represents a profile flag which tells which coordinate direction to interpolate with respect to. Use f=0 to interpolate with
respect to the x-coordinate direction. In this case, the y and z coordinate values in the file are ignored. Use f=1 to interpolate with
respect to y and f=2 to interpolate with respect to z. The velocity at each face on the boundary is assigned by interpolating within the file
coordinate values and computing the associated interpolated velocity value. If the coordinate of a grid face center falls outside the range
of the coordinate data in the file, then the limiting boundary values are used. For example, if f=0 and \(x_{\text{face}}<x_{\text{1}}\)
then \(v_{\text{face}}=v_{\text{1}}\) and if \(x_{\text{face}}>x_{\text{n}}\) then \(v_{\text{face}}=v_{\text{n}}\).
Naturally, this implies that the coordinates of the points in the data file must be listed in ascending order. Below
is the format for cartesian velocity specification file.
Axisymmetric Specification
Like the Cartesian specification, one can also specify a velocity profile with respect to a radial coordinate. The following example shows how this form is used.
BC_1=incompressibleInlet(v=axisymmetric(file="file.dat"), referenceFrame=0)
As with the Cartesian specification above, the file specified can be of any name. The format for this axisymmetric velocity specification file is shown below.
In the figure above, the variable n represents the number of data pairs in the file. A data pair consists of a radial coordinate and the
components of a vector velocity value. The velocity at each face on the boundary is assigned by interpolating within the file coordinate values and
computing the associated interpolated velocity value. If the coordinate of a grid face center falls outside the range of the coordinate data in
the file, then the limiting boundary values are used. For example, if \(r_{\text{face}}<r_{\text{1}}\)
then \(v_{\text{face}}=v_{\text{1}}\) and if \(r_{\text{face}}>r_{\text{n}}\) then \(v_{\text{face}}=v_{\text{n}}\). It is
important that the radial coordinates of the points in the data file be listed in ascending order. To compute the radial coordinate values of
the boundary faces, an axis must be established that defines the location of r=0. At the current time, this is accomplished using the
reference frame file. The format for this data file is shown below. To use the information in the reference frame file, one must first put the
following line in the run control file:
referenceFrameFile: file.dat
Note that any name may be used for the reference frame file and that there are no quotes surrounding the name as there are in the boundary
condition specifications above. In the figure below, the variable n represents the number of reference frames defined in the file. Each reference
frame includes an angular rotation rate \(\Omega\) whose units are rad/s and the starting and ending coordinates of the axis. The angular
rotation rate is not used in the specification of the axisymmetric profile but is used in other features of the code. The axis is defined as the
directed line from the starting coordinate to the ending coordinate. The magnitude of the axis specified in the data file is not important, as
the axis is internally normalized within the code. In addition, the reference frame numbering specified in the boundary condition starts
from zero. So, if one wishes to use the second reference frame in the data file for the boundary condition, specify referenceFrame=1. The
format for the reference frame file is shown below.
Scalar Boundary Conditions
In this section we discuss the available methods for specifying scalar boundary condition values. Temperature will be used in the examples
below, however, the same specifications apply directly all other scalar variables. Specification of the temperature is accomplished using the T=
option. In the following examples, we will use subsonicInlet, although the forms shown apply identically to the other boundary condition types.
Constant Specification
With the constant temperature specification, the temperature for all grid faces on the boundary is assigned to the single specified value. The following example illustrates the use of this form:
BC_1=subsonicInlet(T=400 K)
Cartesian Specification
With the Cartesian specification, one can specify a one-dimensional temperature profile with respect to a single coordinate direction (either x, y, or z). The following example shows how this form is used.
BC_1=subsonicInlet(T=cartesian("file.dat"))
See the section above for a detailed discussion of the file format and interpolation methods used. While the file format is like that for vector quantities, only a single scalar value for each interpolation data point is required, as shown below.
Axisymmetric Specification
Like the Cartesian specification, one can also specify a temperature profile with respect to a radial coordinate. The following example shows how this form is used.
BC_1=subsonicInlet(T=axisymmetric("file.dat"), referenceFrame=0)
See the section above for a detailed discussion of the file format and interpolation methods used. While the file format is like that for vector quantities, only a single scalar value for each interpolation data point is required, as shown below. Specification of the reference frame is handled in an identical manner as described earlier.
Functional Specification
A functional form of scalar specification is available where an arbitrary function of space and time can be provided. This takes the same form as the functional velocity specification described earlier. The exception here is that whereas in the prior section, velocity components needed to specified, for scalars, the function can be provided directly to the run control file variable option as a string. The following example shows how this form is used.
BC_1=subsonicInlet(T="300+0.01*x+0.02*y+0.03*z-0.01*t"))