CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   A data format error about fvc::div(surfaceScalarField,volVectorField) (https://www.cfd-online.com/Forums/openfoam-programming-development/236744-data-format-error-about-fvc-div-surfacescalarfield-volvectorfield.html)

Heno June 14, 2021 05:09

A data format error about fvc::div(surfaceScalarField,volVectorField)
 
Hi foamers,
I use the OpenFOAM 4.0. I want to caculate the divergence of heat flux multiply temperature gradient. So I definite the gradient of T and heat flux imitating velocity U and phi in my createfield.H by

volVectorField gradT(fvc::grad(T));

surfaceScalarField phigradT(linearInterpolate(k*gradT) & Mesh.Sf());

And the solve equation is

fvScalarMatrix SEqn
(
fvm::ddt(rhoFuel, S)
+ fvm::div(phiFuel, S)
+ fvc::div(phigradT, gradT)
)
S is entropy and volScalarField.

But when I compile my code, the message is

error: no match for ‘operator-’ (operand types are ‘Foam::tmp<Foam::fvMatrix<double> >’ and ‘Foam::tmp<Foam::GeometricField<Foam::Vector<doubl e>, Foam::fvPatchField, Foam::volMesh> >’)
- fvc::div(phigradT, gradT)
^
In file included from /opt/openfoam4/src/OpenFOAM/lnInclude/zero.H:101:0,
from /opt/openfoam4/src/OpenFOAM/lnInclude/UList.H:49,
from /opt/openfoam4/src/OpenFOAM/lnInclude/List.H:43,
from /opt/openfoam4/src/OpenFOAM/lnInclude/labelList.H:48,
from /opt/openfoam4/src/OpenFOAM/lnInclude/UPstream.H:42,
from /opt/openfoam4/src/OpenFOAM/lnInclude/Pstream.H:42,
from /opt/openfoam4/src/OpenFOAM/lnInclude/parRun.H:35,
from /opt/openfoam4/src/finiteVolume/lnInclude/fvCFD.H:4,


I don’t know how to set the gradient and the format of the surface flux is correct.

ybapat June 15, 2021 07:56

You can check diffusion term implementation is some other solver.

-Yogesh


All times are GMT -4. The time now is 21:25.