CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Probes writing frequency (http://www.cfd-online.com/Forums/openfoam-solving/60119-probes-writing-frequency.html)

maka April 11, 2006 07:02

I noticed in OpenFOAM 1.2 that
 
I noticed in OpenFOAM 1.2 that if the solver has been stopped suddenly (electric shut down), probes folder is empty. My question is:

How frequent probe values are written? Can we control that? Thanks in advance

regards,
Maka.

maka April 12, 2006 05:49

probes file writing seems to b
 
probes file writing seems to be limited to certain file size and then the code write in a new file. Does this only happen when the code finishes. If we look for a solver like channelOodles, writeProbes.H is inside the time loop, in spite of that, it does not update file writing every time step. Can any body help explaining, how does write probe works? and how frequent the file is updated? Thanks in advance.

best regards,
Maka.

hjasak April 12, 2006 05:58

Look into: OpenFOAM-1.3/src
 
Look into:

OpenFOAM-1.3/src/sampling/Probe/Probe.C

The Probel class holds the OFstream and in the write() function it puts stuff into it. The rest happens at the C++ level.

C++ ofstream buffers the output for efficiency and the buffer size depends on the implementation. Once the buffer is full, it gets flushed into the file, which is what you are seeing.

If you wish, you can add the flush stream modifier, which will force thw write but will mess up your I/O performance.

Hrv

maka April 13, 2006 05:45

Thanks Hrv for the info. be
 
Thanks Hrv for the info.

best regards,
Maka

melanie July 6, 2006 07:51

Hello, I have a few questio
 
Hello,

I have a few questions on the probes.
1. Is it possible to control the writing frequency of the probes, i.e. if we want the probes to be written every 20 time steps, is it possible ? For instance, could we do a check in the time loop of the solver (if the time is a multiple of 20*delta t, then the probe is written) or anything else ?
2. I guess the number of probe locations is not limited, am I right ?
3. I am not sure if I have well understood Probes.C: there is no interpolation for the probes, it looks in which cell each probe is located and affects the value of this cell to the probe, is it right ? What happens then if the probe is located on the border of 2 cells ? and if the probe is located outside of the OF domain, is there an error message or fatal error ?

Thanks !

melanie July 10, 2006 09:31

Hello, could anyone answer my
 
Hello,
could anyone answer my few questions concerning the probes utility please ?
Thanks !
melanie

hemph July 10, 2006 09:42

Hi Melanie, I have not used t
 
Hi Melanie,
I have not used the probe-utility, but it looks like you could cause writing at any frequency you desire by calling write().

label i=0;
label freq=10;
..
your code
..
i++;
if (i%freq == 0)
myProbe.write()

hemph July 10, 2006 09:54

Regarding the other questions
 
Regarding the other questions
2) No limit.
3) It seems like there is no interpolation for the probes. Probe uses mesh.findCells() to search for the cell containing the point. If it is exactly on the border, I guess it will use either cell. If it is outside findCell will return -1. In probe.C, you will find that only if a cell value is larger than zero will a probe be created.

if (probeCelli >= 0)
{
cellList_[probesFoundi] = probeCelli;
probeLocations_[probesFoundi] = probeLocations_[probei];
probesFoundi++;
}

No error message from what I can see, but you can always try!

best
Rasmus


All times are GMT -4. The time now is 23:34.