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

Data conversion at each time step for specific fields

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 22, 2009, 10:37
Default Data conversion at each time step for specific fields
  #1
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 8
melanie is on a distinguished road
Hello,

it's been quite a long time since I worked with OF... but now I'm back! And I am dealing with an unsteady simulation for which I would like to export, at each time step, pressure and velocity data in Ensight format. I have to mention that the mesh is quite big, and that this represents a large amount of data to be stored.

Of course one solution is to save OF data at each time step, and then reconstruct data coming from the different proc, convert it to Ensight format, remove the OF data and keep only the pressure and velocity Ensight files. This means a lot of manual operations. Furthermore, I cannot afford, even temporarily, to store too much data (many fields stored by OF are not useful to my post-processing).

Does someone have an idea to help me? I had a look at the work done with pyFoam, could it be useful?

Thank you all for your suggestions!
melanie
melanie is offline   Reply With Quote

Old   July 23, 2009, 06:18
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by melanie View Post
Hello,

it's been quite a long time since I worked with OF... but now I'm back! And I am dealing with an unsteady simulation for which I would like to export, at each time step, pressure and velocity data in Ensight format. I have to mention that the mesh is quite big, and that this represents a large amount of data to be stored.

Of course one solution is to save OF data at each time step, and then reconstruct data coming from the different proc, convert it to Ensight format, remove the OF data and keep only the pressure and velocity Ensight files. This means a lot of manual operations. Furthermore, I cannot afford, even temporarily, to store too much data (many fields stored by OF are not useful to my post-processing).

Does someone have an idea to help me? I had a look at the work done with pyFoam, could it be useful?
If you want to write selected fields at every time-step one option would be to write a functionObject that basically does

U.write();
p.write();

(just an example). There is no such functionObject that I know of (but it might be an interesting candidate for the simpleFunctionObjects).

This still leaves the problem that the data still is in OF-format. The hardcore solution would be to lift the functionality of the ensight-Converter into a functionObject (good luck)

In pyFoam there is currently is no ready-made solution to your problem (I have been thinking about a facility that "watches" a case and if there is a new time directory calls a utility (reconstructPar, foamDataToExcel etc) but never had the time/pressure to implement it. Plus in your case the actual conversion probably would take more CPU-time than the calculation because the converter would have to load the whole mesh every time it is called)

Bernhard
gschaider is offline   Reply With Quote

Old   July 27, 2009, 06:21
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Quote:
Originally Posted by melanie View Post

I am dealing with an unsteady simulation for which I would like to export, at each time step, pressure and velocity data in Ensight format.
...
Does someone have an idea to help me?
A functionObject would be the first place to examine. The next bit which you should check is how foamToEnsightParts is calling the Ensight conversion routines (src/conversion). At the moment, writing in parallel isn't supported, but this should still give you very good starting points.

/mark
olesen is offline   Reply With Quote

Old   July 27, 2009, 07:21
Default
  #4
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 8
melanie is on a distinguished road
Thanks a lot Mark and Bernhard, I will have a look at these functionObject you mention. I will let you know what's going on!
mélanie
melanie is offline   Reply With Quote

Old   September 23, 2009, 09:44
Default
  #5
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 8
melanie is on a distinguished road
hi, actually I left this subject for a time, and now that I'm back I have discovered that you already made the job with writeFields* functionObjects! Thanks a lot Bernhard. Now I have to switch to OF1.6 to benefit from the timeSelector feature of foamToEnsight utility, and the processing will be almost perfect! Indeed foamToEnsight is able to work in parallel on decomposed cases so the reconstruction step is not any more required.
mélanie
melanie is offline   Reply With Quote

Old   September 23, 2009, 12:20
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by melanie View Post
hi, actually I left this subject for a time, and now that I'm back I have discovered that you already made the job with writeFields* functionObjects! Thanks a lot Bernhard. Now I have to switch to OF1.6 to benefit from the timeSelector feature of foamToEnsight utility, and the processing will be almost perfect! Indeed foamToEnsight is able to work in parallel on decomposed cases so the reconstruction step is not any more required.
mélanie
Guilty. I forgot to announce it. And I think it isn't documented on the Wiki-page. If you would do that (doesn't have to be more than for the other stuff) it would show me that your "Thanks" is sincere

Bernhard

PS: yes. This is part of a plot to get more people to contribute. Guilty again
gschaider is offline   Reply With Quote

Old   September 24, 2009, 03:46
Default
  #7
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 8
melanie is on a distinguished road
This is done Bernhard, I added a very short description out of the header of .H files on the Wiki-page. My first contribution to the community...
melanie
melanie is offline   Reply With Quote

Old   September 28, 2009, 11:38
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by melanie View Post
This is done Bernhard, I added a very short description out of the header of .H files on the Wiki-page.
Great.

Quote:
Originally Posted by melanie View Post
My first contribution to the community...
But beware: this might become a habit
gschaider is offline   Reply With Quote

Old   September 29, 2009, 02:12
Default
  #9
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 8
melanie is on a distinguished road
Quote:
But beware: this might become a habit
... and I will start today!!! Indeed I would like to update these functionObjects in order to get them comply to the ''standard'' OF output, i.e. with a uniform/time file in each time directory (see thread Time selection in FoamToEnsight utility for the complete story). Unfortunately, I don't know where to start. I was unable to locate in OF sources where OF data writing is defined... Could you please give me a hand?
Thanks a lot!
melanie
melanie is offline   Reply With Quote

Old   September 29, 2009, 02:26
Default
  #10
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Quote:
Originally Posted by melanie View Post
... Indeed I would like to update these functionObjects in order to get them comply to the ''standard'' OF output, i.e. with a uniform/time file in each time directory
...
Unfortunately, I don't know where to start. I was unable to locate in OF sources where OF data writing is defined... Could you please give me a hand?
The place to look is src/OpenFOAM/db/Time/TimeIO.C
specifically the Foam::Time::writeObject() method
olesen is offline   Reply With Quote

Old   September 29, 2009, 17:34
Default
  #11
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by melanie View Post
... and I will start today!!! Indeed I would like to update these functionObjects in order to get them comply to the ''standard'' OF output, i.e. with a uniform/time file in each time directory (see thread Time selection in FoamToEnsight utility for the complete story). Unfortunately, I don't know where to start. I was unable to locate in OF sources where OF data writing is defined... Could you please give me a hand?
Thanks a lot!
melanie
I didn't read Mark's answer before answering in the other thread. Should have. If I read that source correctly calling that method won't help as it only write uniform when it thinks the outputTime has come (something that FO tries to bypass). So I guess you'll have to emulate the uniform-writing part. And make sure not to rewrite it when Time already wrote it

Bernhard
gschaider is offline   Reply With Quote

Reply

Tags
conversion, ensight, unsteady

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
IcoTopoFoam case is aborted deepblue17 OpenFOAM Running, Solving & CFD 25 December 2, 2010 15:20
Export AreaAve data at each time step in CFX Post Kumar CFX 2 August 22, 2007 12:32
natural convection - time step size co2 FLUENT 7 June 3, 2004 21:56
guidelines on time step Effendi Ali FLUENT 3 February 4, 2004 08:50
unsteady calcs in FLUENT Sanjay Padhiar Main CFD Forum 1 March 31, 1999 12:32


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