Go to the documentation of this file.
60 Info<<
"Adding ibCells for refinement" <<
endl;
63 forAll (mesh_.boundary(), patchI)
65 if (isA<immersedBoundaryFvPatch>(mesh_.boundary()[patchI]))
67 Info<<
"Found immersed boundary patch " << patchI
68 <<
" named " << mesh_.boundary()[patchI].name()
72 refCast<const immersedBoundaryFvPatch>
74 mesh_.boundary()[patchI]
81 if (!refCellSet.
found(
c[cI]))
96 Info<<
"Adding ibCellCells for refinement" <<
endl;
99 forAll (mesh_.boundary(), patchI)
101 if (isA<immersedBoundaryFvPatch>(mesh_.boundary()[patchI]))
104 refCast<const immersedBoundaryFvPatch>
106 mesh_.boundary()[patchI]
117 if (!refCellSet.
found(curCells[cI]))
119 refCellSet.
insert(curCells[cI]);
133 Info<<
"Adding ibCellCellFaces for refinement" <<
endl;
139 forAll (mesh_.boundary(), patchI)
141 if (isA<immersedBoundaryFvPatch>(mesh_.boundary()[patchI]))
144 refCast<const immersedBoundaryFvPatch>
146 mesh_.boundary()[patchI]
153 forAll (ibInsideFaces, faceI)
155 const label ownCell = owner[ibInsideFaces[faceI]];
156 const label ngbCell = neighbour[ibInsideFaces[faceI]];
158 if (gammaExtI[ownCell] < SMALL)
160 if (!refCellSet.
found(ownCell))
162 refCellSet.
insert(ownCell);
167 if (!refCellSet.
found(ngbCell))
169 refCellSet.
insert(ngbCell);
181 const scalar edgeTol = 1
e-3;
183 label axisIndex = -1;
218 vector vec10 = ctrs[1] - ctrs[0];
221 label otherCellI = -1;
223 for (
label cellI = 2; cellI < ctrs.size(); cellI++)
225 vector vec(ctrs[cellI] - ctrs[0]);
228 if (
mag(vec & vec10) < 0.9)
237 if (otherCellI == -1)
245 plane cellPlane(ctrs[0], ctrs[1], ctrs[otherCellI]);
250 const labelList& cEdges = mesh_.cellEdges()[cellI];
252 scalar minLen = GREAT;
256 minLen =
min(minLen, mesh_.edges()[cEdges[i]].mag(mesh_.points()));
259 if (cellPlane.
distance(ctrs[cellI]) > 1
e-6*minLen)
282 boolList boundaryPoint(mesh_.allPoints().size(),
false);
288 forAll (patch, patchFaceI)
290 const face&
f = patch[patchFaceI];
294 boundaryPoint[
f[fp]] =
true;
300 const edgeList& edges = mesh_.edges();
304 const edge&
e = edges[edgeI];
306 if (!boundaryPoint[
e.start()] && !boundaryPoint[
e.end()])
321 if (!isA<wedgePolyPatch>(patch))
327 if (
mag(
min(cosAngle) -
max(cosAngle)) > 1
e-6)
367 switch (collectionType)
370 case IB_CELL_CELL_FACES:
372 addIbCellCellFaces(refCellSet);
377 addIbCellCells(refCellSet);
382 addIbCells(refCellSet);
390 "labelList refineImmersedBoundaryMesh::refinementCells\n"
392 " const ibCellCollection& collectionType\n"
394 ) <<
"Collection type undefined: "
395 << ibCellCollectionNames_[collectionType]
400 return refCellSet.
toc();
409 Info <<
"nRefCells = " << refCells.
size() <<
"\n" <<
endl;
415 label axisIndex = twoDNess();
419 Info<<
"3D case; refining all directions" <<
nl <<
endl;
428 refineDict.
add(
"useHexTopology",
"true");
436 Info<<
"2D case; refining in directions y,z\n" <<
endl;
440 else if (axisIndex == 1)
442 Info<<
"2D case; refining in directions x,z\n" <<
endl;
448 Info<<
"2D case; refining in directions x,y\n" <<
endl;
456 refineDict.
add(
"useHexTopology",
"false");
459 refineDict.
add(
"coordinateSystem",
"global");
464 refineDict.
add(
"globalCoeffs", coeffsDict);
466 refineDict.
add(
"geometricCut",
"false");
467 refineDict.
add(
"writeMesh",
"false");
scalar distance(const point &p) const
Return distance from the given point to the plane.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const vector & normal() const
Return plane normal.
void refineMesh(const labelList &refCells) const
List< label > labelList
A List of labels.
List< Key > toc() const
Return the table of contents.
#define forAll(list, i)
Loop across all elements in list.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void addIbCellCellFaces(labelHashSet &refCellSet) const
Add ibCellCellFaces for refinement.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
Set of directions for each cell in the mesh. Either uniform and size=1 or one set of directions per c...
Field< vector > vectorField
Specialisation of Field<T> for vector.
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
label axis(const vector &normal) const
From refineMesh application.
ibCellCollection
Cell collection method.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
const labelList & ibCells() const
Return list of fluid cells next to immersed boundary (IB cells)
Immersed boundary FV patch.
refineImmersedBoundaryMesh(const refineImmersedBoundaryMesh &)
Disallow default bitwise copy construct.
A patch is a list of labels that address the faces in the global face list.
static const NamedEnum< ibCellCollection, 4 > ibCellCollectionNames_
Projection method names.
InternalField & internalField()
Return internal field.
Does multiple pass refinement to refine cells in multiple directions.
A list of keyword definitions, which are a keyword followed by any number of values (e....
bool found(const Key &) const
Return true if hashedEntry is found in table.
labelList refinementCells(const ibCellCollection &collectionType) const
Return list of cells for refinement based on specifie collection.
Mesh data needed to do the Finite Volume discretisation.
errorManip< error > abort(error &err)
const double e
Elementary charge.
List< bool > boolList
Bool container classes.
Vector< scalar > vector
A scalar version of the templated Vector.
label twoDNess() const
From refineMesh application.
const volScalarField & gammaExt() const
Get extended flud cells indicator, including live and IB cells.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void addIbCells(labelHashSet &refCellSet) const
Add ibCells for refinement.
const labelListList & ibCellCells() const
Return IB cell extended stencil.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const vectorField::subField faceAreas() const
Return face normals.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
~refineImmersedBoundaryMesh()
Destructor.
bool insert(const Key &key)
Insert a new entry.
const labelList & ibInsideFaces() const
Return list of fluid faces for which one neighbour is an.
const dimensionedScalar c
Speed of light in a vacuum.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A face is a list of labels corresponding to mesh vertices.
void addIbCellCells(labelHashSet &refCellSet) const
Add ibCellCells for refinement.
void size(const label)
Override size to be inconsistent with allocated storage.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
bool add(entry *, bool mergeEntry=false)
Add a new entry.
Initialise the NamedEnum HashTable from the static list of names.
A normal distribution model.