CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   How to add temperature to icoFoam - correct? (

uli July 30, 2012 12:31

How to add temperature to icoFoam - correct?
2 Attachment(s)
hi all

going through the tutorial

I did not completely understand the implementation of the energy equation.


            + fvm::div(phi, T)
            - fvm::laplacian(DT, T)

with phi = rho*U is equal to

whereas the energy equation is:

for a 2D flow not considerung the pressure terms, the dissipation function and with DT = thermal diffusivity = lambda/(rho * c_p)

Where is my mistake?

thank you

wyldckat July 30, 2012 14:00

Greetings Uli,

I'm unable to answer your question, but I can make the following affirmation: that tutorial is basically an "how to copy-paste-modify code from scalarTransportFoam into icoFoam".
Here's a step-by-step explanation about scalarTransportFoam:

Best regards,

uli July 31, 2012 14:38

hi Bruno, thanks for your response.

according to the ScalarTransportFoam the code is correct. Then in this case phi must be U and not rho * U.
I thought it's rho * U because here it is: (chapter 4.4.5)


wyldckat July 31, 2012 16:48

Hi Uli,

Ah! Now I get it... this is so basic that even I can answer :D
  • Incompressible solvers assume constant rho, therefore only present in the viscosity.
  • Compressible solvers need "rho" as a field, therefore present in "rho * U". ;)
Best regards,

All times are GMT -4. The time now is 09:36.