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

How can I write selective additional fields using functionObjects?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 29, 2011, 12:31
Question How can I write selective additional fields using functionObjects?
  #1
New Member
 
Fatemeh
Join Date: Apr 2011
Location: Boston
Posts: 9
Rep Power: 6
fpmhadi is on a distinguished road
Hi everybody,

I want to have the positions of cell centers (x,y,z) as out put in my time directories. I know that the utility "writeCellCenters" do what I want, but I prefer to get them automatically.

I searched and found out that functionObjects are capable of doing so. I found from

http://openfoamwiki.net/index.php/Co...unctionObjects

that the type writeAdditionalFields is exactly what I want. I found this example in their documentations:

Code:
functions 
(
    writeEnthalpy 
    {
        functionObjectLibs   ("libsimpleFunctionObjects.so");
        type                 writeAdditionalFields;
        fieldNames           ( h mu );
        after 0.1;
    }
);
But now I do not know how to use it to get x, y and z positions of cell centers of my mesh.

Any help is appreciated.
fpmhadi is offline   Reply With Quote

Old   June 30, 2011, 02:51
Default
  #2
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
can i ask you, why? is ur mesh moving ? if its fixed why do u need to have them in each time step?
however maybe you can add something like to ur solver and compile it:

volVectorField cellCenter //add
(
IOobject
(
"cellCenter",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh.Cp()
);
nimasam is offline   Reply With Quote

Old   June 30, 2011, 10:31
Default
  #3
New Member
 
Fatemeh
Join Date: Apr 2011
Location: Boston
Posts: 9
Rep Power: 6
fpmhadi is on a distinguished road
Hi Nima,

Thanks for your hint.

Actually I do not want to have my grid in every time step. That would be fine to have the grid in all time directories although it's not necessary for me now.

You are right. It's possible to obtain the mesh changing the solver, but I do not want to do so.

Fatemeh
fpmhadi is offline   Reply With Quote

Old   July 14, 2011, 17:41
Default
  #4
New Member
 
Fatemeh
Join Date: Apr 2011
Location: Boston
Posts: 9
Rep Power: 6
fpmhadi is on a distinguished road
Hi,

I want to be more specific about my question posted on June 29th.

About using that example I found in functionObject documentations; there are two points:
  1. I do not know where the keyword "writeEnthalpy" has come from. How can I find one suitable for writing cell positions?
  2. I have the same question about fieldNames "h mu". How can I have a suitable fieldName for cell centers?
Thanks,
Fatemeh
fpmhadi is offline   Reply With Quote

Reply

Tags
cellcenters, functionobjects

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where to define which fields to write? bgoeppner OpenFOAM 8 July 15, 2011 11:00
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 6 April 17, 2010 23:40
PostChannel maka OpenFOAM Post-Processing 5 July 22, 2009 09:15
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 13:14.