createBaffles: Simplified input syntax

This utility now always creates two patches, and only creates duplicate
faces when they connect to different cells and point in opposite
directions. Now that ACMI has been removed, there is no need to create
duplicate faces on the same cell and with similar orientations. This is
unituitive and is now considered an invalid mesh topology.

The preferred syntax for createBaffles is now as follows:

    internalFacesOnly true;

    baffles
    {
        cyclics
        {
            type        faceZone;
            zoneName    cyclicFaces;

            owner
            {
                name            cyclicLeft;
                type            cyclic;
                neighbourPatch  cyclicRight;
            }

            neighbour
            {
                name            cyclicRight;
                type            cyclic;
                neighbourPatch  cyclicLeft;
            }
        }
    }

Note that the 'patches' sub-dictionary is not needed any more; the
'owner' and 'neighbour' sub-dictionaries can be in the same dictionary
as the parameters with which faces are selected. For backwards
compatibility, however, a 'patches' sub-dictionary is still permitted,
as are keywords 'master' and 'slave' (in place of 'owner' and
'neighbour', respectively).

The 'patchPairs' syntax has been removed. Whilst consise, this syntax
made a number of assumptions and decisions regarding naming conventions
that were not sufficiently intuitive for the user to understand without
extensive reference to the code. If identical boundaries are desired on
both sides of the patch, dictionary substitution provides a more
intuitive way of minimising the amount of specifiection required. For
example, to create two back-to-back walls, the following specification
could be used:

    internalFacesOnly true;

    fields true;

    baffles
    {
        walls
        {
            type        faceZone;
            zoneName    wallFaces;

            owner
            {
                name            baffleWallLeft;
                type            wall;

                patchFields
                {
                    p
                    {
                        type            zeroGradient;
                    }

                    U
                    {
                        type            noSlip;
                    }
                }
            }

            neighbour
            {
                name            baffleWallRight;
                $owner; // <-- Use the same settings as for the owner
            }
        }
    }
This commit is contained in:
Will Bainbridge
2022-05-20 12:37:10 +01:00
parent d151a85bf7
commit f93300ee11
51 changed files with 1264 additions and 1594 deletions

View File

@ -19,9 +19,11 @@ internalField uniform 17000;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type zeroGradient;
type zeroGradient;
}
}

View File

@ -20,16 +20,9 @@ internalField uniform 300;
boundaryField
{
bottom
{
type compressible::thermalBaffle;
value uniform 300;
}
side
{
type zeroGradient;
}
top
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type compressible::thermalBaffle;
value uniform 300;

View File

@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
rm -rf constant/baffle3DRegion/polyMesh
rm -rf 0
cleanCase && rm -rf constant/baffle3DRegion/polyMesh
#------------------------------------------------------------------------------

View File

@ -1,16 +1,13 @@
#!/bin/sh
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application=$(getApplication)
# Mesh
runApplication blockMesh
cp -R 0.orig 0
# Create 1D and 3D baffles
runApplication createBaffles -overwrite
runApplication $application
# Run
runApplication $(getApplication)
#------------------------------------------------------------------------------

View File

@ -1,21 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
T
{
type compressible::thermalBaffle1D<eConstSolidThermoPhysics>;
thickness uniform 0.005; // Thickness [m]
qs uniform 100; // Source heat flux [W/m^2]
# include "1DbaffleSolidThermo"
value uniform 300;
}
// ************************************************************************* //

View File

@ -1,27 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
specie
{
molWeight 20;
}
transport
{
kappa 1;
}
thermodynamics
{
Hf 0;
Cv 10;
}
equationOfState
{
rho 10;
}
// ************************************************************************* //

View File

@ -1,22 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
T
{
type compressible::thermalBaffle;
value uniform 300;
regionName ${baffleRegionName};
#include "3DbaffleRadiation"
// New fvMesh (region) information
#include "extrudeModel"
}
// ************************************************************************* //

View File

@ -1,16 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
radiation
{
radiationModel opaqueSolid;
absorptionEmissionModel none;
scatterModel none;
}
// ************************************************************************* //

View File

@ -1,18 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
extrudeModel linearNormal;
nLayers ${nLayers};
expansionRatio 1;
columnCells ${oneD}; //3D
linearNormalCoeffs
{
thickness ${thickness};
}
// ************************************************************************* //

View File

@ -1,21 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
baffleRegionName baffle3DRegion;
masterPatchName baffle3DRegionMaster;
slavePatchName baffle3DRegionSlave;
oneD false;
nLayers 50;
thickness 0.02;
// ************************************************************************* //

View File

@ -13,53 +13,144 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Whether to convert internal faces only (so leave boundary faces intact).
// This is only relevant if your face selection type can pick up boundary
// faces.
internalFacesOnly true;
fields true;
// Baffles to create.
baffles
{
baffleFacesThermoBaffle1D
{
//- Use predefined faceZone to select faces and orientation.
type searchableSurface;
surface triSurfaceMesh;
name baffle1D.stl;
patchPairs
owner
{
type wall;
name baffle1D0;
type mappedWall;
sampleMode nearestPatchFace;
samplePatch baffle1D1;
patchFields
{
#include "./include/wallBafflePatches"
#include "./include/1DBaffle/1DTemperatureMasterBafflePatches"
T
{
type compressible::thermalBaffle1D<eConstSolidThermoPhysics>;
value uniform 300;
// Baffle thickness [m]
thickness uniform 0.005;
// Baffle source heat flux [W/m^2]
qs uniform 100;
// Baffle physical properties
specie
{
molWeight 20;
}
transport
{
kappa 1;
}
thermodynamics
{
Hf 0;
Cv 10;
}
equationOfState
{
rho 10;
}
}
}
}
neighbour
{
name baffle1D1;
type mappedWall;
sampleMode nearestPatchFace;
samplePatch baffle1D0;
patchFields
{
#include "./include/wallBafflePatches"
T
{
type compressible::thermalBaffle1D<eConstSolidThermoPhysics>;
value uniform 300;
}
}
}
}
#include "./include/baffle3DSetup"
baffleFacesThermoBaffle3D
{
type searchableSurface;
surface triSurfaceMesh;
name baffle3D.stl;
patchPairs
owner
{
type mappedWall;
sampleMode nearestPatchFace;
// Put master and slave patch in same group (default on)
// Otherwise makeup group names xxx_master and xxx_slave
sameGroup off;
name baffle3D0;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion baffle3DRegion;
samplePatch baffle3D0;
patchFields
{
#include "./include/wallBafflePatches"
#include "./include/3DBaffle/3DTemperatureMasterBafflePatches"
T
{
type compressible::thermalBaffle;
neighbourPatch baffle3D1;
value uniform 300;
// Baffle geometry and mesh properties
extrudeModel linearNormal;
nLayers 50;
expansionRatio 1;
linearNormalCoeffs
{
thickness 0.02;
}
// Baffle radiation properties
radiation
{
radiationModel opaqueSolid;
absorptionEmissionModel none;
scatterModel none;
}
}
}
}
neighbour
{
name baffle3D1;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion baffle3DRegion;
samplePatch baffle3D1;
patchFields
{
#include "./include/wallBafflePatches"
T
{
type compressible::thermalBaffle;
neighbourPatch baffle3D0;
value uniform 300;
}
}
}
}

View File

@ -13,30 +13,24 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Whether to convert internal faces only (so leave boundary faces intact).
// This is only relevant if your face selection type can pick up boundary
// faces.
internalFacesOnly true;
baffles
{
baffles
{
//- Use predefined faceZone to select faces and orientation.
type faceZone;
zoneName rotorBlades;
patches
owner
{
master
{
name blades;
type wall;
}
slave
{
$master;
}
name blades;
type wall;
}
neighbour
{
name blades;
}
}
}

View File

@ -22,24 +22,22 @@ baffles
type faceZone;
zoneName shell_to_solid;
patches
owner
{
master
{
name shell_to_solid;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion solid;
samplePatch solid_to_shell;
}
slave
{
name solid_to_shell;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion shell;
samplePatch shell_to_solid;
}
name shell_to_solid;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion solid;
samplePatch solid_to_shell;
}
neighbour
{
name solid_to_shell;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion shell;
samplePatch shell_to_solid;
}
}
@ -48,24 +46,22 @@ baffles
type faceZone;
zoneName tube_to_solid;
patches
owner
{
master
{
name tube_to_solid;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion solid;
samplePatch solid_to_tube;
}
slave
{
name solid_to_tube;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion tube;
samplePatch tube_to_solid;
}
name tube_to_solid;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion solid;
samplePatch solid_to_tube;
}
neighbour
{
name solid_to_tube;
type mappedWall;
sampleMode nearestPatchFace;
sampleRegion tube;
samplePatch tube_to_solid;
}
}
}