Go to the documentation of this file.
48 void Foam::linearValveFvMesh::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(0);
118 Info<<
"Adding point, face and cell zones" <<
endl;
122 Info<<
"Adding topology modifiers" <<
endl;
132 outerSliderName +
"Zone",
133 innerSliderName +
"Zone",
149 void Foam::linearValveFvMesh::makeSlidersDead()
151 const polyTopoChanger& topoChanges = topoChanger_;
156 if (isA<slidingInterface>(topoChanges[modI]))
158 topoChanges[modI].disable();
163 <<
"Don't know what to do with mesh modifier "
164 << modI <<
" of type " << topoChanges[modI].type()
171 void Foam::linearValveFvMesh::makeSlidersLive()
173 const polyTopoChanger& topoChanges = topoChanger_;
178 if (isA<slidingInterface>(topoChanges[modI]))
180 topoChanges[modI].enable();
185 <<
"Don't know what to do with mesh modifier "
186 << modI <<
" of type " << topoChanges[modI].type()
193 bool Foam::linearValveFvMesh::attached()
const
195 const polyTopoChanger& topoChanges = topoChanger_;
201 if (isA<slidingInterface>(topoChanges[modI]))
205 || refCast<const slidingInterface>(topoChanges[modI]).attached();
212 if (isA<slidingInterface>(topoChanges[modI]))
217 != refCast<const slidingInterface>(topoChanges[modI]).attached()
222 <<
" named " << topoChanges[modI].name()
223 <<
" out of sync: Should be" << result
231 Info<<
"linearValveFvMesh: attached!" <<
endl;
235 Info<<
"linearValveFvMesh: detached!" <<
endl;
245 Foam::linearValveFvMesh::linearValveFvMesh(
const IOobject& io)
261 ).optionalSubDict(typeName +
"Coeffs")
265 addZonesAndModifiers();
282 Info<<
"Decoupling sliding interfaces" <<
endl;
290 msPtr_->updateMesh();
294 Info<<
"Sliding interfaces decoupled" <<
endl;
302 setMorphTimeIndex(3*time().
timeIndex() + 1);
305 msPtr_->updateMesh();
307 if (topoChangeMap.valid())
309 if (topoChangeMap().hasMotionPoints())
311 Info<<
"Topology change; executing pre-motion" <<
endl;
312 movePoints(topoChangeMap().preMotionPoints());
319 movePoints(msPtr_->curPoints());
322 Info<<
"Coupling sliding interfaces" <<
endl;
325 setMorphTimeIndex(3*time().
timeIndex() + 2);
328 Info<<
"Moving points post slider attach" <<
endl;
330 msPtr_->updateMesh();
332 Info<<
"Sliding interfaces coupled: " << attached() <<
endl;
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
label size() const noexcept
The number of elements in table.
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 word timeName(const scalar t, const int precision=precision_)
const cellZoneMesh & cellZones() const
Return cell zone mesh.
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.
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.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
void setSize(const label newLen)
Same as resize()
Macros for easy insertion into run-time selection tables.
virtual ~linearValveFvMesh()
Destructor.
errorManip< error > abort(error &err)
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Virtual base class for mesh motion solver.
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 Time & time() const
Return the top-level database.
constant condensation/saturation model.
defineTypeNameAndDebug(combustionModel, 0)
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
virtual bool update()
Update the mesh for both mesh motion and topology change.
polyTopoChanger topoChanger_