CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)

 uli July 30, 2012 12:31

How to add temperature to icoFoam - correct?

2 Attachment(s)
hi all

going through the tutorial http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

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

Code:

```            fvm::ddt(T)             + fvm::div(phi, T)             - fvm::laplacian(DT, T)```
with phi = rho*U is equal to

http://www.cfd-online.com/Forums/att...1&d=1343633104

whereas the energy equation is:

http://www.cfd-online.com/Forums/att...1&d=1343633240

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
Uli

 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: http://openfoamwiki.net/index.php/ScalarTransportFoam

Best regards,
Bruno

 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: http://www.openfoam.org/docs/user/fvSchemes.php (chapter 4.4.5)

Uli

 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,
Bruno

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