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

can someone explain IO in OpenFOAM

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 5, 2015, 01:30
Default can someone explain IO in OpenFOAM
  #1
Member
 
Karelke Yu
Join Date: Dec 2014
Posts: 66
Rep Power: 3
cfdopenfoam is on a distinguished road
greetings to all.

i am in great interest of OF and have walked through the two guides (i.e. UG and PG), as well as some basics of C++. and also, i have looked into some source code (e.g. icoFoam). however, i found that the IO operating is of great difficulties and i nearly could not handle its mechanisms. here is something always makes me confused:

(1) how does the runTime.write() works? i know runTime is an object of Class Time, but what about the function write()? how can i proceeding to that or add some code to that (if possible)?

(2)how are the classes related, Time, objectRegistry, IOdictionary, IOobject, regIOobject, runTimeSelectionTables, addToRunTimeSelectionTable etc? and if certain user-defined volScalarField p is intended to be written at every writeInterval, how should i make the implementation? add it to the createFields.H file? or if i want to output myStream into a file at every writeInterval/timeStep?

(3)i have went through the 'sample' utility. however, i think i should firstly overcome the two foregoing problems and then maybe i could develop mySample.

thanks for the attention. any suggestion (or materials about how to IO in OF) will make my life easier.
cfdopenfoam is offline   Reply With Quote

Old   April 5, 2015, 06:56
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,556
Blog Entries: 39
Rep Power: 97
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Quick answer: http://openfoamwiki.net/index.php/OpenFOAM_guide
wyldckat is offline   Reply With Quote

Old   April 6, 2015, 08:29
Default how to IO freewill in OF
  #3
Member
 
Karelke Yu
Join Date: Dec 2014
Posts: 66
Rep Power: 3
cfdopenfoam is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
thank you very much, Bruno. the guide you offered really benefits me a lot and made my day.

just, the third consideration. if i want to output some simulation information to a file after simulation, such as something like the sample utility, i think first i should create a folder that may be named with 'samples' (but how?), and then read the time series by using functions such as runTime.setTime(), runTime.timeName() etc. but how could i write the information to a file located where expected?

may i get some guidelines (as what you have kindly offered) on freewill write (do not use the overridden writeData() function) or some simple developed-utility instances?

best regards,
Ykjh
cfdopenfoam is offline   Reply With Quote

Old   September 20, 2015, 15:30
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,556
Blog Entries: 39
Rep Power: 97
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings,

Sorry for the really late reply, but only now did I manage to take a quick look into your question.
And unfortunately I don't have a straight answer. I would need some more details in order to know what would be the best approach to suggest to you.
I say this because OpenFOAM relies in a modular approach, which is why the sample application relies on libraries that have the sampling code, while the application sample only handles the bureaucracy of loading the mesh and going through the necessary time steps.

On the other hand, if you simply want to output values, then perhaps the utility "applications/utilities/postProcessing/miscellaneous/pdfPlot" is one possible way to start.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Reply

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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
OpenFOAM - Validation of Results Ahmed OpenFOAM Running, Solving & CFD 9 June 22, 2011 18:59
OpenFOAM 1.6.x, 1.7.0 and 1.7.x are not fully prepared to work with gcc-4.5.x wyldckat OpenFOAM Bugs 18 October 21, 2010 05:51
How to Install OpenFOAM on 64 Ubuntu 9.04 hansel OpenFOAM Installation 62 March 19, 2010 15:43
Summer School on Numerical Modelling and OpenFOAM hjasak OpenFOAM 5 October 12, 2008 13:14


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