Skip to main content

codedMixed

Description

The codedMixed is a mixed-value boundary condition that provides an interface to prescribe a user-coded condition and constructs a new boundary condition on-the-fly which is then used to evaluate.

Usage

The condition requires entries in both the boundary and field files.

Boundary file

<patchName>
{
type <type>;
...
}

Field file

<patchName>
{
// Mandatory entries
type codedMixed;
name <word>;

// Optional entries
codeInclude
#{
#include "fvCFD.H"
#};

codeOptions
#{
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
#};

codeLibs
#{
-lfiniteVolume \
-lmeshTools
#};

localCode
#{
// OpenFOAM C++ code
#};

codeContext <dict>;

// Conditional entries

// if the 'code' keyword is present
code
#{
// OpenFOAM C++ code
#};

// if the 'code' keyword is not present,
// read the code from a dictionary from 'system/codeDict'
<patchName>
{
code
#{
// OpenFOAM C++ code
#};
}

// Inherited entries
refValue min(10, 0.1*this->db().time().value());
refGradient Zero;
valueFraction uniform 1;
}

where:

PropertyDescriptionTypeRequiredDefault
typeType name: codedMixedwordyes-
nameName of the generated conditionwordyes-
codeOpenFOAM C++ code for patch value assignmentcodeyes-
codeIncludeInclude files-no-
codeOptionsCompiler line: added to EXE_INC (Make/options)-no-
codeLibsLinker line: added to LIB_LIBS (Make/options)-no-
localCodeLocal static functions-no-
codeContextAdditional dictionary context for the codedictno-

The inherited entries are elaborated in:

Further information

Tutorial:

  • N/A

Source code:

API:

History: Introduced in version 2.1.0