45 void Foam::linearValveFvMesh::addZonesAndModifiers()
57 Info<<
"void linearValveFvMesh::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(0);
139 Info <<
"Adding point, face and cell zones" <<
endl;
143 Info <<
"Adding topology modifiers" <<
endl;
153 outerSliderName +
"Zone",
154 innerSliderName +
"Zone",
170 void Foam::linearValveFvMesh::makeSlidersDead()
172 const polyTopoChanger& topoChanges = topoChanger_;
175 forAll (topoChanges, modI)
177 if (isA<slidingInterface>(topoChanges[modI]))
179 topoChanges[modI].disable();
183 FatalErrorIn(
"void Foam::linearValveFvMesh::makeSlidersDead()")
184 <<
"Don't know what to do with mesh modifier "
185 << modI <<
" of type " << topoChanges[modI].type()
192 void Foam::linearValveFvMesh::makeSlidersLive()
194 const polyTopoChanger& topoChanges = topoChanger_;
197 forAll (topoChanges, modI)
199 if (isA<slidingInterface>(topoChanges[modI]))
201 topoChanges[modI].enable();
205 FatalErrorIn(
"void Foam::linearValveFvMesh::makeLayersLive()")
206 <<
"Don't know what to do with mesh modifier "
207 << modI <<
" of type " << topoChanges[modI].type()
214 bool Foam::linearValveFvMesh::attached()
const
216 const polyTopoChanger& topoChanges = topoChanger_;
220 forAll (topoChanges, modI)
222 if (isA<slidingInterface>(topoChanges[modI]))
226 || refCast<const slidingInterface>(topoChanges[modI]).attached();
231 forAll (topoChanges, modI)
233 if (isA<slidingInterface>(topoChanges[modI]))
238 != refCast<const slidingInterface>(topoChanges[modI]).attached()
241 FatalErrorIn(
"bool linearValveFvMesh::attached() const")
242 <<
"Slider " << modI <<
" named " << topoChanges[modI].name()
243 <<
" out of sync: Should be" << result
251 Info <<
"linearValveFvMesh: attached!" <<
endl;
255 Info <<
"linearValveFvMesh: detached!" <<
endl;
265 Foam::linearValveFvMesh::linearValveFvMesh(
const IOobject& io)
280 ).subDict(typeName +
"Coeffs")
284 addZonesAndModifiers();
301 Info <<
"Decoupling sliding interfaces" <<
endl;
309 msPtr_->updateMesh();
313 Info <<
"Sliding interfaces decoupled" <<
endl;
321 setMorphTimeIndex(3*time().
timeIndex() + 1);
324 msPtr_->updateMesh();
326 if (topoChangeMap.valid())
328 if (topoChangeMap().hasMotionPoints())
330 Info <<
"Topology change; executing pre-motion" <<
endl;
331 movePoints(topoChangeMap().preMotionPoints());
338 movePoints(msPtr_->curPoints());
341 Info <<
"Coupling sliding interfaces" <<
endl;
344 setMorphTimeIndex(3*time().
timeIndex() + 2);
347 Info <<
"Moving points post slider attach" <<
endl;
349 msPtr_->updateMesh();
351 Info <<
"Sliding interfaces coupled: " << attached() <<
endl;