CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Writing Averaged Data into a Text File.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 24, 2011, 03:15
Smile Writing Averaged Data into a Text File.
  #1
New Member
 
Pang
Join Date: Mar 2011
Location: Denmark
Posts: 25
Rep Power: 15
kmpang is on a distinguished road
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.
kmpang is offline   Reply With Quote

Old   November 24, 2011, 15:27
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by kmpang View Post
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
gschaider is offline   Reply With Quote

Old   November 25, 2011, 23:46
Default
  #3
New Member
 
Pang
Join Date: Mar 2011
Location: Denmark
Posts: 25
Rep Power: 15
kmpang is on a distinguished road
Thank you Bernhard for the information. I shall try again to figure it out. =)
kmpang is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
[Gmsh] Compiling gmshFoam with OpenFOAM-1.5 BlGene OpenFOAM Meshing & Mesh Conversion 10 August 6, 2009 05:26
Problems With Journal When Writing Forces To File Andrew FLUENT 2 September 23, 2005 03:12
PHI file structure Eugene Phoenics 9 November 2, 2001 23:00


All times are GMT -4. The time now is 20:26.