Properties🔗
- Wrapper around the fixedValue condition
- Provides an interface to prescribe a user-coded condition (C++)
- Applicable to all variable types
Usage🔗
A simple example showing how to ramp the patch values as a function of time
\[p = \min (10, 0.1 t)\]is specified in the field file using:
<patchName>
{
type codedFixedValue;
value uniform 0;
// Name of generated boundary condition
redirectType rampedFixedValue;
code
#{
const scalar t = this->db().time().value();
operator==(min(10, 0.1*t));
#};
}
Only basic functionality is offered by default, e.g. access to the mesh
(Foam::fvMesh) and time (Foam::Time) databases. For more complex conditions
access to additional classes is enabled via the optional codeInclude
and
codeOptions
entries, e.g.
codeInclude
#{
#include "fvCFD.H"
#};
codeOptions
#{
-I$(LIB_SRC)/finiteVolume/lnInclude
#};
This is equivalent to the required entries in the Make/options
file when
building code libraries.
Further information🔗
Source code:
Related: