Appendix: Velocity and Scalar Boundary Condition Specification
There are several ways of specifying velocity and scalar values for the
inlet boundary conditions detailed in:ref:Appendix C <appendix_c>. The following sections on velocity and scalar boundary
conditions apply specifically to the incompressibleInlet
, subsonicInlet
,
supersonicInlet
and totalPressureInlet
boundary conditions.
Velocity Boundary Conditions
Specification of the velocity is accomplished using the v=
option. In
the following sections, we will use incompressibleInlet
, although the
forms shown apply identically to the other boundary condition types.
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
With the functional form of velocity specification, one can specify an arbitrary function of space and time for each of the velocity components. The velocity at each grid face on the boundary is assigned by evaluating the function at the coordinates of the face center.
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. Standard math functions such as sin()
, cos()
,
tan()
, asin()
, acos()
, atan()
, sinh()
, cosh()
, tanh()
, exp()
, sqrt()
,
log()
, and log10()
may also be used in the function specification. At
the current time, units are not supported, so values are assumed to be
in m/s
.
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.