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

@ -35,20 +35,12 @@ boundaryField
atmosphere
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
value $internalField;
}
defaultFaces
{
type empty;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
}

View File

@ -10,7 +10,7 @@ FoamFile
format ascii;
class volScalarField;
location "0";
object alpha.water.orig;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -24,38 +24,24 @@ boundaryField
{
type zeroGradient;
}
rightWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
inletValue $internalField;
value $internalField;
}
defaultFaces
{
type empty;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
}

View File

@ -23,45 +23,28 @@ boundaryField
leftWall
{
type epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0.1;
value $internalField;
}
rightWall
{
type epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0.1;
value $internalField;
}
lowerWall
{
type epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0.1;
value $internalField;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.1;
value uniform 0.1;
inletValue $internalField;
value $internalField;
}
defaultFaces
{
type empty;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
}

View File

@ -23,36 +23,28 @@ boundaryField
leftWall
{
type kqRWallFunction;
value uniform 0.1;
value $internalField;
}
rightWall
{
type kqRWallFunction;
value uniform 0.1;
value $internalField;
}
lowerWall
{
type kqRWallFunction;
value uniform 0.1;
value $internalField;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.1;
value uniform 0.1;
inletValue $internalField;
value $internalField;
}
defaultFaces
{
type empty;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
}

View File

@ -35,21 +35,13 @@ boundaryField
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
inletValue $internalField;
value $internalField;
}
defaultFaces
{
type empty;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
}

View File

@ -23,44 +23,27 @@ boundaryField
leftWall
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
value $internalField;
}
rightWall
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
value $internalField;
}
lowerWall
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
value $internalField;
}
atmosphere
{
type calculated;
value uniform 0;
value $internalField;
}
defaultFaces
{
type empty;
}
porous_half0
{
type cyclic;
}
porous_half1
{
type cyclic;
}
}

View File

@ -23,48 +23,28 @@ boundaryField
leftWall
{
type fixedFluxPressure;
gradient uniform 0;
value uniform 0;
value $internalField;
}
rightWall
{
type fixedFluxPressure;
gradient uniform 0;
value uniform 0;
value $internalField;
}
lowerWall
{
type fixedFluxPressure;
gradient uniform 0;
value uniform 0;
value $internalField;
}
atmosphere
{
type prghTotalPressure;
rho rho;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
p0 $internalField;
value $internalField;
}
defaultFaces
{
type empty;
}
porous_half0
{
type porousBafflePressure;
patchType cyclic;
D 10;
I 5;
length 0.15;
jump uniform 0;
value uniform 0;
}
porous_half1
{
type cyclic;
}
}

View File

@ -13,62 +13,49 @@ 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
{
cyclicFaces
{
//- Select faces and orientation through a searchableSurface
type searchableSurface;
surface searchablePlate;
origin (0.3042 0.0493 -100);
span (0 0.1584 200);
patches
owner
{
master
name porous_half0;
type cyclic;
neighbourPatch porous_half1;
patchFields
{
//- Master side patch
name porous_half0;
type cyclic;
neighbourPatch porous_half1;
//- Optional override of added patchfields. If not specified
// any added patchfields are of type calculated.
patchFields
p_rgh
{
p_rgh
{
type porousBafflePressure;
patchType cyclic;
D 10;
I 5;
length 0.15;
jump uniform 0;
value uniform 0;
}
type porousBafflePressure;
patchType cyclic;
D 10;
I 5;
length 0.15;
jump uniform 0;
value uniform 0;
}
}
slave
}
neighbour
{
name porous_half1;
type cyclic;
neighbourPatch porous_half0;
patchFields
{
//- Slave side patch
name porous_half1;
type cyclic;
neighbourPatch porous_half0;
patchFields
{
${...master.patchFields}
}
$../../owner/patchFields;
}
}
}

View File

@ -17,26 +17,21 @@ internalFacesOnly true;
baffles
{
rotating
nonCouple
{
type faceZone;
zoneName rotating;
patches
owner
{
master
{
name nonCouple1;
type patch;
inGroups (nonCouple);
}
name nonCouple1;
type patch;
}
slave
{
name nonCouple2;
type patch;
inGroups (nonCouple);
}
neighbour
{
name nonCouple2;
type patch;
}
}
}

View File

@ -11,33 +11,27 @@ FoamFile
class dictionary;
object createBafflesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
internalFacesOnly true;
baffles
{
rotating
nonCouple
{
type faceZone;
zoneName innerCylinder;
patches
owner
{
master
{
name nonCouple1;
type patch;
inGroups (nonCouple);
}
name nonCouple1;
type patch;
}
slave
{
name nonCouple2;
type patch;
inGroups (nonCouple);
}
neighbour
{
name nonCouple2;
type patch;
}
}
}

View File

@ -19,28 +19,24 @@ internalFacesOnly true;
baffles
{
baffleFaces
nonCouple
{
type searchableSurface;
surface searchableCylinder;
point1 (0 0 -100);
point2 (0 0 100);
radius $rotorRegion;
type searchableSurface;
surface searchableCylinder;
point1 (0 0 -100);
point2 (0 0 100);
radius $rotorRegion;
patches
owner
{
master
{
name nonCouple1;
type patch;
inGroups (nonCouple);
}
slave
{
name nonCouple2;
type patch;
inGroups (nonCouple);
}
name nonCouple1;
type patch;
}
neighbour
{
name nonCouple2;
type patch;
}
}
}

View File

@ -19,28 +19,24 @@ internalFacesOnly true;
baffles
{
baffleFaces
nonCouple
{
type searchableSurface;
surface searchableCylinder;
point1 (0 0 -100);
point2 (0 0 100);
radius $rotorRegion;
type searchableSurface;
surface searchableCylinder;
point1 (0 0 -100);
point2 (0 0 100);
radius $rotorRegion;
patches
owner
{
master
{
name nonCouple1;
type patch;
inGroups (nonCouple);
}
slave
{
name nonCouple2;
type patch;
inGroups (nonCouple);
}
name nonCouple1;
type patch;
}
neighbour
{
name nonCouple2;
type patch;
}
}
}