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>& fld )

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

setValue ( fvMatrix<Type}>& eqn, const label fieldI )

where : fld is the field in fieldNames eqn is the fvMatrix


Source usage

Example usage in controlDict:

energySource
{
    type            scalarCodedSource;

    active          true;
    selectionMode   all;

    scalarCodedSourceCoeffs
    {
        fieldNames      (h);
        redirectType    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;
        #};

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

        // Dummy entry. Make dependent on above to trigger recompilation
        code
        #{
            $codeInclude
            $codeCorrect
            $codeAddSup
            $codeSetValue
        #};
    }

    sourceTimeCoeffs
    {
        // Dummy entry
    }
}
Source files

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