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

Time series of data at a point

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

Like Tree2Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   May 3, 2007, 03:18
Default Hi everyone. I would like t
  #1
New Member
 
Cameron Oliver
Join Date: Mar 2009
Location: Christchurch, New Zealand
Posts: 3
Rep Power: 8
col16 is on a distinguished road
Hi everyone.

I would like to plot a graph of a given variable (eg U.component(0)) over time. I have tried using sample, but (at least in FoamX) it cannot use an 'axis' of time.

In other words: In post-processing, I can find the value of a variable at a given point, but sample spits it out in hundreds of folders, one for each time step. What I would like to get is one file giving data in two columns: the first being the time step, and the second being the value of the variable of interest (in the position of interest).

I have found other posts on this message board asking about a similar type of thing, but no resolution that would help me. Is there currently any capability within OpenFoam to do this? If not, would it be difficult to add in? I have done programming before, but never in C++, so doing it myself might be a bit of a challenge! :-)

Thanks a lot. I appreciate your help.
Cheers,
--cam--
Cameron
col16 is offline   Reply With Quote

Old   May 3, 2007, 03:23
Default Do you want it only for the ti
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,763
Rep Power: 21
hjasak will become famous soon enough
Do you want it only for the time-steps you have written out or for every time step? You will need to use a Probe class, specifying the field (it must be calculated in the code) and a location. Depending on the version, have a look at oodles to see how this is done.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   May 3, 2007, 03:37
Default Yes, sorry - I'm aware of prob
  #3
New Member
 
Cameron Oliver
Join Date: Mar 2009
Location: Christchurch, New Zealand
Posts: 3
Rep Power: 8
col16 is on a distinguished road
Yes, sorry - I'm aware of probe, but as I understand it, that needs to be set up when the simulation is carried out. I've run an oodles simulation, and used a writeInterval of 100 steps (corresponding to a time of 1e-2 seconds between writes). I would like to now plot the data from those writes over time.
--cam--
col16 is offline   Reply With Quote

Old   May 3, 2007, 05:18
Default The probe functions in oodles
  #4
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
The probe functions in oodles have been supersceded in 1.4 by the new functionObject class. This is a modular plugin library that evaluates every time runTime++ is called.

Function objects are instantiated by adding them to a functions subdict in the controlDict. At the moment probes is the only functionObject in the 1.4 release. Activate probes by adding the following to the end of your controlDict:

functions
(
probes1
{
type probes;

functionObjectLibs ("libsampling.so");

//dictionary probesDict;

region region0;

probeLocations
(
(0.710 -0.730 0.829)
(0.710 -0.757 0.763)
(0.855 -0.714 0.881)
(0.855 -0.748 0.805)
(0.855 -0.774 0.735)
(1.000 -0.695 0.932)
(1.000 -0.754 0.805)
(1.000 -0.779 0.735)
(1.350 -0.651 1.030)
(1.350 -0.740 0.862)
);

fields
(
p
U
);
}
)

To sample these locations from an existing data set, you will have to write a very simple code to step over the existing timesteps, reading in the fields at each time and call runTime++ to activate the probes function. See "Ucomponents" as an example of how to read in existing fields for all times.

Warning: functionObjects are a beta component in that they have not been fully tested against all OpenFOAM applications and are not supported in FoamX. Most prominently, paraFoam will crash if the "functions" section is present in the controlDict, so you will have to comment it out if you want to use paraFoam.
eugene is offline   Reply With Quote

Old   May 3, 2007, 05:24
Default Thanks Eugene, A slight pro
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,763
Rep Power: 21
hjasak will become famous soon enough
Thanks Eugene,

A slight problem: if I want the Ux components, I cannot just slap it into the fields list, because it does not exist as a field in the solver. Apart from that, it looks pretty.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   May 3, 2007, 05:36
Default Thank OpenCFD! The old vers
  #6
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
Thank OpenCFD!

The old version of Probes does not support this functionality either.
Extracting Ux from the probed U vector is trivial.

I am more concerned about implementing a global search routine so the probes can find the closest cell centre in a parallel environment without inter-processor conflict.
eugene is offline   Reply With Quote

Old   May 10, 2007, 10:38
Default Hi all, I've tried to use lib
  #7
New Member
 
Nicolas Coste
Join Date: Mar 2009
Location: Marseilles, France
Posts: 11
Rep Power: 8
nikos is on a distinguished road
Hi all,
I've tried to use libsampling.so functions from FoamX, but when I launch the solver (oodles or simpleFoam for example) I've got an error

Selecting function probes
--> FOAM Warning :
From function dlLibraryTable::open(const dictionary& dict, const word& libsEntry, const TablePtr tablePtr)
in file lnInclude/dlLibraryTableTemplates.C at line 67
library "libsampling.so" did not introduce any new entries

probes directory is created at time step but there is nothing in the file. the points are well inside the computational domain.

solvers are compiled with -lsampling as options
maybe I've done something wrong

thank you for advance
nicolas
nikos is offline   Reply With Quote

Old   June 2, 2007, 02:51
Default I have faced a similar problem
  #8
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 700
Rep Power: 12
msrinath80 is on a distinguished road
I have faced a similar problem. I tried to solve it, but was unsuccessful. As a result, I copied the relevant probe functionality from oodles in OF 1.3 into the icoFoam solver. It works perfectly now!
msrinath80 is offline   Reply With Quote

Old   July 12, 2007, 06:38
Default To run paraFoam, the "function
  #9
Member
 
Christian Lindbäck
Join Date: Mar 2009
Posts: 55
Rep Power: 8
christian is on a distinguished road
To run paraFoam, the "functions" section with the probes I've defined needs to be commented out in the controlDict file. My problem is the following, at the same time my case runs I want to look at the results obtained so far using paraFoam. But to do that I need to comment out the "functions" section with my probes. This way I will loose probe data during the time I run paraView. This is not an option. Anyone with a solution to the problem?

Best regards,
Christian Svensson
christian is offline   Reply With Quote

Old   July 12, 2007, 08:44
Default Do exactly what I did. Copy th
  #10
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 700
Rep Power: 12
msrinath80 is on a distinguished road
Do exactly what I did. Copy the relevant functionality from oodles. I've modified the transientSimpleFoam and icoFoam solvers to do this. For a sample code with probe functionality, check the following solver:

http://www.ualberta.ca/~madhavan/icoFoam.tar.bz2
msrinath80 is offline   Reply With Quote

Old   July 12, 2007, 09:18
Default @christian: A simple hack: for
  #11
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
@christian: A simple hack: for a case example create a directory besides it called example.mirror in that directory create symbolic links for every directory in the original pointing to the original of the same name (for instance example.mirror/constant points to example/constant) EXCEPT for the system-direcory. For system you create a copy. In the controlDict of the copy remove the probes-entry.

Now
paraFoam . example.mirror
should be possible and not interrupt the calculation in example. Of course: new directories created in the meantime won't be visible.

You can create a script for the procedure described above
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 30, 2007, 03:13
Default Hi Eugene & Hrvoje, regardi
  #12
Member
 
sradl's Avatar
 
Stefan Radl
Join Date: Mar 2009
Location: Graz, Austria
Posts: 82
Rep Power: 9
sradl is on a distinguished road
Hi Eugene & Hrvoje,

regarding the new probing via the functionObject class:

I'd like to run a multimesh programm (conjugate Heat transfer) and the libsampling.so asks for "region0" when it tries to sample data. However, I've a region called "fluidRegion" from which I want to sample data.

Now it would be nice if I can specify the region that has to be probed.

I'm thinking about adding this functionality to my libsampling.so as it is a nice implementation. However, I'm not sure if this is not already done: in the constructor in the file "probesFunctionObject.C" the programm is looking for a keyword "region". However, I don't know where to specify my region to be probed.

Can you provide any hint how to point the solver to probe a specific region?

br
Stefan Radl
sradl is offline   Reply With Quote

Old   July 30, 2007, 03:21
Default Easy: go to the dictionary for
  #13
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,763
Rep Power: 21
hjasak will become famous soon enough
Easy: go to the dictionary for the function object in system/controlDict and add:

region fluidRegion;



For example:


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

region fluidRegion;

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

// Locations to be probed. runTime modifiable!
probeLocations
(
(0.0254 0.0253 0.0)
(0.0508 0.0253 0.0)
(0.0762 0.0253 0.0)
(0.1016 0.0253 0.0)
(0.1270 0.0253 0.0)
(0.1524 0.0253 0.0)
(0.1778 0.0253 0.0)
);

// Fields to be probed. runTime modifiable!
fields
(
p
);

);

}

Hrv
mm.abdollahzadeh likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   July 30, 2007, 04:11
Default Thanks! I knew it is that s
  #14
Member
 
sradl's Avatar
 
Stefan Radl
Join Date: Mar 2009
Location: Graz, Austria
Posts: 82
Rep Power: 9
sradl is on a distinguished road
Thanks!

I knew it is that simple... :-)

br
Stefan
sradl is offline   Reply With Quote

Old   August 13, 2007, 08:50
Default Hi, I tried to set a probe in
  #15
Member
 
ville vuorinen
Join Date: Mar 2009
Posts: 67
Rep Power: 8
ville is on a distinguished road
Hi,
I tried to set a probe in OF-1.4.1
as explained here using:

functions
(
probes1
{
type probes;
functionObjectLibs("libsampling.so");

probeLocations
(
(0 0 0.01)
);

fields
(
p
U
);
}
);



When starting a case using e.g.
Xoodles the problem is:


--> FOAM FATAL IO ERROR : ill defined primitiveEntry starting at keyword 'functions' on line 60 and ending at line 81

file: /home/vavuorin/OpenFOAM/vavuorin-1.4.1/run/tests/mtot0075mg_D0300_U110/system/co ntrolDict at line 81.

From function primitiveEntry::readData(Istream& is)
in file db/dictionary/primitiveEntry/primitiveEntryIO.C at line 97.

FOAM exiting



What is the problem? How should I modify Xoodles
to make this work?


-Ville
ville is offline   Reply With Quote

Old   August 17, 2007, 06:56
Default Hi, Using PROBES in OF-1.4 and
  #16
Member
 
ville vuorinen
Join Date: Mar 2009
Posts: 67
Rep Power: 8
ville is on a distinguished road
Hi, Using PROBES in OF-1.4 and 1.4.1 works differently in comparison to earlier versions.
The channelOodles case works nicely but when
I try to use probe for other cases like Xoodles
it does not work anymore.

So...could someone comment on the following problem:

I tried to set a probe in OF-1.4.1
as explained here by adding a dictionary to
controlDict:

functions
(
probes1
{
type probes;
functionObjectLibs("libsampling.so");

probeLocations
(
(0 0 0.01)
);

fields
(
p
U
);
}
);



When starting a case using e.g.
Xoodles the problem is:


--> FOAM FATAL IO ERROR : ill defined primitiveEntry starting at keyword 'functions' on line 60 and ending at line 81

file: /home/vavuorin/OpenFOAM/vavuorin-1.4.1/run/tests/mtot0075mg_D0300_U110/system/co ntrolDict at line 81.

From function primitiveEntry::readData(Istream& is)
in file db/dictionary/primitiveEntry/primitiveEntryIO.C at line 97.

FOAM exiting



What is the problem? How should I modify Xoodles
to make this work?

Regards,
Ville
ville is offline   Reply With Quote

Old   August 22, 2007, 13:29
Default Ville, You can modify Xoodles
  #17
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 700
Rep Power: 12
msrinath80 is on a distinguished road
Ville, You can modify Xoodles source code to do this for you directly.

Just after #include "OFstream.H"

add the following line:
#include "Probe.H"

And then just before
Info<< "\nStarting time loop\n" << endl; add the following line:

#include "createProbes.H"


Finally, after
#include "writeNaveragingSteps.H"

add the following line:
#include "writeProbes.H"

Now after saving Xoodles.C,

create the file writeProbes.H with the following contents:

UProbe.write();
pProbe.write();

Now, you must create the file createProbes.H with the following contents:

Info<< "Reading probeLocations\n" << endl;

IOdictionary probeLocations
(
IOobject
(
"probeLocations",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);


Info<< "Constructing probes\n" << endl;

Probe<volvectorfield> UProbe(probeLocations, U);
Probe<volscalarfield> pProbe(probeLocations, p);


Finally, you must create the file writeNaveragingSteps.H with the following contents:

if (runTime.outputTime())
{
OFstream nAveragingStepsFile
(
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
);

if (nAveragingStepsFile.good())
{
nAveragingStepsFile << nAveragingSteps << endl;
}
else
{
FatalErrorIn(args.executable())
<< "Cannot open file " << nAveragingStepsFile.name()
<< abort(FatalError);
}
}

I'm attaching probe.H to this post as it is too long. You'll need to put this file in the same directory as Xoodles.C along with createProbes.H, writeProbes.H and writeNaveragingSteps.H.

Once all files have been created and probe.H has been copied, you can execute wclean && wmake in the ~/OpenFOAM/OpenFOAM-1.4/applications/solvers/combustion/Xoodles directory. You Xoodles solver can now write probes of velocity and pressure. If there are other fields you wish to monitor, you need to edit the headers accordingly. Finally, when running your simulation, create a file called probeLocations inside the constant directory of your case. A sample of the same is also attached.

NB: I think this simple procedure can be used with almost any solver to get the probe functionality. I personally use it with icoFoam.

Hope that helps!

Attachments:
probeLocations
Probe.H
mm.abdollahzadeh likes this.
msrinath80 is offline   Reply With Quote

Old   August 22, 2007, 13:46
Default Apologies. writeNaveragingStep
  #18
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 700
Rep Power: 12
msrinath80 is on a distinguished road
Apologies. writeNaveragingSteps.H is already present. It is meant for time-averaging. Just ignore that part.
msrinath80 is offline   Reply With Quote

Old   August 22, 2007, 18:33
Default Oops! You also need Probe.C.
  #19
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 700
Rep Power: 12
msrinath80 is on a distinguished road
Oops! You also need Probe.C.
Probe.C
msrinath80 is offline   Reply With Quote

Old   October 10, 2007, 16:22
Default Has anyone noticed that the pr
  #20
New Member
 
Steven McHale
Join Date: Mar 2009
Location: State College, PA, USA
Posts: 1
Rep Power: 0
steve_mchale is on a distinguished road
Has anyone noticed that the probes function (any version of OpenFOAM) does not interpolate between cells but just spits out the cell-centered values??

I've tried with 1.3 to fix that but could not get the syntax correct for what I believe needed to be volPointInterpolation. (1.4 is a whole 'nother can of worms)

Samples does that, but I need U and p as functions of time, which samples does poorly. I've written a runtime and post-processing feature to convert the data files, but they are useless if they aren't interpolated.

If anyone can provide a solution in any version of OpenFOAM, I'd be much obliged.

~Steve
steve_mchale 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
Time series input data-Possible in Ansya/ Fluent?? Rajkumar CFX 2 May 24, 2010 18:33
Getting Time Series data from saved unsteady data Atul FLUENT 4 November 26, 2008 06:12
Time Series Export ANASTASIOS GEORGOULAS FLUENT 2 September 19, 2007 10:39
time series data for pressure and velocity James Willie FLUENT 0 July 12, 2006 04:31
Time series data as input-Possible in Ansys/Fluent Rajkumar Main CFD Forum 0 April 13, 2005 11:04


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