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

Adding viscous dissipation term to energy equation

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By hjasak

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 25, 2006, 08:27
Default Hi, I am interested in imp
  #1
newbee
Guest
 
Posts: n/a
Hi,

I am interested in implementing the viscous heat dissipation term laplacian(mu,U) in the following energy equation:

solve
(
fvm::div(phi, T)
- fvm::laplacian(alphaEff, T)
- S*q/(rho*Cp) (<-source term)
- fvm::laplacian(mu, U) (dissipation term)
);
}

I am a beginner at openFoam so the question might be basic for some on this sight, sorry.

anyway. when trying to compile this the following error message starts like:

SOURCE_DIR=.
SOURCE=hSimpleFoam.C ; g++ -m32 -Dlinux -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-30 -I/home/erik/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/lnInclude -I/home/erik/OpenFOAM/OpenFOAM-1.3/src/turbulenceModels -I/home/erik/OpenFOAM/OpenFOAM-1.3/src/transportModels -I/home/erik/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -pthread -c $SOURCE -o Make/linuxGcc4DPOpt/hSimpleFoam.o
TT.H: In function 'int main(int, char**)':
TT.H:40: error: no match for 'operator-' in 'Foam::operator-(const Foam::tmp<foam::fvmatrix<type> >&, const Foam::tmp<foam::geometricfield<type,> >&) [with Type = double](((const Foam::tmp<foam::geometricfield<double,> >&)((const Foam::tmp<foam::geometricfield<double,> >*)(& Foam::operator/(const Foam::tmp<foam::geometricfield<type,> >&, const Foam::dimensioned<double>&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::dimensioned<double>&)((const Foam::dimensioned<double>*)(& Foam::operator*(const Foam::dimensioned<double>&, const Foam

Does anyone know what I am doing wrong

/Thanks Erik
  Reply With Quote

Old   August 25, 2006, 08:41
Default Nope, not like that: what you
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Nope, not like that: what you are trying to do here is to add a laplacian with U as a working variable into the equation for temperature. Does not make sense

It is basically something like (adjust for compressible fluid etc):

volTensorField gradU = fvc::grad(U);

the term you want is something like

(mu_l*(gradU + gradU.T()) && gradU)

This lot appears as the source in the energy equation.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   August 25, 2006, 10:56
Default thank you for your answer!
  #3
newbee
Guest
 
Posts: n/a
thank you for your answer!

Im working on a incompressible flow (modification of simpleFoam) so I guess i dont need to adjust your formula.

I have two question on the suggested source term.

what is mu_|?
what is gradU.T()?

my case is a channel with hydraulic diameter of 53mm and 11 meters long. The channel is for an air flow of 20 m/s(approx incompressible). im hoping this extra term will rise the temperature 5 more degrees so that my simulation fits experimental data.

Thanks again
/Erik
  Reply With Quote

Old   August 25, 2006, 12:08
Default mu_l is laminar viscosity. gr
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
mu_l is laminar viscosity. gradU.T() would be a transpose of the gradU tensor. For incompressible flows, you can just do mu_l*magSqr(gradU), that should do the trick. Don't forget to add turbulence dissipation (epsilon) to the energy blance.

Hrv
Aaron_L likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   August 25, 2006, 15:33
Default Thank you once again, another
  #5
newbee
Guest
 
Posts: n/a
Thank you once again,
another novice question follows I am afraid.

How is epsilon to be added and do you know where I can find ducumentation of this so I can have som sort of theoretical backupp for my thesis work.

This formula was no ploblem to add to the energy equation but I wouldent expect you to be surpriced either.

/Erik
  Reply With Quote

Old   January 17, 2018, 12:56
Default
  #6
Senior Member
 
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12
alimea is on a distinguished road
Quote:
Originally Posted by hjasak View Post
Nope, not like that: what you are trying to do here is to add a laplacian with U as a working variable into the equation for temperature. Does not make sense

It is basically something like (adjust for compressible fluid etc):

volTensorField gradU = fvc::grad(U);

the term you want is something like

(mu_l*(gradU + gradU.T()) && gradU)

This lot appears as the source in the energy equation.

Enjoy,

Hrv

Hi
I also want to add viscous dissipation to energy eqn. but my fluid is not Newtonian and has a special stress tensor. So the work of stress tensor field is "tau && grad(U)"

1- is it a correct relation for work of stress tensor field? or I should write:
tau && [grad(U) + transpose of (grad(U))]

2- is it correct to write:

solve
(
fvm::div(phi, T)
- fvm::laplacian(alphaEff, T)
- tau && grad(U)
);

thank you
alimea is offline   Reply With Quote

Old   March 3, 2021, 11:37
Default
  #7
New Member
 
Join Date: Oct 2019
Posts: 13
Rep Power: 7
anthony761 is on a distinguished road
I think now, it can just be enabled in fvOption with
Code:
dissiapation1
{
    type            viscousDissipation;
    selectionMode   cellSet;
    cellSet         sourceCells1;
}
see: https://www.openfoam.com/documentati...ssipation.html
anthony761 is offline   Reply With Quote

Old   November 17, 2024, 18:36
Default
  #8
Senior Member
 
aerothermal's Avatar
 
Guilherme da Silva
Join Date: Aug 2010
Location: Sao Paulo - Brazil
Posts: 120
Rep Power: 16
aerothermal is on a distinguished road
Send a message via Skype™ to aerothermal
Quote:
Originally Posted by anthony761 View Post
I think now, it can just be enabled in fvOption with
Code:
dissiapation1
{
    type            viscousDissipation;
    selectionMode   cellSet;
    cellSet         sourceCells1;
}
see: https://www.openfoam.com/documentati...ssipation.html
Code:
  // Step 1: Calculate deviatoric stress tensor
  volSymmTensorField devRhoReff = turbulence->devRhoReff();

  // Step 2: Compute the velocity gradient tensor
  volTensorField gradU = fvc::grad(U);

  // Step 3: Compute the viscous dissipation term
  volScalarField viscousDissipation("viscousDissipation", devRhoReff && gradU);

  // Optional: Log the min and max of viscous dissipation for debugging
  Info << "Viscous Dissipation (min, max): "
    << min(viscousDissipation).value() << ", "
    << max(viscousDissipation).value() << endl;

  // Step 4: Construct the enthalpy equation
  fvScalarMatrix hEqn
  (
    fvm::ddt(rho, h)
  + fvm::div(phi, h)
  - fvm::laplacian(turbulence->alphaEff(), h)
  ==
    DpDt + viscousDissipation
  );
based on

https://develop.openfoam.com/Develop...sDissipation.C
aerothermal is offline   Reply With Quote

Reply


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
Source term in energy equation macdidi CFX 15 May 9, 2017 21:23
Bouyancy term in Energy equation CFDtoy Main CFD Forum 2 August 4, 2008 12:04
Mass transfer Term in Mixture Energy Equation CFDtoy Main CFD Forum 0 July 3, 2008 17:14
Is the viscous dissipation term fully included? yann Phoenics 0 June 5, 2003 11:23
How to deal with this energy equation source term? H.S.Fang FLUENT 2 December 27, 2001 07:42


All times are GMT -4. The time now is 01:40.