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.

Types of constant velocity specification
 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 arbitrary function of space and time can be provided 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. The way to specify the functional form is to set a boundary condition option equal to a string that contains an expression, for example mdot=".145*t" where the function is inside the string quotes. Valid variables that can be used in the function definition are x, y, z, and t. The time variable t is in seconds and is the simulation time, and the spatial variables x, y, and z are the coordinates of the face center in meters. An example of specifying a functional velocity that varies in space and time is shown below.

Functional velocity specification
 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. At the current time, units are not supported, so values are assumed to be in m/s. Any of the run control file variable options that can be specified using a constant value can also be specified using the functional form.Available functions are shown in the table below.

Available Functions (expr can be any valid expression involving the space and time variables.)

Form

Description

pow(expr,2)

Raises expr to a power

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

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.

Cartesian velocity specification
 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.

\[\begin{split}\begin{array}{ccccccc} n & f & & & & & \\ x_1 & y_1 & z_1 & v_{x,1} & v_{y,1} & v_{z,1} \\ x_2 & y_2 & z_2 & v_{x,2} & v_{y,2} & v_{z,2} \\ x_3 & y_3 & z_3 & v_{x,3} & v_{y,3} & v_{z,3} \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ x_n & y_n & z_n & v_{x,n} & v_{y,n} & v_{z,n} \\ \end{array}\end{split}\]

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.

Radial velocity specification
 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.

\[\begin{split}\begin{array}{cccc} n & & & \\ r_1 & v_{x,1} & v_{y,1} & v_{z,1} \\ r_2 & v_{x,2} & v_{y,2} & v_{z,2} \\ r_3 & v_{x,3} & v_{y,3} & v_{z,3} \\ \vdots & \vdots & \vdots & \vdots \\ r_n & v_{x,n} & v_{y,n} & v_{z,n} \\ \end{array}\end{split}\]

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.

\[\begin{split}\begin{array}{1111111} &n & & & & & \\ &\Omega_1 & & & & & \\ & X_{\text{start},1} & Y_{\text{start},1} & Z_{\text{start},1} & X_{\text{end},1} & Y_{\text{end},1} & Z_{\text{end},1} \\ &\Omega_2 & & & & & \\ & X_{\text{start},2} & Y_{\text{start},2} & Z_{\text{start},2} & X_{\text{end},2} & Y_{\text{end},2} & Z_{\text{end},2} \\ &\vdots & & & & & \\ &\vdots & & & & & \\ &\Omega_n & & & & & \\ & X_{\text{start},n} & Y_{\text{start},n} & Z_{\text{start},n} & X_{\text{end},n} & Y_{\text{end},n} & Z_{\text{end},n} \\ \end{array}\end{split}\]

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.

Cartesian scalar specification
 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.

\[\begin{split}\begin{array}{llll} n & f & & \\ x_1 & y_1 & z_1 & T_1 \\ x_2 & y_2 & z_2 & T_2 \\ x_3 & y_3 & z_3 & T_3 \\ \vdots & \vdots & \vdots & \vdots \\ x_n & y_n & z_n & T_n \\ \end{array}\end{split}\]

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.

Radial scalar specification
 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.

\[\begin{split}\begin{array}{ll} n & \\ r_1 & T_1 \\ r_2 & T_2 \\ r_3 & T_3 \\ \vdots & \vdots \\ r_n & T_n \\ \end{array}\end{split}\]

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.

Functional scalar specification
 BC_1=subsonicInlet(T="300+0.01*x+0.02*y+0.03*z-0.01*t"))