CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Writing additionnal output files during a run (http://www.cfd-online.com/Forums/openfoam-solving/59680-writing-additionnal-output-files-during-run.html)

laurentgla May 23, 2007 14: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

Laurent

liu May 23, 2007 15:05

mkDir(runTime.path()/"xyz");
 
mkDir(runTime.path()/"xyz");

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

logFile << bla bla bla << endl;

eugene May 23, 2007 15: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
(
IOobject
(
"R",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
turbulence().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 11:35

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


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