funcUpdater (1d, 2d, 3d)

Updates a nodalArray based on algebraic expressions of the input variables.

Data

in
Input 1 is a nodalArray that algebraic operations will be performed with.
out
Output 1 is the nodalArray that the results are stored in.

Parameters

indVars
indVars gives a variable name to each index of the nodalArray defined in “in”. If in=[qnew] and qnew has 5 components then one might define indVars = [“a”, “b”, “c”, “d”, “e”].
preExprs (string vector)
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)
exprs (string vector)
Strings must be put in quotes. The strings are evaluated and placed in the output array. Available command are defined by the muParser (http://muparser.sourceforge.net/)
other (variable definition)

In addition, an arbitrary number of constants can be defined that can then be used in evaluating expression in both preExprs and exprs

Also, the combiner has predefined variables including x,y,z representing the spatial location of the cell, t and dt, representing time and time step and dVolume representing the volume of a cell.

Example

<Updater pressCalc>
  kind = funcUpdater2d

  onGrid = domain

  in = [qnew]
  out = [pressure]

  indVars = ["rho", "rhou", "rhov", "rhow", "Er"]

  gamma = GAMMA
  preExprs = ["pr = (Er - 0.5*(rhou^2+rhov^2+rhow^2)/rho)*(gamma-1)"]
  exprs = ["pr"]

</Updater>