CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Modifing Turbulence Production Term (http://www.cfd-online.com/Forums/openfoam-programming-development/105465-modifing-turbulence-production-term.html)

twray July 31, 2012 14:45

Modifing Turbulence Production Term
 
I wish to add something along the lines of f1()*P() to the production term of the Spalart Allmaras turbulence model. Where P() is defined as follows with relations based on the Boussinesq approximation:

http://i.imgur.com/4ywvt.png?1

I thought I could accomplish this using R() as defined in SpallartAllmaras.C along with


Code:

const volScalarField P = fvm::Sp(fvc::grad(U_),R());

but this has not worked.

Am I using Sp correctly? Or does my error come from a tensor/scalar field mismatch?

SpalartAllmaras::R() is shown below for your reference.

Any insight is appreciated.

Code:

tmp<volSymmTensorField> SpalartAllmaras::R() const
{
    return tmp<volSymmTensorField>
    (
        new volSymmTensorField
        (
            IOobject
            (
                "R",
                runTime_.timeName(),
                mesh_,
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            ((2.0/3.0)*I)*k() - nut()*twoSymm(fvc::grad(U_))
        )
    );
}




All times are GMT -4. The time now is 04:42.