Merge branch 'feature-createPatch-cyclicACMI' into 'develop'
ENH: createPatch: allow duplicating face (for ACMI) See merge request Development/openfoam!702
This commit is contained in:
commit
77ba7ca4d4
@ -52,6 +52,7 @@ Description
|
|||||||
#include "IOPtrList.H"
|
#include "IOPtrList.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "polyModifyFace.H"
|
#include "polyModifyFace.H"
|
||||||
|
#include "polyAddFace.H"
|
||||||
#include "wordRes.H"
|
#include "wordRes.H"
|
||||||
#include "processorMeshes.H"
|
#include "processorMeshes.H"
|
||||||
#include "IOdictionary.H"
|
#include "IOdictionary.H"
|
||||||
@ -344,6 +345,7 @@ void matchPatchFaces
|
|||||||
|
|
||||||
void changePatchID
|
void changePatchID
|
||||||
(
|
(
|
||||||
|
const bool modify,
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const label faceID,
|
const label faceID,
|
||||||
const label patchID,
|
const label patchID,
|
||||||
@ -361,21 +363,43 @@ void changePatchID
|
|||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
if (modify)
|
||||||
(
|
{
|
||||||
polyModifyFace
|
meshMod.setAction
|
||||||
(
|
(
|
||||||
mesh.faces()[faceID], // face
|
polyModifyFace
|
||||||
faceID, // face ID
|
(
|
||||||
mesh.faceOwner()[faceID], // owner
|
mesh.faces()[faceID], // face
|
||||||
-1, // neighbour
|
faceID, // face ID
|
||||||
false, // flip flux
|
mesh.faceOwner()[faceID], // owner
|
||||||
patchID, // patch ID
|
-1, // neighbour
|
||||||
false, // remove from zone
|
false, // flip flux
|
||||||
zoneID, // zone ID
|
patchID, // patch ID
|
||||||
zoneFlip // zone flip
|
false, // remove from zone
|
||||||
)
|
zoneID, // zone ID
|
||||||
);
|
zoneFlip // zone flip
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
meshMod.setAction
|
||||||
|
(
|
||||||
|
polyAddFace
|
||||||
|
(
|
||||||
|
mesh.faces()[faceID], // modified face
|
||||||
|
mesh.faceOwner()[faceID], // owner
|
||||||
|
-1, // neighbour
|
||||||
|
-1, // master point
|
||||||
|
-1, // master edge
|
||||||
|
faceID, // master face
|
||||||
|
false, // face flip
|
||||||
|
patchID, // patch for face
|
||||||
|
zoneID, // zone for face
|
||||||
|
zoneFlip // face flip in zone
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -399,7 +423,9 @@ void changePatchID
|
|||||||
<< " existing boundary faces." << exit(FatalError);
|
<< " existing boundary faces." << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isRepatchedBoundary.set(facei-mesh.nInternalFaces()))
|
const bool isFirst =
|
||||||
|
isRepatchedBoundary.set(facei-mesh.nInternalFaces());
|
||||||
|
if (!isFirst)
|
||||||
{
|
{
|
||||||
static label nWarnings = 0;
|
static label nWarnings = 0;
|
||||||
if (nWarnings == 0)
|
if (nWarnings == 0)
|
||||||
@ -413,14 +439,14 @@ void changePatchID
|
|||||||
<< " name " << mesh.boundaryMesh()[patchID].name()
|
<< " name " << mesh.boundaryMesh()[patchID].name()
|
||||||
<< " is already marked for patch " << newPatchi
|
<< " is already marked for patch " << newPatchi
|
||||||
<< " name " << mesh.boundaryMesh()[newPatchi].name()
|
<< " name " << mesh.boundaryMesh()[newPatchi].name()
|
||||||
<< ". Suppressing further warnings"
|
<< ". Creating duplicate face. Suppressing further warnings"
|
||||||
//<< exit(FatalError);
|
//<< exit(FatalError);
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
nWarnings++;
|
nWarnings++;
|
||||||
}
|
}
|
||||||
|
|
||||||
changePatchID(mesh, facei, patchID, meshMod);
|
changePatchID(isFirst, mesh, facei, patchID, meshMod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,6 +168,69 @@ patches
|
|||||||
// Wildcards&patchGroups allowed.
|
// Wildcards&patchGroups allowed.
|
||||||
patches (coupling_group);
|
patches (coupling_group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Example of creating cyclicACMI patch pair
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// (creates duplicate faces for blockage)
|
||||||
|
{
|
||||||
|
// Name of new patch
|
||||||
|
name left_couple;
|
||||||
|
|
||||||
|
// Dictionary to construct new patch from
|
||||||
|
patchInfo
|
||||||
|
{
|
||||||
|
type cyclicACMI;
|
||||||
|
neighbourPatch right_couple;
|
||||||
|
nonOverlapPatch left_blockage;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select faces
|
||||||
|
constructFrom set;
|
||||||
|
set left_faces_set;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name left_blockage;
|
||||||
|
patchInfo
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select faces
|
||||||
|
constructFrom set;
|
||||||
|
set left_faces_set;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Name of new patch
|
||||||
|
name right_couple;
|
||||||
|
|
||||||
|
// Dictionary to construct new patch from
|
||||||
|
patchInfo
|
||||||
|
{
|
||||||
|
type cyclicACMI;
|
||||||
|
neighbourPatch left_couple;
|
||||||
|
nonOverlapPatch right_blockage;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select faces
|
||||||
|
constructFrom set;
|
||||||
|
set right_faces_set;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name right_blockage;
|
||||||
|
// Dictionary to construct new patch from
|
||||||
|
patchInfo
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select faces
|
||||||
|
constructFrom set;
|
||||||
|
set right_faces_set;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
Loading…
Reference in New Issue
Block a user