exprHyperSrc

Computes a source term based on input variables from N nodalArrays in combination with geometric factors.

Parameters

indVars_inName (string vector, required)
For each input variable an “indVars” string vector must be defined. So if in = [magneticField, electricField] where magneticField and electricField are each 3-component nodalArrays then the combiner block must define indVars_magneticField = [“bx”, “by”, “bz”] and indVars_electricField = [“ex”, “ey”, “ez”]. Note that the labels “bx”, “by”, “bz” and “ex”, “ey”, “ez” are arbitrary; the requirement is that there is a unique name for each component of each input data structure.
exprs (string vector, required)
Strings must be put in quotes. The strings are evaluated and placed in the output array. The number of strings must be identical to the number of components in the output array. Available command are defined by the muParser (http://muparser.sourceforge.net/)
preExprs (string vector, optional)
Strings must be put in quotes. The preExprs is used to compute quantities based on indVars that can later be used in the exprs to evaluate the output. Available commands are defined by the muParser (http://muparser.sourceforge.net)
other (strings, optional)
In addition, an arbitrary number of constants can be defined that can then be used in evaluating expression in both preExprs and exprs.

Parent Updater Data

in (string vector, required)
Inputs 1 to N are input nodalArrays which will be supplied to the expression evaluator.
out (string vector, required)
Output is a nodalArray which will contain evaluated source. The number of components in the output array must be equal to the number of expressions.

Example

The following block demonstrates exprHyperSrc used in combination with classicMusclUpdater (1d, 2d, 3d) and eulerEqn to compute \(\nabla\cdot\left[ \mathcal{F} \left( \mathbf{w} \right) \right] - \mathcal{S} \left( \mathbf{w}, x, y, z, t \right)\):

 <Updater hyper>
  kind = classicMuscl2d
  onGrid = domain
  timeIntegrationScheme = none
  numericalFlux = hllcEulerFlux

  limiter = [muscl]
  variableForm = primitive

  in = [q]
  out = [qnew]

  cfl = 0.3

  equations = [euler]
  sources = [gravity]

  <Equation euler>
    kind = eulerEqn
    correctNans = false
    gasGamma = GAMMA
  </Equation>

  <Source gravity>
    kind = exprHyperSrc
     inpRange = [0,1,2,3,4]
     outRange = [0,1,2,3,4]
     gravity = GRAVITY # m/s^2
     indVars = ["rho", "rhou", "rhov", "rhow", "Er"]
     exprs = ["0.0", "0.0", "-rho*gravity", "0.0", "-gravity*rhov"]
  </Source>

</Updater>