Go to the documentation of this file.
48 void Foam::mixerFvMesh::addZonesAndModifiers()
61 <<
"Zones and modifiers already present. Skipping."
68 <<
"Adding zones and modifiers to the mesh" <<
endl;
71 List<pointZone*> pz(1);
74 pz[0] =
new pointZone(
"cutPointZone", 0,
pointZones());
79 List<faceZone*> fz(3);
82 const word innerSliderName
84 motionDict_.
subDict(
"slider").
get<word>(
"inside")
86 const polyPatch& innerSlider =
boundaryMesh()[innerSliderName];
91 identity(innerSlider.size(), innerSlider.start()),
98 const word outerSliderName
100 motionDict_.
subDict(
"slider").
get<word>(
"outside")
102 const polyPatch& outerSlider =
boundaryMesh()[outerSliderName];
107 identity(outerSlider.size(), outerSlider.start()),
114 fz[2] =
new faceZone(
"cutFaceZone", 2,
faceZones());
116 List<cellZone*> cz(1);
119 regionSplit rs(*
this);
125 label nMovingCells = 0;
129 if (rs[celli] == originRegion)
131 movingCells[nMovingCells] = celli;
136 movingCells.resize(nMovingCells);
137 Info<<
"Number of cells in the moving region: " << nMovingCells <<
endl;
142 std::move(movingCells),
147 Info<<
"Adding point, face and cell zones" <<
endl;
151 Info<<
"Adding topology modifiers" <<
endl;
161 outerSliderName +
"Zone",
162 innerSliderName +
"Zone",
176 void Foam::mixerFvMesh::calcMovingMasks()
const
181 <<
"Calculating point and cell masks"
185 if (movingPointsMaskPtr_)
188 <<
"point mask already calculated"
194 scalarField& movingPointsMask = *movingPointsMaskPtr_;
199 const labelList& cellAddr = cellZones()[
"movingCells"];
201 for (
const label celli : cellAddr)
203 const cell& curCell =
c[celli];
205 for (
const label facei : curCell)
208 const face& curFace =
f[facei];
212 movingPointsMask[curFace[pointi]] = 1;
217 const word innerSliderZoneName
219 motionDict_.subDict(
"slider").get<word>(
"inside") +
"Zone"
222 const labelList& innerSliderAddr = faceZones()[innerSliderZoneName];
224 for (
const label facei : innerSliderAddr)
226 const face& curFace =
f[facei];
230 movingPointsMask[curFace[pointi]] = 1;
234 const word outerSliderZoneName
236 motionDict_.subDict(
"slider").get<word>(
"outside") +
"Zone"
239 const labelList& outerSliderAddr = faceZones()[outerSliderZoneName];
241 for (
const label facei : outerSliderAddr)
243 const face& curFace =
f[facei];
247 movingPointsMask[curFace[pointi]] = 0;
255 Foam::mixerFvMesh::mixerFvMesh
274 ).optionalSubDict(typeName +
"Coeffs")
277 rpm_(motionDict_.get<scalar>(
"rpm")),
278 movingPointsMaskPtr_(
nullptr)
280 if (motionDict_.found(coordinateSystem::typeName_()))
291 addZonesAndModifiers();
293 Info<<
"Mixer mesh:" <<
nl
294 <<
" origin: " << csys_.origin() <<
nl
295 <<
" axis: " << csys_.e3() <<
nl
296 <<
" rpm: " << rpm_ <<
endl;
313 if (!movingPointsMaskPtr_)
318 return *movingPointsMaskPtr_;
331 csys_.localPosition(
points())
340 if (topoChangeMap.
valid())
354 csys_.localPosition(oldPoints())
int debug
Static debugging option.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
List< label > labelList
A List of labels.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
label size() const noexcept
The number of elements in table.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
#define InfoInFunction
Report an information message using Foam::Info.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
static constexpr const zero Zero
Global zero.
static word timeName(const scalar t, const int precision=precision_)
const cellZoneMesh & cellZones() const
Return cell zone mesh.
Unit conversion functions.
bool valid() const noexcept
True if the managed pointer is non-null.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
#define forAll(list, i)
Loop across all elements in list.
const faceZoneMesh & faceZones() const
Return face zone mesh.
void deleteDemandDrivenData(DataPtr &dataPtr)
virtual const point & origin() const
Return origin.
label findNearestCell(const point &location) const
Find the cell with the nearest cell centre to location.
label nCells() const
Number of mesh cells.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
writeOption writeOpt() const
The write option.
messageStream Info
Information stream (uses stdout - output is on the master only)
const pointZoneMesh & pointZones() const
Return point zone mesh.
static autoPtr< coordinateSystem > New(word modelType, const objectRegistry &obr, const dictionary &dict)
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
List< cell > cellList
A List of cells.
void setSize(const label newLen)
Same as resize()
A cylindrical coordinate system (r-theta-z). The coordinate system angle theta is always in radians.
Macros for easy insertion into run-time selection tables.
errorManip< error > abort(error &err)
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
virtual bool update()
Update the mesh for both mesh motion and topology change.
constexpr scalar rpmToRads(const scalar rpm) noexcept
Conversion from revolutions/minute to radians/sec.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< face > faceList
A List of faces.
Abstract base class for a topology changing fvMesh.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
const dimensionedScalar c
Speed of light in a vacuum.
const Time & time() const
Return the top-level database.
virtual ~mixerFvMesh()
Destructor.
constant condensation/saturation model.
defineTypeNameAndDebug(combustionModel, 0)
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
Base class for coordinate system specification, the default coordinate system type is cartesian .
polyTopoChanger topoChanger_