CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Writing Averaged Data into a Text File. (https://www.cfd-online.com/Forums/openfoam/94741-writing-averaged-data-into-text-file.html)

kmpang November 24, 2011 03:15

Writing Averaged Data into a Text File.
 
Good day to all!

I'm a beginner to OpenFOAM. I'm using OpenFOAM 2.0.1 and now learning OpenFOAM with the dieselFoam tutorial. I'm trying to write the domain averaged data on an output text file but I couldn't get it out. Let's say for instance I try to extract the averaged pressure, I added

================================================== ===================
functions
(
pAverage
{
functionObjectLibs ("libutilityFunctionObjects.so");
type coded;
redirectType average;
outputControl outputTime;
code
#{
const volScalarField& p =
mesh().lookupObject<volScalarField>("p");
Info<<"p avg:" << average(p) << endl;
#};
}
);
================================================== ===================

into the controlDict file. It's supposed to at least write the average pressure to the terminal if I'm not mistaken but I didn't observe anything.

Can you please kindly advise that how can I solve the problem?

Thank you very much in advance. :)

Best regards,
Kar.

gschaider November 24, 2011 15:27

Quote:

Originally Posted by kmpang (Post 333375)
Good day to all!

I'm a beginner to OpenFOAM. I'm using OpenFOAM 2.0.1 and now learning OpenFOAM with the dieselFoam tutorial. I'm trying to write the domain averaged data on an output text file but I couldn't get it out. Let's say for instance I try to extract the averaged pressure, I added

================================================== ===================
functions
(
pAverage
{
functionObjectLibs ("libutilityFunctionObjects.so");
type coded;
redirectType average;
outputControl outputTime;
code
#{
const volScalarField& p =
mesh().lookupObject<volScalarField>("p");
Info<<"p avg:" << average(p) << endl;
#};
}
);
================================================== ===================

into the controlDict file. It's supposed to at least write the average pressure to the terminal if I'm not mistaken but I didn't observe anything.

Can you please kindly advise that how can I solve the problem?

Thank you very much in advance. :)

Best regards,
Kar.

Problem is outputControl. The FO is only executed if the data is written. So there IS output. Just not as often as you'd like it

kmpang November 25, 2011 23:46

Thank you Bernhard for the information. I shall try again to figure it out. =)


All times are GMT -4. The time now is 04:16.