CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

calculating the viscous stress tensor tau for viscous dissipation heating

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By dgadensg
  • 2 Post By Bandfrosch
  • 1 Post By dgadensg

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 20, 2010, 14:58
Exclamation calculating the viscous stress tensor tau for viscous dissipation heating
  #1
New Member
 
Dan Gadensgaard
Join Date: Apr 2010
Posts: 13
Rep Power: 16
dgadensg is on a distinguished road
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()
    );

volTensorField gradU = fvc::grad(U);

volTensorField tau = mu * (gradU + gradU.T());



//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&)
/home/dang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:11: advarsel: unused variable ‘transonic’
/home/dang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:14: advarsel: unused variable ‘nOuterCorr’
TEqn.H:14: advarsel: unused variable ‘tau’
/home/dang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:3: advarsel: unused variable ‘nCorr’
/home/dang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:8: advarsel: unused variable ‘momentumPredictor’
/home/dang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:11: advarsel: unused variable ‘transonic’
/home/dang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:14: advarsel: unused variable ‘nOuterCorr’
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
dgadensg is offline   Reply With Quote

Old   April 20, 2010, 15:56
Default Found one error.
  #2
New Member
 
Dan Gadensgaard
Join Date: Apr 2010
Posts: 13
Rep Power: 16
dgadensg is on a distinguished road
Well, i have now found one of the bugs, but i still get an error as soon as i try to perform:

tau && gradU

what have i missed?

// Dan
atulkjoy likes this.
dgadensg is offline   Reply With Quote

Old   April 20, 2010, 18:32
Default
  #3
New Member
 
Join Date: Apr 2010
Posts: 10
Rep Power: 16
Bandfrosch is on a distinguished road
Hi dgadensg,

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
atulkjoy and überschwupper like this.
Bandfrosch is offline   Reply With Quote

Old   April 21, 2010, 04:16
Default
  #4
New Member
 
Dan Gadensgaard
Join Date: Apr 2010
Posts: 13
Rep Power: 16
dgadensg is on a distinguished road
Hi Bandfrosch

Well, that was a quick fix ;-), it works!

Thank you!

\\Dan
atulkjoy likes this.
dgadensg is offline   Reply With Quote

Old   January 11, 2023, 06:20
Default
  #5
Member
 
Join Date: Mar 2015
Posts: 36
Rep Power: 11
K.C. is on a distinguished road
I actually try a similar thing, but I am not sure about the correct term to add. Here you just used (tau && gradU).


Where did you got this term from?
In the documentation of energy equation (https://doc.cfd.direct/openfoam/energy-equation/), I found the term div(tau * U). Using the definition from wikipedia (https://de.wikipedia.org/wiki/Formel...Cr_Divergenzen) that would give


div(tau * U) = div(tau^T) * U + tau^T : gradU
tau is symmetric, so the transpose does not matter, but there would be a another contribution. Is that term zero for any reason, that I do not see, or did i got a wrong idea from the documentation of energy equation?


Thanks for any reply,
K.C.
K.C. is offline   Reply With Quote

Old   January 17, 2023, 16:20
Default
  #6
New Member
 
Join Date: Apr 2010
Posts: 10
Rep Power: 16
Bandfrosch is on a distinguished road
Hi K.C.


sorry for not being able to give you any advise, the problem of dgadensg ( the one who started the thread ) was a purely C++ syntactical one.


May be I find some time to think about it once more, please do not expect any reasonable answer soon.


Contacting dgadensg seems to be a better solution.


Bandfrosch
Bandfrosch is offline   Reply With Quote

Reply

Tags
dissipation, interfoam, temperature


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Incompressible viscous stress in sonicFoam vitke OpenFOAM Running, Solving & CFD 0 September 8, 2007 18:44
viscous dissipation modelling mahjoob FLUENT 0 January 31, 2007 19:52
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27
temperature rise due to viscous dissipation Marek Main CFD Forum 6 December 30, 2004 17:24
VISCOUS heat dissipation Joseph CFX 0 October 1, 2004 09:52


All times are GMT -4. The time now is 16:14.