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

Extracting a probe value after a simulation run

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Cyp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 22, 2010, 04:36
Question Extracting a probe value after a simulation run
  #1
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 15
challenger is on a distinguished road
This should be really easy to answer, but I couldn't find any information myself.
I want to print out probes values for multiple locations on a finished simulation.
What I normally do is to create a probe file, include it in the controldict and then rerun the simulation for at least an iteration to print out the results. Is there a static function that can do this so that I don't have to got through this or is the way I'm doing the only way possible?

Cheers!
challenger is offline   Reply With Quote

Old   December 22, 2010, 04:58
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Hi Frank!

I think you can use the sample utility. (see page U-169 of the user guide)

To use it, you have to setup a sampleDict file which will be put inside your system folder.

You can use the general template located at:
Code:
$FOAM_UTILITIES/postProcessing/sampling/sample
You modify it in order to have what you need, rename it as "sampleDict" and then you execute the sample utility after your run with the command:
Code:
sample
New files will be created in a "sets" directory.

I hope this can help you.
Best regards,
Cyp
faghat.oo and hogsonik like this.
Cyp is offline   Reply With Quote

Old   December 22, 2010, 05:22
Default
  #3
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 15
challenger is on a distinguished road
Thanks a lot Cyp,

I completely overlooked sample.

Merry X-Mas and a Happy New Year.
challenger is offline   Reply With Quote

Old   January 27, 2011, 18:09
Default
  #4
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
Dear Foamers,

I have been using the probes function to extract the data at particular location, but I find that the probes function uses some sort of interpolation scheme and the results are not same as the results I observe in paraview at the same location. Is there a way to get more accurate results especially at the boundaries and other locations.

Thanks for the help.
nandiganavishal is offline   Reply With Quote

Old   January 28, 2011, 03:38
Default
  #5
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
check for the type of data your going to probe and ... check whether you use the point or the cell data values in paraview. try to convert from cell to point and compare again. asfaik there is not interpolation, the probing is searching for the closest CellCenter and takes the value.
You might want to check probes.H (not 100% sure about the name).
Any experts around?

neewbie
mvoss is offline   Reply With Quote

Old   January 28, 2011, 10:55
Default
  #6
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
Hi newbee,

I am using the point data in paraview and comparing it with probes function still there is slight deviation... For example, a case like plotting the parabolic profile of velocity across a cylindrical channel, I see symmetric profile while plotting the OF data in paraview while using the data from probes function does not give a parabolic profile but is more discrete and slightly asymmetric, though the number of points is same for plotting using both the methods.

May I know how to rectify this problem...
nandiganavishal is offline   Reply With Quote

Old   January 28, 2011, 10:59
Default
  #7
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
did u use mag(U) while probing or did you reconstruct the velocity-vector from it´s probed components (U=(u^2+v^2+w^2)^(1/2))?
mvoss is offline   Reply With Quote

Old   January 31, 2011, 17:15
Default
  #8
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
Dear newbee,

This is how my controlDict file looks like..


application eofFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 8e6;

deltaT 100;

writeControl runTime;

writeInterval 2e6;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;


functions
(
probes1
{
// Type of functionObject
type probes;

// Where to load it from (if not already in solver)
functionObjectLibs ("libsampling.so");

// Locations to be probed. runTime modifiable!
probeLocations
(

(1010 485 0)
(1010 485.6900991 0)
(1010 486.4354473 0)
(1010 487.2404679 0)
(1010 488.1099383 0)
(1010 489.0490182 0)
(1010 490.0632807 0)
(1010 491.1587447 0)
(1010 492.3419113 0)
(1010 493.6198018 0)
(1010 495 0)
(1010 496 0)
(1010 497 0)
(1010 498 0)
(1010 499 0)
(1010 500 0)
(1010 501 0)
(1010 502 0)
(1010 503 0)
(1010 504 0)
(1010 505 0)
(1010 506.3801982 0)
(1010 507.6580887 0)
(1010 508.8412553 0)
(1010 509.9367193 0)
(1010 510.9509818 0)
(1010 511.8900617 0)
(1010 512.7595321 0)
(1010 513.5645527 0)
(1010 514.3099009 0)
(1010 515 0)


);

fields
(
U
p
);

}
);


Hope this is fine..
nandiganavishal is offline   Reply With Quote

Old   February 1, 2011, 02:59
Default
  #9
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
if you probe like this, i am wondering how you plot in paraview.
probing the fields U and p gives you 4 values. so if you plot in U paraview you actually plot mag(U) which hasn´t been probed.
That´s why i was asking about the reconstr. from u,v,w to U.
reconstruct the mag(U) from your probed values and then compare that to plot_over_line with pointData and mag(U) in paraview. I am pretty shure this is a paraView issue.

Could you attach some pictures?

Last edited by mvoss; February 1, 2011 at 11:10.
mvoss is offline   Reply With Quote

Old   February 1, 2011, 10:50
Default
  #10
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
Dear newbee,

I couldn't exactly get your point.

In the paraview, I do plot the U_x component that would be dumped at different time steps and comparing them with the U_x component obtained from the probed function across the channel height (from 485 to 515).

I am attaching the two plots where U_x is plotted in paraview (in m/s) and in other obtaining the value from probes function and plotting the same using MATLAB (NOTE: units for U is mm/s in this case).

Hope this helps.
Attached Images
File Type: jpg 1.jpg (51.8 KB, 194 views)
File Type: png u.png (4.5 KB, 180 views)
nandiganavishal is offline   Reply With Quote

Old   February 1, 2011, 11:15
Default
  #11
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
it seems to me like your point data for the probing is not resolving the mesh density. there are similar entries for u_x for different coord.values. try to increase the sampling.
isn´t it possible to sample smth. like a line with the sample-tool?
how about
Code:
       type    uniform; 
axis    y; 
start   ( 0 0.5 0.25 ); 
end     ( 0 2 0.25 ); 
nPoints 100;
mvoss is offline   Reply With Quote

Old   February 1, 2011, 11:18
Default
  #12
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
Is it possible for you to elaborate on how to smooth the data.. I exactly wanted to know this,,,
nandiganavishal is offline   Reply With Quote

Old   February 1, 2011, 11:20
Default
  #13
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
The code you mentioned where should we include them, further should I have to run the case again.
nandiganavishal is offline   Reply With Quote

Old   February 1, 2011, 11:20
Default
  #14
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
try ploting the data with gnuplot...
you can set it as export format in the sampleDict and you can set the stepsize when you plot the data.
mvoss is offline   Reply With Quote

Old   February 1, 2011, 11:21
Default
  #15
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
see here
http://www.openfoam.com/docs/user/sample.php
mvoss is offline   Reply With Quote

Old   February 1, 2011, 11:28
Default
  #16
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
Thanks for the link. I will go through that.

I was wondering this sampleDict would be useful when we want to plot the steady state results. I have a case where I am running an AC signal and would like to plot the velocity averaged over one time period. For that we need to know the velocity values at each time. I usually use the probes function to do that. Is there an alternative to do that using sampleDict, since we can't dump all the time step folders as they take huge memory.
nandiganavishal is offline   Reply With Quote

Old   February 1, 2011, 12:23
Default
  #17
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
Dear newbee,

I looked at the SampleDict from the examples and found out how to implement them but as I had mentioned it would be useful for getting the final steady state values, is it possible to extract data for a periodic case.

Kindly let me know.
Thanks
nandiganavishal is offline   Reply With Quote

Old   February 1, 2011, 16:44
Default
  #18
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
Dear Foamers,

Is it possible to integrate a variable across the cross section using the probes function at every time. Kindly let me know.

thanks
nandiganavishal is offline   Reply With Quote

Old   June 11, 2020, 19:56
Default
  #19
Senior Member
 
Arijit Saha
Join Date: Feb 2019
Location: Singapore
Posts: 132
Rep Power: 7
ari003 is on a distinguished road
Quote:
Originally Posted by mvoss View Post
it seems to me like your point data for the probing is not resolving the mesh density. there are similar entries for u_x for different coord.values. try to increase the sampling.
isn´t it possible to sample smth. like a line with the sample-tool?
how about
Code:
       type    uniform; 
axis    y; 
start   ( 0 0.5 0.25 ); 
end     ( 0 2 0.25 ); 
nPoints 100;
Can you please help me how you implemented this?
ari003 is offline   Reply With Quote

Old   February 27, 2024, 17:32
Default
  #20
ARG
New Member
 
Masoud Rvn
Join Date: Sep 2023
Posts: 3
Rep Power: 2
ARG is on a distinguished road
Quote:
Originally Posted by challenger View Post
This should be really easy to answer, but I couldn't find any information myself.
I want to print out probes values for multiple locations on a finished simulation.
What I normally do is to create a probe file, include it in the controldict and then rerun the simulation for at least an iteration to print out the results. Is there a static function that can do this so that I don't have to got through this or is the way I'm doing the only way possible?

Cheers!
This is an old post but I answer in case somebody is searching for the answer

You do not need to rerun the case, you just need to include your probe file in ControlDict and execute this command:

foamPostProcess -solver <your solver>
ARG is offline   Reply With Quote

Reply

Tags
probe location, probe position


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
do anyone use solidwork 2009 to run simulation kacee FloEFD, FloWorks & FloTHERM 8 June 2, 2010 05:11
Replacing mesh while running a simulation akultane CFX 1 November 15, 2009 13:46
Synthetic (pulsatile) jet transient simulation aero CFX 0 November 6, 2009 01:10
3D data extracting from Fluent simulation unknown FLUENT 0 October 11, 2009 13:15
Procedure to run unsteady simulation? STN Main CFD Forum 2 February 16, 2002 04:37


All times are GMT -4. The time now is 00:43.