# generalBc (1d, 2d, 3d)¶

Applies a boundary condition that can be a general function of the input dataStructs as well as a separate list of dynVectors.

## Data¶

dynVectors (string vector)
Input 1 to N are input dynVectors which will be used in specifying the boundary condition.

## Parameters¶

indVars_ (string vector)
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.
dynVectorVars_ (string vector)
For each dynVector variable a “dynVars” string vector must be defined. So if dynVectors = [a, b] where a and b are each 3-component dynVectors then the combine block must define dynVectorVars_a = [“a1”,”a2”,”a3”] and dynVectorVars_b = [“b1”,”b2”,”b3”]. Note that the labels “a1”,”a2”,”a3” and “b1”,”b2”,”b3” are arbitrary; the requirement is that there is a unique name for each component of each input data structure.
preExprs (string vector)
contains extra definitions that can be used in evaluating exprs. Expressions can also contain the internally defined variables ‘x’,’y’,’z’,’t’,’dt’,’nX’,’nY’,’nZ’ where the last 3 variables are surface normals.
exprs (string vector)
Must be the size of the output vector q. Contains expressions representing each of the components of the output vector. This expression can also use the same internal variables as described in preExprs.
useModel (boolean)
If useModel is set to true then model will need to be set. An example would be model=eulerEqn. With this option the values put into exprs are assumed to be in local coordinates and then USim will rotate them to global coordinates. Thus, with model=eulerEqn you can specify the input momentum density normal to the surface by specifying the x component of momentum and setting the remaining components to 0.

## Example¶

<Updater bcBottom>
kind = generalBc2d
onGrid = domain

in = [q]
dynVectors = []

indVars_q = ["rho","mx","my","mz","en"]
exprs = ["rho","-mx","-my","-mz","en"]

out = [q]
entity = bottom
</Updater>