CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Extract custom surface for postprocessing (https://www.cfd-online.com/Forums/openfoam-post-processing/244759-extract-custom-surface-postprocessing.html)

rpuenter August 26, 2022 09:39

Extract custom surface for postprocessing
 
I want to generate some surfaces for extracting flow field values from an OpenFOAM simulation. These surfaces are not boundaries of the domain.
In my specific case they should be a revolution surface defined by a line of
which I know the x-r coordinates in a cylindric coordinate system.

My first thought was to generate such a surface with paraview and extract it
as a vtk, as its possible in other postprocessing software packages like Ensight and CFXPost, but it seems that is not possible.

I am currently trying to generate an internalCloud to sample those points,
whose coordinates I can compute elsewhere, but I can´t seem to find
documentation describing the generation of the relevant dictionary files. The attempts I´ve tried have not been successful, for example:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object sampleDictUpstreamPlane;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

libs ( "libsampling.so" );

type internalCloud;


// Name of the directory for probe data
name upstreamPlane;

// Fields to be probed
fields ( p U k);

probeLocations
(
(x1 y1 z1)
...
(xN yN zN)
);


// ***** //

But even if this worked, I understand it would write a sample per time step, which I do not want. I only need the data for the final iteration, and the rest would only use up disk space.

I am fairly new to OpenFOAM, so I´m not sure if the -postProcessing function
could be of help here by calling it at the end of the simulation copying these
dictionary files from a place not visible to OpenFOAM during the simulation.

Could anyone help with this internalCloud business or suggest an alternative way to achieve this that I´m missing?

Thanks

rpuenter August 29, 2022 07:59

Finally solved it with sets. I leave the solution in case it´s useful to anyone:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object sampleDictSurfs;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

libs ( "libsampling.so" );

type sets;
writeControl onEnd;
interpolationScheme cellPoint;
setFormat csv;

// Name of the directory for probe data
name planes;

// Fields to be probed
fields ( p U k);

sets
(
planeName
{

type cloud;
axis xyz;
points ((x1 y1 z1)....(x1 y1 z1));

}


);

// ************************************************** ********************* //


All times are GMT -4. The time now is 04:49.