extrudeToRegionMesh: Added option to extrude patches

This greatly simplifies most setups in which it is a patch (or patches)
of the original mesh which are extruded. It prevents the need for a
topoSet configuration to convert the patch into a zone or set.
This commit is contained in:
Will Bainbridge
2022-08-30 09:49:55 +01:00
parent 94cf816b9d
commit b07feb9858
43 changed files with 378 additions and 559 deletions

View File

@ -0,0 +1,22 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh -region fluid
# Create the 3D baffle
runApplication -s extrudeFromPatches createBaffles -region fluid -overwrite \
-dict system/fluid/createBafflesDict.extrudeFromPatches
runApplication extrudeToRegionMesh -region fluid -overwrite \
-dict system/fluid/extrudeToRegionMeshDict.extrudeFromPatches
# Create the 1D baffle
runApplication createBaffles -region fluid -overwrite
runApplication $(getApplication)
paraFoam -touchAll
#------------------------------------------------------------------------------

View File

@ -9,27 +9,35 @@ FoamFile
{
format ascii;
class dictionary;
object topoSetDict;
object createBafflesDict.baffle3D;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
internalFacesOnly true;
fields false;
baffles
{
baffle3D
{
name wallFilmFaceSet;
type faceSet;
action new;
source patchToFace;
patch filmWalls;
type searchableSurface;
surface triSurfaceMesh;
name baffle3D.stl;
owner
{
name baffle3D0;
type wall;
}
neighbour
{
name baffle3D1;
type wall;
}
}
{
name wallFilmFaces;
type faceZoneSet;
action new;
source setToFaceZone;
faceSet wallFilmFaceSet;
}
);
}
// ************************************************************************* //

View File

@ -9,27 +9,26 @@ FoamFile
{
format ascii;
class dictionary;
object topoSetDict;
object extrudeToRegionMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name walls;
type faceSet;
action new;
source patchToFace;
patch walls;
}
{
name walls;
type faceZoneSet;
action new;
source setToFaceZone;
faceSet walls;
}
);
region baffle3D;
patches (baffle3D0);
patchesShadow (baffle3D1);
extrudeModel linearNormal;
nLayers 50;
expansionRatio 1;
adaptMesh yes; // apply mapped to both regions
linearNormalCoeffs
{
thickness 0.02;
}
// ************************************************************************* //

View File

@ -22,7 +22,7 @@ boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(sides|frontAndBack|wallFilmFaces_top|cylinderFilmFaces_top)"
"(sides|frontAndBack|walls_top|cylinder_top)"
{
type zeroGradient;
}

View File

@ -22,7 +22,7 @@ boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(wallFilmFaces_top|cylinderFilmFaces_top)"
"(walls_top|cylinder_top)"
{
type slip;
}

View File

@ -22,7 +22,7 @@ boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(sides|frontAndBack|wallFilmFaces_top|cylinderFilmFaces_top)"
"(sides|frontAndBack|walls_top|cylinder_top)"
{
type zeroGradient;
}

View File

@ -4,7 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication topoSet
runApplication extrudeToRegionMesh -overwrite
runApplication $(getApplication)

View File

@ -5,7 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh
runApplication decomposePar -noFields
runParallel topoSet
runParallel extrudeToRegionMesh -overwrite
runApplication -s fields decomposePar -fields -copyZero

View File

@ -15,7 +15,7 @@ FoamFile
region wallFilm;
faceZones (wallFilmFaces cylinderFilmFaces);
patches (walls cylinder);
extrudeModel linearNormal;

View File

@ -1,49 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name wallFilmFaceSet;
type faceSet;
action new;
source patchToFace;
patch walls;
}
{
name wallFilmFaces;
type faceZoneSet;
action new;
source setToFaceZone;
faceSet wallFilmFaceSet;
}
{
name cylinderFilmFaceSet;
type faceSet;
action new;
source patchToFace;
patch cylinder;
}
{
name cylinderFilmFaces;
type faceZoneSet;
action new;
source setToFaceZone;
faceSet cylinderFilmFaceSet;
}
);
// ************************************************************************* //

View File

@ -14,9 +14,6 @@ runParallel topoSet
# Create the boxes and add their surfaces to the boxes patch
runParallel subsetMesh notBoxes -patch boxes -overwrite -noFields
# Create zones from the floor and the boxes
runParallel -s wallFilm topoSet -dict topoSetDict.wallFilm
# Create the film mesh
runParallel extrudeToRegionMesh -overwrite

View File

@ -15,7 +15,7 @@ FoamFile
region wallFilm;
faceZones (floorFilmFaces boxesFilmFaces);
patches (floor boxes);
extrudeModel linearNormal;

View File

@ -1,49 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name floorFilmFaceSet;
type faceSet;
action new;
source patchToFace;
patch floor;
}
{
name floorFilmFaces;
type faceZoneSet;
action new;
source setToFaceZone;
faceSet floorFilmFaceSet;
}
{
name boxesFilmFaceSet;
type faceSet;
action new;
source patchToFace;
patch boxes;
}
{
name boxesFilmFaces;
type faceZoneSet;
action new;
source setToFaceZone;
faceSet boxesFilmFaceSet;
}
);
// ************************************************************************* //

View File

@ -39,7 +39,7 @@ boundaryField
type zeroGradient;
}
region0_to_wallFilm_wallFilmFaces
region0_to_wallFilm_walls
{
type zeroGradient;
}

View File

@ -39,7 +39,7 @@ boundaryField
type zeroGradient;
}
region0_to_wallFilm_wallFilmFaces
region0_to_wallFilm_walls
{
type zeroGradient;
}

View File

@ -39,7 +39,7 @@ boundaryField
type zeroGradient;
}
region0_to_wallFilm_wallFilmFaces
region0_to_wallFilm_walls
{
type zeroGradient;
}

View File

@ -40,7 +40,7 @@ boundaryField
value $internalField;
}
region0_to_wallFilm_wallFilmFaces
region0_to_wallFilm_walls
{
type fixedValue;
value $internalField;

View File

@ -37,7 +37,7 @@ boundaryField
type noSlip;
}
region0_to_wallFilm_wallFilmFaces
region0_to_wallFilm_walls
{
type noSlip;
}

View File

@ -38,7 +38,7 @@ boundaryField
value $internalField;
}
region0_to_wallFilm_wallFilmFaces
region0_to_wallFilm_walls
{
type calculated;
value $internalField;

View File

@ -37,7 +37,7 @@ boundaryField
type fixedFluxPressure;
}
region0_to_wallFilm_wallFilmFaces
region0_to_wallFilm_walls
{
type fixedFluxPressure;
}

View File

@ -36,12 +36,12 @@ boundaryField
type zeroGradient;
}
wallFilmFaces_top
walls_top
{
type zeroGradient;
}
wallFilm_to_region0_wallFilmFaces
wallFilm_to_region0_walls
{
type zeroGradient;
}

View File

@ -36,12 +36,12 @@ boundaryField
type noSlip;
}
wallFilmFaces_top
walls_top
{
type slip;
}
wallFilm_to_region0_wallFilmFaces
wallFilm_to_region0_walls
{
type noSlip;
}

View File

@ -36,12 +36,12 @@ boundaryField
type zeroGradient;
}
wallFilmFaces_top
walls_top
{
type zeroGradient;
}
wallFilm_to_region0_wallFilmFaces
wallFilm_to_region0_walls
{
type zeroGradient;
}

View File

@ -4,7 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication topoSet
runApplication extrudeToRegionMesh -overwrite
paraFoam -touchAll

View File

@ -82,7 +82,7 @@ boundary
);
}
filmWalls
walls
{
type wall;
faces

View File

@ -15,7 +15,7 @@ FoamFile
region wallFilm;
faceZones (wallFilmFaces);
patches (walls);
extrudeModel linearNormal;

View File

@ -4,7 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication topoSet
runApplication extrudeToRegionMesh -overwrite
paraFoam -touchAll

View File

@ -15,7 +15,7 @@ FoamFile
region wallFilm;
faceZones (walls);
patches (walls);
extrudeModel linearNormal;