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/)
-   -   Re Sampling Fields at CellZone Interface (https://www.cfd-online.com/Forums/openfoam-post-processing/255356-re-sampling-fields-cellzone-interface.html)

Tempest April 3, 2024 12:58

Re Sampling Fields at CellZone Interface
 
Dear Foamers,


What would be the best way to sample the field values at the cellzone interface?


I have been trying to use the STL file for that with sampledict, but the output is not smooth. I tried refining the mesh a lot, but still nothing.


Background - I am trying to export gradT field along the porous interface.

Yann April 4, 2024 03:41

Hello,

How did you define your cellZone?

Yann

Tempest April 4, 2024 06:16

Quote:

Originally Posted by Yann (Post 867221)
Hello,

How did you define your cellZone?

Yann


Thank you for replying. Here is my toposet file for you



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

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

actions
(
{
name porousZone;
type cellSet;
action new;
source surfaceToCell;
file "constant/triSurface/ibCylinder.stl";
useSurfaceOrientation false; // use closed surface inside/outside
// test (ignores includeCut,
// outsidePoints)
outsidePoints ((1.4 0 0.01)); // definition of outside
includeCut false; // cells cut by surface
includeInside true; // cells not on outside of surf
includeOutside false; // cells on outside of surf
nearDistance 0.0001; // cells with centre near surf
// (set to -1 if not used)
curvature 0.9; // cells within nearDistance
// and near surf curvature
// (set to -100 if not used)
}


/////////////////////////////////////////////////////////
{
name porousZone;
type cellZoneSet;
action new;
source setToCellZone;
sourceInfo
{
set porousZone;
}
}

);

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

Yann April 4, 2024 07:49

Alright, you will never get a smooth cellZone interface using topoSet, as it doesn't modify the mesh, but only select cells based on the criteria you defined. (in your case, all the cells contained inside your STL file)

In order to get a smooth interface your should define the cellZone when creating your mesh.

If you create your mesh with snappyHexMesh, you can define your cellZone right into snappyHexMeshDict, and you will get a mesh snapped to your STL.


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