CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Term for total Stresses (https://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::AUTO_WRITE
),
)
);
}

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

tmp<fvVectorMatrix> kEps::divDevRhoReff(volVectorField& U) const
{
return
(
- fvm::laplacian(muEff(), U)
);
}

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 14:49.