CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How to sample during run (https://www.cfd-online.com/Forums/openfoam/71709-how-sample-during-run.html)

jason.ryon January 12, 2010 13:52

How to sample during run
 
Is there a way to run "sample" during a run? For example, I would like to monitor mdot through an inlet and create an animation of a 2D plane slice every 10 or so timesteps. However, to do this with a post-processing sample, I would be required to write the entire case every 10 timesteps and then run sample in the end - which is a lot of storage required.

Thanks,
Jason

gschaider January 13, 2010 06:44

Quote:

Originally Posted by jason.ryon (Post 242340)
Is there a way to run "sample" during a run? For example, I would like to monitor mdot through an inlet and create an animation of a 2D plane slice every 10 or so timesteps. However, to do this with a post-processing sample, I would be required to write the entire case every 10 timesteps and then run sample in the end - which is a lot of storage required.

Since 1.5 there is a functionObject that does exactly that. I think it is called surfaces

Bernhard

jason.ryon January 13, 2010 12:14

Yes, the surfaces function worked great for getting animations during runtime instead of post-process. Also the simpleFunctionObjects works great to do things like mass flow and pressure averages.

Thanks!
Jason

mlawson March 31, 2010 16:39

Quote:

Originally Posted by jason.ryon (Post 242453)
Yes, the surfaces function worked great for getting animations during runtime instead of post-process. Also the simpleFunctionObjects works great to do things like mass flow and pressure averages.

Thanks!
Jason

Hi Jason,

I'm trying to use the surfaces functionObject but have been unable to figure out the syntax for the controlDictionary. Could you post a quick example.

Thanks in advance,

-Mike

jason.ryon March 31, 2010 16:59

In system/controlDict, try to add a new section like:

functions
{
animate
{
type surfaces;
functionObjectLibs ("libsampling.so");
outputControl timeStep;
outputInterval 50;
surfaceFormat vtk;
interpolationScheme cellPointFace;

fields
(
p
U
);
surfaces
(
aplane
{
type plane;
basePoint (0.0 0.0 0.0);
normalVector (0.0 0.0 1.0);
}
pressure_inlet_001
{
type patch;
patchName pressure_inlet_001;
}
);
}

//for the simpleFunction - which you have to download this separately
massFlow
{
type patchMassFlow;
functionObjectLibs ("libsimpleFUnctionObjects.so");
verbose true;
outputControl timeStep;
outputInterval 1;
patches
(
pressure_inlet_001
pressure_outlet
);
};

//another simpleFunction
patchAverage
{
type patchAverage;
functionObjectLibs ("libsimpleFunctionObjects.so");
verbose true;
outputControl timeStep;
outputInterval 1;
patches
(
pressure_inlet_001
pressure_outlet
);
fields
(
p
U
);
}
}

mlawson March 31, 2010 17:18

Thanks Jason, worked perfectly.

sankarv April 5, 2010 06:42

sampling for Lagrangian particle tracking
 
Is there a similar sampling tool for Lagrangian particles ? i.e, I would
like to collect particle statistics such as mean particle size, mean
particle velocity etc., at an arbitrary surface inside the domain ?

Please let me know

Thanks
Vaidya


All times are GMT -4. The time now is 16:10.