CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Monitor viscosity - RhoSimpleFoam (https://www.cfd-online.com/Forums/openfoam-post-processing/63662-monitor-viscosity-rhosimplefoam.html)

ABouvier April 15, 2009 12:08

Monitor viscosity - RhoSimpleFoam
 
Hello,

I'm using the rhoSimpleFoam solver and i'm tryin to print both viscosity mu and mut in every cell. My problem : unlike p, this viscosities aren't created -in creatField.H- with a volScalarField declaration but came from compressible::RASModel. So they don't appear in the volfieldstatus panel in paraview.
Does somebody know how to access this datas, in paraView or with any other means ?

Thx for your help

Alain

olesen April 17, 2009 02:47

Default Monitor viscosity - RhoSimpleFoam
 
2 Attachment(s)
Attached are two examples of post-processing utilities for calculating the laminar and turbulent viscosities. If you are not fussy about getting the Cmu value from the dictionary (or if you have different dictionaries than I do), you can comment out that bit (eg, with #if 0 .. #endif).
Creating a non-compressible version shouldn't be too hard either.

ABouvier April 17, 2009 08:01

Thx for your answer.
I have solved this problem by switching mu in basicThermo.C (and mut in kEpsilon.C) from NO_WRITE to AUTO_WRITE, but your solution is far less intrusive. I'm knew to OpenFoam and your exemples are a good way for me to go further in the code understanding ; - )

olesen April 17, 2009 08:18

Quote:

Originally Posted by ABouvier (Post 213263)
I have solved this problem by switching mu in basicThermo.C (and mut in kEpsilon.C) from NO_WRITE to AUTO_WRITE

While changing it like you did will work, it has at least two problems:
  • every OpenFOAM solver will now always output these fields.
  • you might have some fun when updating in the future.
A compromise might be to just add the write to your own solver in the main time-loop. You should be able to hook into the line with runTime.write() - this calls the Time::writeObject() method, which should return true at the output interval and false otherwise.

You could try this in the main time-loop (haven't checked if it actually works):

Code:

if (runTime.write())
{
    thermo->mu().write();
    turbulence->mut().write();
}


ABouvier April 17, 2009 08:53

Thx,
it works but only for mu. I don't know why but mut "has no member named ‘write’".
I've achieved to post-process mu and mut so I'm happy ; - ), even if a clean solution is always welcome

mahaputra April 24, 2009 18:37

Quote:

Originally Posted by olesen (Post 213221)
Attached are two examples of post-processing utilities for calculating the laminar and turbulent viscosities. If you are not fussy about getting the Cmu value from the dictionary (or if you have different dictionaries than I do), you can comment out that bit (eg, with #if 0 .. #endif).
Creating a non-compressible version shouldn't be too hard either.

Dear Olesen


Thanks for your post processing utilities

im sorry, stupid question,

could you please teach, clear step by step how to work with your post-processing utilities for calculating the laminar and turbulent viscosities?

im facing a similar case.

please give me help


All times are GMT -4. The time now is 06:02.