CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   calculating the viscous stress tensor tau for viscous dissipation heating (https://www.cfd-online.com/Forums/openfoam-programming-development/75264-calculating-viscous-stress-tensor-tau-viscous-dissipation-heating.html)

calculating the viscous stress tensor tau for viscous dissipation heating

Hi all..

I have made a interTempFoam solver, based on the interFoam solver, in which i have included the temperature equation. However, as i am simulating a very viscous flow (Metal Injection Moulding - POM with metal powder) i would like to add the heat of dissapation to the temperature equation.

To do this i need the stress tensor tau, and i have tried to implement it as shown in the code below:

TEqn.H file:
Code:

surfaceScalarField mu
(
"mu",
twoPhaseProperties.mu()
);

//Temperature equation (with viscous dissipation):
fvScalarMatrix TEqn
(

rho * cp * (fvm::ddt(T) + fvm::div(phi,T)) - fvm::laplacian(kT,T)+ tau && gradU
);

TEqn.solve();

The equation is added to the solver just before the PISO-loop.

When i try to compile the solver it gives me a lot of errors, shown below:
Code:

In file included from interTempFoam.C:90:
TEqn.H: In function ‘int main(int, char**)’:
TEqn.H:10: fejl: no matching function for call to ‘Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricField(const char [3], Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >)’
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:607: bemærk: candidates are: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&, const Foam::wordList&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:572: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&, const Foam::word&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:541: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::word&, const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:508: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::word&, const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:476: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:444: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:412: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:374: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const typename GeoMesh::Mesh&, Foam::Istream&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:333: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const typename GeoMesh::Mesh&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:309: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const typename GeoMesh::Mesh&, const Foam::dimensionSet&, const Foam::Field<Type>&, const Foam::PtrList<PatchField<Type> >&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:279: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const typename GeoMesh::Mesh&, const Foam::dimensioned<Type>&, const Foam::wordList&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:250: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const typename GeoMesh::Mesh&, const Foam::dimensioned<Type>&, const Foam::word&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:223: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const typename GeoMesh::Mesh&, const Foam::dimensionSet&, const Foam::wordList&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricField.C:193: bemærk:                Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const typename GeoMesh::Mesh&, const Foam::dimensionSet&, const Foam::word&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]
TEqn.H:14: fejl: no match for ‘operator*’ in ‘mu * Foam::operator+(const Foam::GeometricField<TypeR, PatchField, GeoMesh>&, const Foam::tmp<Foam::GeometricField<Type1, PatchField, GeoMesh> >&) [with Type1 = Foam::Tensor<double>, Type2 = Foam::Tensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::GeometricField<Type, PatchField, GeoMesh>::T() const [with Type = Foam::Tensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]()))))’
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionSet.H:266: bemærk: candidates are: Foam::dimensionSet Foam::operator*(const Foam::dimensionSet&, const Foam::dimensionSet&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionedScalar.H:56: bemærk:                Foam::dimensionedScalar Foam::operator*(const Foam::dimensionedScalar&, Foam::scalar)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/scalarField.H:81: bemærk:                Foam::tmp<Foam::Field<double> > Foam::operator*(const Foam::UList<double>&, const Foam::UList<double>&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/scalarField.H:81: bemærk:                Foam::tmp<Foam::Field<double> > Foam::operator*(const Foam::UList<double>&, const Foam::tmp<Foam::Field<double> >&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/scalarField.H:81: bemærk:                Foam::tmp<Foam::Field<double> > Foam::operator*(const Foam::tmp<Foam::Field<double> >&, const Foam::UList<double>&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/scalarField.H:81: bemærk:                Foam::tmp<Foam::Field<double> > Foam::operator*(const Foam::tmp<Foam::Field<double> >&, const Foam::tmp<Foam::Field<double> >&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/symmTensorField.H:71: bemærk:                Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam::operator*(const Foam::UList<Foam::SymmTensor<double> >&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/symmTensorField.H:71: bemærk:                Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam::operator*(const Foam::tmp<Foam::Field<Foam::SymmTensor<double> > >&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/tensorField.H:76: bemærk:                Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam::operator*(const Foam::UList<Foam::Tensor<double> >&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/tensorField.H:76: bemærk:                Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam::operator*(const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/tensorField.H:77: bemærk:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator*(const Foam::UList<Foam::Vector<double> >&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/tensorField.H:77: bemærk:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator*(const Foam::tmp<Foam::Field<Foam::Vector<double> > >&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionedSymmTensor.H:69: bemærk:                Foam::dimensionedVector Foam::operator*(const Foam::dimensionedSymmTensor&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionedTensor.H:75: bemærk:                Foam::dimensionedVector Foam::operator*(const Foam::dimensionedTensor&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionedTensor.H:78: bemærk:                Foam::dimensionedTensor Foam::operator*(const Foam::dimensionedVector&)
make: *** [Make/linux64GccDPOpt/interTempFoam.o] Fejl 1

Hope someone can tell me, og give me a hint as to what i am doing wrong?!

// Dan

Found one error.

Well, i have now found one of the bugs, but i still get an error as soon as i try to perform:

what have i missed?

// Dan

 Bandfrosch April 20, 2010 17:32

try: rho * cp * (fvm::ddt(T) + fvm::div(phi,T)) - fvm::laplacian(kT,T)+ ( tau && gradU )

( parentheses around double inner product , C operator precedence )

Bandfrosch