|
[Sponsors] |
April 17, 2013, 20:00 |
sampleDict and controlDict
|
#1 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Dear all: I am trying to understand the difference between the functionality of sampleDict and ControlDict. If, for example, I need pressure output in OpenFoam and use the following commands in controlDict, I find that putting them in sampleDict does the same thing. So why not put all the commands in controlDict and not use sampleDict at all -- or are there more differences between the two than what meets the eye?:
wallPressure { type surfaces; functionObjectLibs ("libsampling.so"); outputControl outputTime; surfaceFormat raw; interpolationScheme cell; fields ( alpha1 p ); surfaces ( leftwalls { type patch; patches (leftWall); interpolate true; triangulate false; } rightwalls { type patch; patches (rightWall); interpolate true; triangulate false; } ); } |
|
April 18, 2013, 18:55 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Musaddeque,
The difference is that:
For example:
Bruno
__________________
|
|
April 18, 2013, 22:49 |
|
#3 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Many thanks for your explanation. Now I get the picture.
|
|
September 27, 2013, 13:43 |
|
#4 |
New Member
Join Date: Jul 2013
Posts: 27
Rep Power: 13 |
Some one please help,
I am a newbie to OpenFOAM and have a doubt related to the above posts. I need to find the pressure at a point in all the time steps, so what is the procedure that I need to follow. I will be grateful to get some hint. Thanks in advance. Regards, |
|
September 27, 2013, 20:31 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Sujatha and welcome to the forum!
There are at least 2 ways you can do this:
Bruno
__________________
|
|
September 28, 2013, 00:34 |
|
#6 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Ms Sujatha: Yes please do follow suggestion by Mr Bruno - he is one of the many geniuses on the forum who has helped many a lost foamers find the way -- I speak from experience. So best wishes. Now I have a question for Mr Bruno: Bruno, I tried to run the point probe in OpenFoam. I am running sloshingtank 2d (interdymfoam solver) and when I put the point probe very close to the wall, the solver will give error messages during the run. Also, if I am using moving mesh, then does the probe move with the mesh so that it is probing the same point each time? If not then dont you think it is a major error in OpenFoam? I look forward to your comments.
|
|
September 28, 2013, 07:12 |
|
#7 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Musaddeque,
Quote:
I've done a quick search and found this bug report: http://www.openfoam.org/mantisbt/view.php?id=744 - I had looked into this back then and I never managed to use this myself. In addition, I found this old thread: http://www.cfd-online.com/Forums/ope...-problems.html I think I've figured it! At least in theory. You need to create a "pointSet" first for the initial mesh and use that point set for the sampling. Please share the dictionary you've used for sampling, as well as instructions on how you've used it, so that I can test and create a variant for moving meshes. Best regards, Bruno
__________________
|
||
September 28, 2013, 10:41 |
|
#8 |
New Member
Join Date: Jul 2013
Posts: 27
Rep Power: 13 |
Thanks a lot Mr. Bruno for your timely and quick reply. That hint helped me , I could do it with the probesDict and the pressure is obtained.
As Mr.Musahossein has quoted you helped me find the way. I am grateful. Regards, |
|
September 29, 2013, 18:31 |
Point probe close to wall gives errors
|
#9 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Bruno:
Here is the sampleDict file that I am using to look at pressures very close to the tank wall. The tank is 1mX1mX0.1. The solver is interDymFOam and the problem is sloshingtank2D. The water depth is 0.5. The centroid (0,0,0) is at mid point along the tanks just at the transition between the water and air. The point probe is at 0.49m and 0.3m below the water level at rest. When I run the sample file, I get error mesages that the probe location is out outside the tank or something to that effect. However, when I place the proble at 0.45m, there are no errors. If you require, I can sent you the tank mesh file, but I dont thin the tank has anything to do with it. Any help advice will be appreciated, thanks. Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object sampleDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // interpolationScheme cell; graphFormat gnuplot; //surfaceFormat raw; surfaceFormat raw; //setFormat ASCII; setFormat raw; sets ( // evaluate phase and pressure close to tank rightwall using line probe right { type uniform; axis xyz; start ( 0 0.45 0.60); end ( 0 0.45 -0.40); nPoints 100; } ); fields (alpha1 p); surfaceFormat raw; surfaces ( // compute wallPressure at left and rightwalls leftwall { type patch; patches (leftWall); rhoName rhoInf; rhoInf 998.2; //Reference density for fluid outputInterval: 1.0 interpolate true; triangulate false; } rightwalls { type patch; patches (rightWall); rhoName rhoInf; rhoInf 998.2; //Reference density for fluid outputInterval: 1.0 interpolate true; triangulate false; } ); fields (alpha1 p); functions { probes1 { type probes; functionObjectLibs ("libsampling.so"); region region1; probeLocations ( (0 0.49 -0.3) ); fields (p); } } Last edited by wyldckat; October 6, 2013 at 13:42. Reason: Added [CODE][/CODE] |
|
September 29, 2013, 18:39 |
|
#10 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Bruno:
I asked the same question a while back.At that time I reproduced the error message that came on the scree. Here is the URL to that post: http://www.cfd-online.com/Forums/ope...ct-issues.html I hope this will clarify the situation better. Thankyou Musa |
|
October 6, 2013, 14:29 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Musa,
OK, since you've split your question into two separate threads, I'll address the usage of "sampleDict" here. The example file provided for this utility: https://github.com/OpenFOAM/OpenFOAM...ple/sampleDict - indicates that it can use a cloud of points, which acts similarly to the probe. But neither the probes nor the cloud of points will move along with your geometry. These points are fixed in space. Now, based on your other thread, it seems that you want to sample a point in a patch, not a point strictly inside the domain. For this, you can use the "faceSource" function object: http://foam.sourceforge.net/docs/cpp/a00608.html - if you search here on the forum, I think there is already a couple of examples on how to use this. I'm going to answer on the other thread now, namely this one: http://www.cfd-online.com/Forums/ope...ct-issues.html Best regards, Bruno
__________________
|
|
April 1, 2014, 17:51 |
|
#12 |
Senior Member
Join Date: Jul 2009
Posts: 260
Rep Power: 18 |
Sorry i have to ask this here: can i use sampleDict on a decomposed case? Ie one that has just been run in parallel?
|
|
April 1, 2014, 20:03 |
|
#13 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
I hope that answers your question. |
||
April 2, 2014, 04:04 |
|
#14 | |
Senior Member
Join Date: Jul 2009
Posts: 260
Rep Power: 18 |
Quote:
|
||
April 5, 2014, 17:13 |
|
#15 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@kingjewel1: Quote:
Code:
sample -help Code:
Usage: sample [OPTIONS] options: -case <dir> specify alternate case directory, default is the cwd -constant include the 'constant/' dir in the times list -dict <file> read control dictionary from specified location -latestTime select the latest time -noFunctionObjects do not execute functionObjects -noZero exclude the '0/' dir from the times list, has precedence over the -zeroTime option -parallel run in parallel -region <name> specify alternative mesh region -roots <(dir1 .. dirN)> slave root directories for distributed running -time <ranges> comma-separated time ranges - eg, ':10,20,40:70,1000:' -srcDoc display source code in browser -doc display application documentation in browser -help print the usage Using: OpenFOAM-2.3.x (see www.OpenFOAM.org) Build: 2.3.x-9d0ee4591849 Best regards, Bruno
__________________
|
||
April 6, 2014, 11:56 |
|
#16 | |
Senior Member
Join Date: Jul 2009
Posts: 260
Rep Power: 18 |
Quote:
Thank you for that. My question was not whether Code:
sample Code:
reconstructPar |
||
May 10, 2014, 21:37 |
|
#17 |
New Member
Anastasios Stampoultzoglou
Join Date: May 2014
Posts: 21
Rep Power: 12 |
Hi everyone,
I am a very new openFoam user and i am trying a lot! All the discussion with Mr Bruno helped me a lot, but i have some extra questions. I use this sampleDict: Code:
interpolationScheme cellPoint; setFormat gnuplot; sets ( Tasos { type face; axis y; start ( 4.018 0 0 ); end ( 4.018 0.7 0 ); nPoints 100; } ); fields ( U ); now i want to make a graph of U - time. Can you help me, please, because i am in confusion :/ Thanks a lot, Tasos. Last edited by wyldckat; May 11, 2014 at 06:26. Reason: Added [CODE][/CODE] |
|
May 11, 2014, 06:30 |
|
#18 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Tasos,
If you can provide an example case with instructions on how to get to the point you are right now, it'll be easier to help you, because it takes considerable time to set-up a similar case and to do some trial-and-error to figure out the best solution. On the other hand, why not use ParaView to do the plot of U over time? If you want to plot with gnuplot, you can export the data to CSV after plotting. Best regards, Bruno
__________________
|
|
August 26, 2014, 15:11 |
Sampling data in a window and save backup every other time steps
|
#19 |
New Member
Remi Carmi
Join Date: Jul 2014
Posts: 15
Rep Power: 12 |
Hi all,
Here is my question and I guess I can do that with the controlDict. I want to simulate something kind of big and cannot save all the data (too much space and saving data slow down the simulation) yet I want backup just in case I need to crash the simulation for a bit and restart later from latest time step (example I need to run another simulation quickly and I don't need the big one for now so I can resume it later). So here is what I would like to do : at every 0.05s sample the data in a box (where do I define this box) for all the flow field parameters then at every 1s I want to back up the entire simulation (domain larger than the area of interest). I am doing that with IHFOAM by the way. Best Remi |
|
August 29, 2014, 09:33 |
backing up data
|
#20 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
I dont know whether you can back up data every 1s or at any time interval. Openfoam does not give you the option. Also, why backup results data? It will take a huge amount of space and may not be efficient to restore. Why cant you just back up the input data and the associated files (system, constant etc) so that in the event of a crash, you can rerun your case.
|
|
Tags |
controldict, interpolate, sampledict |
|
|