Appendix: Gravity

The gravity run-control variable specifies a spatially uniform physical gravity vector. Gravity can be constant or vary with time. The vector components use the solver coordinate system and retain the sign supplied by the user.

Constant Gravity

Specify a constant vector with g. The optional rhoref value is the reference density used by the buoyancy formulation.

gravity: <g=[0.0,-9.81,0.0],rhoref=0.0>

This form retains the existing constant-gravity behavior.

Buoyancy Discretization

buoyancyOptions selects standard (cell force) or conservative (cell-face contributions). Body-force-weighted interpolation supports both:

gravity: <g=[0.0,-9.81,0.0],rhoref=0.0>
buoyancyOptions: <conservative>
momentumInterpolationOptions: <form=bodyForceWeighted,conservativePressure>

The default is standard for bodyForceWeighted and conservative for other forms except Denner. Denner selects its own buoyancy source and ignores the requested source form.

bodyForceWeighted has these restrictions:

  • Use inviscidFlux: FOU or SOU, pressureBasedMethod: SIMPLE or SIMPLEC, and timeIntegrator: BDF, BDF2, or CN. Compressible flow requires CMIM, with its SIMPLEC/BDF restrictions. Other flows require flowCompressibility: incompressible and mainCodePressureCorrectionRules: on.

  • Use a fixed Cartesian mesh without axisymmetry. Translational periodicity is supported; rotational periodicity, noninertial and boundary reference frames, and porous resistance are unsupported.

  • Unsupported boundaries are interface, totalPressureInlet, farfield, outflow, and characteristic inflow. Omit supersonicSwitch and prescribed velocity on pressure-driven boundaries.

  • Omit pressureReconstruction from momentumEquationOptions and highOrder, modified, skewnessCorrection, and noGravity from momentumInterpolationOptions.

With form=old, CMIM also supports material-predictor gravity.

Time-Varying Gravity

The gravity vector can vary with time according to an expression or a history file. The optional rhoref value remains constant throughout the calculation.

Expression Specification

Specify an expression for each Cartesian component with g=function(...):

gravity: <g=function(gX="2.0*sin(t)",gY="-9.81",gZ="0.5*t"),rhoref=0.0>

The only expression variable is t, the simulation time in seconds. A component that is omitted is zero. Units are not supported inside expressions, so each result is interpreted in meters per second squared. The mathematical syntax and available functions are the same as for functional velocity specifications.

File Specification

Specify a gravity-vector history with file:

gravity: <file="gravity.dat",rhoref=0.0>

Each nonblank line in the file contains time followed by the three gravity components:

# time    gx     gy     gz
0.0       0.0   -9.81   0.0
0.5       0.0   -4.00   0.0
1.0       0.0    0.00   0.0

File values use seconds and meters per second squared. Text following # is treated as a comment. Times must be finite and strictly increasing, and all vector components must be finite. Gravity is linearly interpolated between rows. Before the first time and after the last time, the corresponding endpoint vector is held constant.

The g and file options are mutually exclusive. Both the expression and file forms specify the physical gravity vector itself. Time-varying gravity is not supported by the PISO solver.