CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Other] extend existing mesh - saving old patch as faceZone and new cells as new cellZones (https://www.cfd-online.com/Forums/openfoam-meshing/198242-extend-existing-mesh-saving-old-patch-facezone-new-cells-new-cellzones.html)

Wikie January 31, 2018 04:46

extend existing mesh - saving old patch as faceZone and new cells as new cellZones
 
1 Attachment(s)
Dear all,


I'm struggling with an OpenFOAM problem and would need some help to solve it.

I want to extend the mesh of a straight pipe at one end. The new volume should be safed as new cellZone and the old patch should be safed as a faceZone - please see attachment below.

I was able to handle the first step by using extrudeMesh - see extrudeMeshDict below.

I'm struggling by keeping the old patch as faceZone and saving the new volume as a new cellZone.

Any idea how I can handle this?

remark: I'm using OF v1706


Quote:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object extrudeMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// What to extrude:
// patch : from patch of another case ('sourceCase')
// mesh : as above but with original case included
// surface : from externally read surface
constructFrom mesh;
sourceCase "../extrudeTest";
sourcePatches (outlet);
// If construct from patch: patch to use for back (can be same as sourcePatch)
exposedPatchName symBack;
// Flip surface normals before usage. Valid only for extrude from surface or
// patch.
flipNormals false;
//- Linear extrusion in point-normal direction
extrudeModel linearNormal;
nLayers 1;
expansionRatio 1.0;
linearNormalCoeffs
{
thickness 0.05;
}
// Do front and back need to be merged? Usually only makes sense for 360
// degree wedges.
mergeFaces false; //true;
// Merge small edges. Fraction of bounding box.
mergeTol 0;

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


Wikie January 31, 2018 11:49

I solved the problem by using patchToFace, faceToCell and setToCellZone as you can see in the code below. Any idea / suggestions how this can be done done in less steps?

Quote:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name outletFaceSet;
type faceSet;
action new;
source patchToFace;
sourceInfo
{
name outlet;
}
}

{
name outletFaceToCell;
type cellSet;
action new;
source faceToCell;
sourceInfo
{
set outletFaceSet;
option any;
}
}

{
name outletZone;
type cellZoneSet;
action new;
source setToCellZone;
sourceInfo
{
set outletFaceToCell;
}
}

);
// ************************************************** *********************** //


All times are GMT -4. The time now is 21:11.