CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Writing additionnal output files during a run (

laurentgla May 23, 2007 13:53

Hi everyone, I am running t
Hi everyone,

I am running turbFOAM with a k-e turbulence model and wanted to see the evolutions of the Reynolds stresses during the calculation.
So I was looking for a way to write a R file for each step next to U, k, epsilon, etc... But I'm a bit lost and don't know where to start.
Where is the part of code stipulating which output has to be written down?

Thank you in advance


liu May 23, 2007 14:05


OFstream logFile(runTime.path()/"xyz"/"myLog.dat");

logFile << bla bla bla << endl;

eugene May 23, 2007 14:07

Reynolds stress never gets cal
Reynolds stress never gets calculated, it there is no option to write it out.

The divergence or R does get calculated, but it is a temporary field and does not exist for most of the calculation.

If you want to write out R, you first have to create the R field in createFields after the turbulence model has been constructed:

volVectorField R

Then you have to update it after each loop:
R = turbulence().R()();

calculate it using the turbulence().R()() function call.

It will write out automatically.

laurentgla May 25, 2007 10:35

thanks very much for your mess
thanks very much for your messages. It now works after some minor tuning.

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