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/)
-   -   Term for total Stresses (http://www.cfd-online.com/Forums/openfoam-programming-development/87009-term-total-stresses.html)

james.t April 8, 2011 14:16

Term for total Stresses
 
Hello,

in the k-epsilon turbulence model the total stress term is calculated as volSymmTensorField
Code:

tmp<volSymmTensorField> kEps::devRhoReff() const
{
    return tmp<volSymmTensorField>
    (
        new volSymmTensorField
        (
            IOobject
            (
                "devRhoReff",
                runTime_.timeName(),
                mesh_,
                IOobject::NO_READ,
                IOobject::AUTO_WRITE
            ),
          -muEff()*dev(twoSymm(fvc::grad(U_)))
        )
    );
}

and the source term for the momentum equation as fvVectorMatrix
Code:

tmp<fvVectorMatrix> kEps::divDevRhoReff(volVectorField& U) const
{
    return
    (
      - fvm::laplacian(muEff(), U)
      - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
    );
}

Now I'd like to modify the total stress tensor devRhoReff and use it for the calculation of the source term of the momentum equation divDevRhoReff like this:
Code:

fvVectorMatrix divDevRhoReff = fvc::div(devRhoReff);
However the following error occurs:
Code:

error: conversion from ‘Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >’ to non-scalar type ‘Foam::fvVectorMatrix’ requested
Is there another way to convert the total stress tensor devRhoReff to the source term divDevRhoReff?

Thanks alot!

James


All times are GMT -4. The time now is 02:57.