codedSource Class Reference

Constructs on-the-fly fvOption source. More...

Detailed Description

Constructs on-the-fly fvOption source.

The hook functions take the following arguments:

codeCorrect
(
    GeometricField<Type, fvPatchField, volMesh>& field
)

codeAddSup
(
    fvMatrix<Type>& eqn,
    const label fieldi
)

codeAddSupRho
(
    const volScalarField& rho,
    fvMatrix<Type>& eqn,
    const label fieldi
)

codeConstrain
(
    fvMatrix<Type>& eqn,
    const label fieldi
)

where : field is the name of the field in the fields list eqn is the fvMatrix

These are in addition to the usual code entries:

codeInclude : include files
codeOptions : compiler line: added to EXE_INC (Make/options)
codeLibs : linker line: added to LIB_LIBS (Make/options)
localCode : c++; local static functions
Usage
Example usage in controlDict:
energySource
{
    type            scalarCodedSource;

    scalarCodedSourceCoeffs
    {
        selectionMode   all;

        fields          (h);
        name            sourceTime;

        codeInclude
        #{
        #};

        codeCorrect
        #{
            Pout<< "**codeCorrect**" << endl;
        #};

        codeAddSup
        #{
            const Time& time = mesh().time();
            const scalarField& V = mesh_.V();
            scalarField& heSource = eqn.source();
            heSource -= 0.1*sqr(time.value())*V;
        #};

        codeConstrain
        #{
            Pout<< "**codeConstrain**" << endl;
        #};
    }
}
Source files

The documentation for this class was generated from the following file: