45 void Foam::mixerFvMesh::addZonesAndModifiers()
57 Info<<
"void mixerFvMesh::addZonesAndModifiers() : "
58 <<
"Zones and modifiers already present. Skipping."
65 <<
"Adding zones and modifiers to the mesh" <<
endl;
68 List<pointZone*> pz(1);
83 List<faceZone*> fz(3);
86 const word innerSliderName(motionDict_.
subDict(
"slider").
lookup(
"inside"));
87 const polyPatch& innerSlider =
94 isf[i] = innerSlider.start() + i;
101 boolList(innerSlider.size(),
false),
107 const word outerSliderName(motionDict_.
subDict(
"slider").
lookup(
"outside"));
108 const polyPatch& outerSlider =
115 osf[i] = outerSlider.start() + i;
122 boolList(outerSlider.size(),
false),
137 List<cellZone*> cz(1);
140 regionSplit rs(*
this);
146 label nMovingCells = 0;
150 if (rs[cellI] == originRegion)
152 movingCells[nMovingCells] = cellI;
157 movingCells.setSize(nMovingCells);
158 Info <<
"Number of cells in the moving region: " << nMovingCells <<
endl;
168 Info <<
"Adding point, face and cell zones" <<
endl;
172 Info <<
"Adding topology modifiers" <<
endl;
182 outerSliderName +
"Zone",
183 innerSliderName +
"Zone",
197 void Foam::mixerFvMesh::calcMovingMasks()
const
201 Info<<
"void mixerFvMesh::calcMovingMasks() const : "
202 <<
"Calculating point and cell masks"
206 if (movingPointsMaskPtr_)
208 FatalErrorIn(
"void mixerFvMesh::calcMovingMasks() const")
209 <<
"point mask already calculated"
215 scalarField& movingPointsMask = *movingPointsMaskPtr_;
221 cellZones()[cellZones().findZoneID(
"movingCells")];
225 const cell& curCell = c[cellAddr[cellI]];
230 const face& curFace = f[curCell[faceI]];
234 movingPointsMask[curFace[pointI]] = 1;
239 const word innerSliderZoneName
241 word(motionDict_.subDict(
"slider").lookup(
"inside"))
246 faceZones()[faceZones().findZoneID(innerSliderZoneName)];
248 forAll (innerSliderAddr, faceI)
250 const face& curFace = f[innerSliderAddr[faceI]];
254 movingPointsMask[curFace[pointI]] = 1;
258 const word outerSliderZoneName
260 word(motionDict_.subDict(
"slider").lookup(
"outside"))
265 faceZones()[faceZones().findZoneID(outerSliderZoneName)];
267 forAll (outerSliderAddr, faceI)
269 const face& curFace = f[outerSliderAddr[faceI]];
273 movingPointsMask[curFace[pointI]] = 0;
282 Foam::mixerFvMesh::mixerFvMesh
300 ).subDict(typeName +
"Coeffs")
307 motionDict_.subDict(
"coordinateSystem")
311 movingPointsMaskPtr_(NULL)
313 addZonesAndModifiers();
315 Info<<
"Mixer mesh:" <<
nl
316 <<
" origin: " << cs().origin() <<
nl
317 <<
" axis: " << cs().axis() <<
nl
318 <<
" rpm: " << rpm_ <<
endl;
334 if (!movingPointsMaskPtr_)
339 return *movingPointsMaskPtr_;
348 csPtr_->globalPosition
350 csPtr_->localPosition(
points())
351 +
vector(0, rpm_*360.0*time().deltaT().value()/60.0, 0)
359 if (topoChangeMap.
valid())
363 Info <<
"Mesh topology is changing" <<
endl;
371 csPtr_->globalPosition
373 csPtr_->localPosition(oldPoints())
374 +
vector(0, rpm_*360.0*time().deltaT().value()/60.0, 0)