CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Calculation for a given plane possible in OpenFOAM (http://www.cfd-online.com/Forums/openfoam-post-processing/61358-calculation-given-plane-possible-openfoam.html)

santos February 25, 2007 20:07

Hello! I know that it is po
 
Hello!

I know that it is possible to calculate a given field on a boundary, such as:

label inletPatchi = mesh.boundaryMesh().findPatchID(nameOfInlet);
scalar massFlux = sum(phi.boundaryField()[inletPatchi]);


It is also possible to get the field value of an arbitrary point as:

vector probePoint(x,y,z);
label probeCell = mesh.findCell(probePoint);


But is it possible to get the values of a field for a given plane? I need to get field values only for y=0.002. Any hint on how to do this in OpenFOAM?

Thank you!

Best regards,
Josť Santos

dmoroian February 26, 2007 02:35

Hi Jose, Maybe sampleSurface
 
Hi Jose,
Maybe sampleSurface is what you want!

Dragos

santos February 26, 2007 04:12

Hi Dragos Thanks for your r
 
Hi Dragos

Thanks for your reply.

Yes sampleSurface works, in fact I am using it now to export the values to Octave to do the calculations I need. But I think it would be better if I could do it all in OpenFOAM!

Josť Santos

ville October 3, 2007 05:49

Hi, I would be interested in
 
Hi,
I would be interested in using the sampleSurface
utility for sampling cutplanes to a directory during a simulation so that I would not have to save all the 3D data and sample the cutplanes as a postprocessing task since the 3D files take a lot of space. Is this readily possible?
Thanks in advance!
Ville

eugene October 3, 2007 09:51

It is possible, but not readil
 
It is possible, but not readily.

ville October 3, 2007 10:11

Thank you for the reply! Wha
 
Thank you for the reply!
What steps would be required to use the
related sampling dictionary
every dt intervals; would there be any possible piece of code for doing that? It would be quite
wonderful to try out since visualizing transient
phenomena in a time-resolved way becomes very
time consuming
if the animations are made out of large 3d data
sets.
-Ville

P.S. Since I couldn't find this on the forum:
An example of using the sampleSurface as a postprocessing tool is found in
~/OpenFOAM/OpenFOAM-1.4.1/tutorials/
solidDisplacementFoam/plateHole/system

eugene October 3, 2007 10:21

You would have to integrate th
 
You would have to integrate the sampleSurface utility into an application, or for more general use, into a function object. A fair amount of work unfortunately and I am not aware of existing applications that perform this task.

maka February 26, 2008 12:21

will it work in parallel if we
 
will it work in parallel if we did so? If so I can try to do it since, I've been looking for a way to average fields in a set of planes during parallel run and this can do it if the sampling period is long enough to not to make the code slow.

eugene February 27, 2008 04:32

sampleSurface works in paralle
 
sampleSurface works in parallel.

dmoroian February 27, 2008 05:15

Saving a cell set that interse
 
Saving a cell set that intersects a plane at runtime is presented here: cuttingPlane
It works in parallel, too.

Dragos

lakeat October 10, 2008 04:00

Hi, Since OpenFOAM already
 
Hi,

Since OpenFOAM already includes many third party software, why not add another one, say octave?

I am thinking these days, is it possible to do FFT with OpenFOAM? Because FFT utility is very common and very useful and ver important for post-processing, why not it is included?

It would be nice to see post-processing has the ability of Graphic showing and spectrum analysis etc.

Just a thought. \Daniel

Pascal_doran June 4, 2010 13:59

Hi Daniel,

It seem that OpenFOAM 1.6 has FFT utility. See /usr/local/OpenFOAM/OpenFOAM-1.6/src/randomProcesses/fft

And I was wondering if you were able to use it. If yes could you show me how?

Thank you,

Pascal

Bertrand December 2, 2010 15:47

I would be interested in this use as well, if anyone has information on how to implement a FFT on OpenFOAM probes.

Thanks!

mani_v January 9, 2011 21:12

Quote:

Originally Posted by santos (Post 197456)
Hello!

I know that it is possible to calculate a given field on a boundary, such as:

label inletPatchi = mesh.boundaryMesh().findPatchID(nameOfInlet);
scalar massFlux = sum(phi.boundaryField()[inletPatchi]);

It is also possible to get the field value of an arbitrary point as:

vector probePoint(x,y,z);
label probeCell = mesh.findCell(probePoint);

But is it possible to get the values of a field for a given plane? I need to get field values only for y=0.002. Any hint on how to do this in OpenFOAM?

Thank you!

Best regards,
Josť Santos


Jose

I am new to openfoam. Can you tell where these lines can be added to calculate massflux at a boundary? It will be very helpful if you can show me an example.

CedricVH August 5, 2011 06:09

Quote:

Originally Posted by mani_v (Post 289790)
Jose

I am new to openfoam. Can you tell where these lines can be added to calculate massflux at a boundary? It will be very helpful if you can show me an example.

You can better calculate the massflux through a boundary through a functionObject. Add this to your controlDict file to calculate the massflow through the inlet at write time.

Code:

functions
(
    mflow_inlet
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled        true;
        outputControl  outputTime;
        log            true;
        valueOutput    true;
        source          patch;
        sourceName      inlet;
        operation      sum;
        fields
        (
            phi
        );
    }
);

You can also achieve the same by post-processing the data using the command:

Code:

patchIntegrate -latestTime phi inlet


All times are GMT -4. The time now is 12:08.