49void Foam::mixerFvMesh::addZonesAndModifiers()
62 <<
"Zones and modifiers already present. Skipping."
69 <<
"Adding zones and modifiers to the mesh" <<
endl;
72 List<pointZone*> pz(1);
75 pz[0] =
new pointZone(
"cutPointZone", 0,
pointZones());
80 List<faceZone*> fz(3);
83 const word innerSliderName
85 motionDict_.
subDict(
"slider").
get<word>(
"inside")
87 const polyPatch& innerSlider =
boundaryMesh()[innerSliderName];
99 const word outerSliderName
101 motionDict_.
subDict(
"slider").
get<word>(
"outside")
103 const polyPatch& outerSlider =
boundaryMesh()[outerSliderName];
115 fz[2] =
new faceZone(
"cutFaceZone", 2,
faceZones());
117 List<cellZone*> cz(1);
120 regionSplit rs(*
this);
126 label nMovingCells = 0;
130 if (rs[celli] == originRegion)
132 movingCells[nMovingCells] = celli;
137 movingCells.resize(nMovingCells);
138 Info<<
"Number of cells in the moving region: " << nMovingCells <<
endl;
143 std::move(movingCells),
148 Info<<
"Adding point, face and cell zones" <<
endl;
152 Info<<
"Adding topology modifiers" <<
endl;
162 outerSliderName +
"Zone",
163 innerSliderName +
"Zone",
177void Foam::mixerFvMesh::calcMovingMasks()
const
181 if (movingPointsMaskPtr_)
184 <<
"point mask already calculated"
190 scalarField& movingPointsMask = *movingPointsMaskPtr_;
195 const labelList& cellAddr = cellZones()[
"movingCells"];
197 for (
const label celli : cellAddr)
199 const cell& curCell =
c[celli];
201 for (
const label facei : curCell)
204 const face& curFace =
f[facei];
208 movingPointsMask[curFace[pointi]] = 1;
213 const word innerSliderZoneName
215 motionDict_.subDict(
"slider").get<word>(
"inside") +
"Zone"
218 const labelList& innerSliderAddr = faceZones()[innerSliderZoneName];
220 for (
const label facei : innerSliderAddr)
222 const face& curFace =
f[facei];
226 movingPointsMask[curFace[pointi]] = 1;
230 const word outerSliderZoneName
232 motionDict_.subDict(
"slider").get<word>(
"outside") +
"Zone"
235 const labelList& outerSliderAddr = faceZones()[outerSliderZoneName];
237 for (
const label facei : outerSliderAddr)
239 const face& curFace =
f[facei];
243 movingPointsMask[curFace[pointi]] = 0;
270 ).optionalSubDict(typeName +
"Coeffs")
273 rpm_(motionDict_.get<scalar>(
"rpm")),
274 movingPointsMaskPtr_(nullptr)
276 if (motionDict_.
found(coordinateSystem::typeName_()))
287 addZonesAndModifiers();
289 Info<<
"Mixer mesh:" <<
nl
290 <<
" origin: " << csys_.
origin() <<
nl
291 <<
" axis: " << csys_.
e3() <<
nl
292 <<
" rpm: " << rpm_ <<
endl;
309 if (!movingPointsMaskPtr_)
314 return *movingPointsMaskPtr_;
327 csys_.localPosition(
points())
347 csys_.localPosition(oldPoints())
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
label size() const noexcept
The number of elements in table.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
writeOption writeOpt() const noexcept
The write option.
const T * set(const label i) const
void setSize(const label newLen)
Same as resize()
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
label size() const noexcept
The number of elements in the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A cylindrical coordinate system (r-theta-z). The coordinate system angle theta is always in radians.
Base class for coordinate system specification, the default coordinate system type is cartesian .
virtual const point & origin() const
Return origin.
virtual const vector e3() const
The local Cartesian z-axis in global coordinates.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
const Time & time() const
Return the top-level database.
virtual bool update()
Update the mesh for both mesh motion and topology change.
virtual ~mixerFvMesh()
Destructor.
constant condensation/saturation model.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
label findNearestCell(const point &location) const
Find the cell with the nearest cell centre to location.
label nCells() const noexcept
Number of mesh cells.
Abstract base class for a topology changing fvMesh.
polyTopoChanger topoChanger_
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define DebugInFunction
Report an information message using Foam::Info.
#define InfoInFunction
Report an information message using Foam::Info.
const dimensionedScalar c
Speed of light in a vacuum.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
List< label > labelList
A List of labels.
List< cell > cellList
A List of cells.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar rpmToRads() noexcept
Multiplication factor for revolutions/minute to radians/sec.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
List< face > faceList
A List of faces.
void deleteDemandDrivenData(DataPtr &dataPtr)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.