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
}
}
}
144 lines
4.1 KiB
C++
144 lines
4.1 KiB
C++
/*--------------------------------*- 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 createBafflesDict;
|
|
}
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
// This is a sample configuration for creating baffles. Notes:
|
|
//
|
|
// - This utility usually converts internal faces into two boundary faces.
|
|
//
|
|
// - It can also convert boundary faces into a boundary face on a different
|
|
// patch.
|
|
//
|
|
// - Faces are selected to make into baffles by specifying either a faceZone or
|
|
// a searchableSurface.
|
|
//
|
|
// - Each selection requires two patches to be specified; the owner (or master)
|
|
// and the neighbour (or slave).
|
|
//
|
|
// - Orientation matters. Internal faces will be split into two faces, and the
|
|
// face that is oriented in the same direction as the zone or surface will be
|
|
// added to the owner/master patch. The other face will be added to the
|
|
// neighbour/slave patch. Boundary faces will be added to the owner patch if
|
|
// they are oriented in the same direction as the zone or surface, and they
|
|
// will be added to the neighbour patch otherwise.
|
|
//
|
|
// - Optionally, fields can also be modified. If the added patches are of
|
|
// non-constrained type then patch-field entries must be provided for all
|
|
// fields.
|
|
//
|
|
|
|
// Whether to convert internal faces only, and ignore any boundary faces that
|
|
// are in the selection
|
|
internalFacesOnly true;
|
|
|
|
// Whether to add patch fields to the field files
|
|
fields true;
|
|
|
|
// Baffles to create
|
|
baffles
|
|
{
|
|
// Wall baffle example
|
|
baffleFaces
|
|
{
|
|
// Use a surface to select faces and orientation.
|
|
type searchableSurface;
|
|
surface triSurfaceMesh;
|
|
name baffle1D.stl;
|
|
|
|
// Owner patch
|
|
owner
|
|
{
|
|
name baffleWall0;
|
|
type wall;
|
|
|
|
// Patch field settings (can be omitted if fields = false)
|
|
patchFields
|
|
{
|
|
p
|
|
{
|
|
type zeroGradient;
|
|
}
|
|
|
|
U
|
|
{
|
|
type noSlip;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Neighbour patch. Use the same settings as for the owner.
|
|
neighbour
|
|
{
|
|
name baffleWall1;
|
|
$owner;
|
|
}
|
|
}
|
|
|
|
// Cyclic example
|
|
cyclicFaces
|
|
{
|
|
// Use a zone to select faces and orientation
|
|
type faceZone;
|
|
zoneName cyclicFaces;
|
|
|
|
// Owner patch
|
|
owner
|
|
{
|
|
name fan0;
|
|
type cyclic;
|
|
neighbourPatch fan1;
|
|
transform none;
|
|
|
|
// Patch field settings. Note U (and others) are not needed because
|
|
// the patch that is being created is of constrained type, so the
|
|
// fields can be constructed automatically. A field for p is given
|
|
// here as it is an override (see the 'patchType' entry).
|
|
patchFields
|
|
{
|
|
p
|
|
{
|
|
type fan;
|
|
patchType cyclic;
|
|
jump uniform 0;
|
|
value uniform 0;
|
|
jumpTable polynomial 1((100 0));
|
|
}
|
|
}
|
|
}
|
|
|
|
// Neighbour patch
|
|
neighbour
|
|
{
|
|
name fan1;
|
|
type cyclic;
|
|
neighbourPatch fan0;
|
|
transform none;
|
|
|
|
// Patch field settings
|
|
patchFields
|
|
{
|
|
p
|
|
{
|
|
type fan;
|
|
patchType cyclic;
|
|
value uniform 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// ************************************************************************* //
|