45 void Foam::linearValveFvMesh::addZonesAndModifiers()
54 || topoChanger_.size()
58 <<
"Zones and modifiers already present. Skipping." 64 Info<<
"Time = " << time().timeName() << endl
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 = boundaryMesh()[innerSliderName];
93 isf[i] = innerSlider.start() + i;
100 boolList(innerSlider.size(),
false),
106 const word outerSliderName(motionDict_.subDict(
"slider").lookup(
"outside"));
107 const polyPatch& outerSlider = boundaryMesh()[outerSliderName];
113 osf[i] = outerSlider.start() + i;
120 boolList(outerSlider.size(),
false),
135 List<cellZone*> cz(0);
137 Info<<
"Adding point, face and cell zones" <<
endl;
138 addZones(pz, fz, cz);
141 Info<<
"Adding topology modifiers" <<
endl;
142 topoChanger_.setSize(1);
151 outerSliderName +
"Zone",
152 innerSliderName +
"Zone",
168 void Foam::linearValveFvMesh::makeSlidersDead()
170 const polyTopoChanger& topoChanges = topoChanger_;
175 if (isA<slidingInterface>(topoChanges[modI]))
177 topoChanges[modI].disable();
182 <<
"Don't know what to do with mesh modifier " 183 << modI <<
" of type " << topoChanges[modI].type()
190 void Foam::linearValveFvMesh::makeSlidersLive()
192 const polyTopoChanger& topoChanges = topoChanger_;
197 if (isA<slidingInterface>(topoChanges[modI]))
199 topoChanges[modI].enable();
204 <<
"Don't know what to do with mesh modifier " 205 << modI <<
" of type " << topoChanges[modI].type()
212 bool Foam::linearValveFvMesh::attached()
const 214 const polyTopoChanger& topoChanges = topoChanger_;
220 if (isA<slidingInterface>(topoChanges[modI]))
224 || refCast<const slidingInterface>(topoChanges[modI]).attached();
231 if (isA<slidingInterface>(topoChanges[modI]))
236 != refCast<const slidingInterface>(topoChanges[modI]).attached()
241 <<
" named " << topoChanges[modI].name()
242 <<
" out of sync: Should be" << result
250 Info<<
"linearValveFvMesh: attached!" <<
endl;
254 Info<<
"linearValveFvMesh: detached!" <<
endl;
266 motionDict_(
dict().optionalSubDict(typeName +
"Coeffs")),
269 addZonesAndModifiers();
286 Info<<
"Decoupling sliding interfaces" <<
endl;
294 msPtr_->updateMesh();
298 Info<<
"Sliding interfaces decoupled" <<
endl;
309 msPtr_->updateMesh();
311 if (topoChangeMap.valid())
313 if (topoChangeMap().hasMotionPoints())
315 Info<<
"Topology change; executing pre-motion" <<
endl;
316 movePoints(topoChangeMap().preMotionPoints());
326 Info<<
"Coupling sliding interfaces" <<
endl;
332 Info<<
"Moving points post slider attach" <<
endl;
334 msPtr_->updateMesh();
336 Info<<
"Sliding interfaces coupled: " << attached() <<
endl;
#define forAll(list, i)
Loop across all elements in list.
virtual bool update()
Update the mesh for both mesh motion and topology change.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool movePoints()
Do what is necessary if the mesh has moved.
Virtual base class for mesh motion solver.
const Time & time() const
Return the top-level database.
Macros for easy insertion into run-time selection tables.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
List< bool > boolList
Bool container classes.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
Abstract base class for a topology changing fvMesh.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
virtual ~linearValveFvMesh()
Destructor.
linearValveFvMesh(const IOobject &io)
Construct from database.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
#define InfoInFunction
Report an information message using Foam::Info.