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

Exporting some results data at text file format

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2015, 18:07
Default Exporting some results data at text file format
  #1
Senior Member
 
Mehdi Asghari
Join Date: Feb 2010
Posts: 127
Rep Power: 16
Asghari_M is on a distinguished road
Hi all Foamers.
I have solved a 2D transient heat conduction problem by OpenFoam 2.3.1. Now, I’m going to write a text programing file (can be written at any programing language, for example, MatLab or FORTRAN).
The specifications of this program have been presented as follows:
Input: The geographical coordinates of a desired point into the solid material.
Output: The temperature of that specified point (it’s better to consider temperature interpolation of neighboring cells)
This program may be structurally similar to the following one:
Code:
Read (*,x , y); /***input***/
.
.
.
.
T=….
Write (T, temp.txt); /****Output*****/
END
Can anybody have any idea for this program file writing(for finding output)?
Cheers;
Asghari_M is offline   Reply With Quote

Old   May 6, 2015, 07:59
Default
  #2
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19
dkxls will become famous soon enough
Quote:
Originally Posted by Asghari_M View Post
Hi all Foamers.
I have solved a 2D transient heat conduction problem by OpenFoam 2.3.1.
....
Can anybody have any idea for this program file writing(for finding output)?
Cheers;
You don't need to write any code to do this, just use the probeLocations utility in OpenFOAM. You can find an example in this tutorial:
tutorials/lagrangian/reactingParcelFoam/parcelInBox

If your number of probe locations is not too big, you could also do this during run time to get a higher temporal resolution. You would use the probe functionObject to do that, for an example see this tutorial:
tutorials/incompressible/pimpleFoam/TJunction
dkxls is offline   Reply With Quote

Old   May 6, 2015, 11:38
Default
  #3
Senior Member
 
Mehdi Asghari
Join Date: Feb 2010
Posts: 127
Rep Power: 16
Asghari_M is on a distinguished road
Quote:
Originally Posted by dkxls View Post
You don't need to write any code to do this, just use the probeLocations utility in OpenFOAM. You can find an example in this tutorial:
tutorials/lagrangian/reactingParcelFoam/parcelInBox

If your number of probe locations is not too big, you could also do this during run time to get a higher temporal resolution. You would use the probe functionObject to do that, for an example see this tutorial:
tutorials/incompressible/pimpleFoam/TJunction
Dear Armin,
Thanks for this great idea. That is definitely helpful.
Of course, I haven't still examined your suggested functions and tutorials. However, I need to save the temperature of specified location in terms of time at a text format.
For example, the text file can be such as following ones:
In the step number form:
(300,1)
(300.05,2)
.
.
.
Or at time step following:
(300,0.001)
(300.05,0.002)
.
.
.
The reason for above format is this fact that I need to use that probed temperature as an input for MatLab software in term of time.
I'd appreciated for any idea to do this task.
Asghari_M is offline   Reply With Quote

Old   May 6, 2015, 12:51
Default
  #4
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19
dkxls will become famous soon enough
Quote:
Originally Posted by Asghari_M View Post
However, I need to save the temperature of specified location in terms of time at a text format.
That's exactly what I have just explained to you. Check the tutorial!
dkxls is offline   Reply With Quote

Old   May 6, 2015, 17:46
Default I didn't find any output for that Location
  #5
Senior Member
 
Mehdi Asghari
Join Date: Feb 2010
Posts: 127
Rep Power: 16
Asghari_M is on a distinguished road
Ok, I added a probesDict file at system folder.
However, I didn't find any output in my case folder.
My probesDict presented as follows:
Code:
FoamFile
{
    version         2.0;
    format          ascii;
    class           dictionary;
    location        system;
    object          probesDict;
}
 
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 
// Fields to be probed. runTime modifiable!
fields
(
    T 
);
 
// Locations to be probed. runTime modifiable!
probeLocations
(
    (0.1 0.0 0.250)
);
However, I couldn't find any post-processing data for this probed location(point).
Where can I observe the output probed data in?

Last edited by Asghari_M; May 6, 2015 at 18:47.
Asghari_M 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
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 07:29
[OpenFOAM.org] Patches to compile OpenFOAM 2.2 on Mac OS X gschaider OpenFOAM Installation 136 October 10, 2017 18:25
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 02:41
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 14:14
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


All times are GMT -4. The time now is 17:02.