43 linearValveLayersFvMesh,
51 void Foam::linearValveLayersFvMesh::addZonesAndModifiers()
60 || topoChanger_.size()
64 <<
"Zones and modifiers already present. Skipping." 70 Info<<
"Time = " << time().timeName() << endl
71 <<
"Adding zones and modifiers to the mesh" <<
endl;
74 List<pointZone*> pz(1);
75 List<faceZone*> fz(4);
76 List<cellZone*> cz(0);
93 const word innerSliderName(motionDict_.subDict(
"slider").lookup(
"inside"));
94 const polyPatch& innerSlider = boundaryMesh()[innerSliderName];
100 isf[i] = innerSlider.start() + i;
107 boolList(innerSlider.size(),
false),
113 const word outerSliderName(motionDict_.subDict(
"slider").lookup(
"outside"));
114 const polyPatch& outerSlider = boundaryMesh()[outerSliderName];
120 osf[i] = outerSlider.start() + i;
127 boolList(outerSlider.size(),
false),
143 const word layerPatchName
145 motionDict_.subDict(
"layer").lookup(
"patch")
148 const polyPatch& layerPatch = boundaryMesh()[layerPatchName];
154 lpf[i] = layerPatch.start() + i;
167 Info<<
"Adding point and face zones" <<
endl;
168 addZones(pz, fz, cz);
172 List<polyMeshModifier*> tm(2);
174 tm[0] =
new slidingInterface
179 outerSliderName +
"Zone",
180 innerSliderName +
"Zone",
190 new layerAdditionRemoval
198 motionDict_.subDict(
"layer").lookup(
"minThickness")
202 motionDict_.subDict(
"layer").lookup(
"maxThickness")
207 Info<<
"Adding topology modifiers" <<
endl;
208 addTopologyModifiers(tm);
215 void Foam::linearValveLayersFvMesh::makeLayersLive()
217 const polyTopoChanger& topoChanges = topoChanger_;
222 if (isA<layerAdditionRemoval>(topoChanges[modI]))
224 topoChanges[modI].enable();
226 else if (isA<slidingInterface>(topoChanges[modI]))
228 topoChanges[modI].disable();
233 <<
"Don't know what to do with mesh modifier " 234 << modI <<
" of type " << topoChanges[modI].type()
241 void Foam::linearValveLayersFvMesh::makeSlidersLive()
243 const polyTopoChanger& topoChanges = topoChanger_;
248 if (isA<layerAdditionRemoval>(topoChanges[modI]))
250 topoChanges[modI].disable();
252 else if (isA<slidingInterface>(topoChanges[modI]))
254 topoChanges[modI].enable();
259 <<
"Don't know what to do with mesh modifier " 260 << modI <<
" of type " << topoChanges[modI].type()
267 bool Foam::linearValveLayersFvMesh::attached()
const 269 const polyTopoChanger& topoChanges = topoChanger_;
275 if (isA<slidingInterface>(topoChanges[modI]))
279 || refCast<const slidingInterface>(topoChanges[modI]).attached();
286 if (isA<slidingInterface>(topoChanges[modI]))
291 != refCast<const slidingInterface>(topoChanges[modI]).attached()
295 <<
"Slider " << modI <<
" named " 296 << topoChanges[modI].name()
297 <<
" out of sync: Should be" << result
309 tmp<pointField> tnewPoints
316 const word layerPatchName
318 motionDict_.subDict(
"layer").lookup(
"patch")
321 const polyPatch& layerPatch = boundaryMesh()[layerPatchName];
323 const labelList& patchPoints = layerPatch.meshPoints();
327 motionDict_.lookup(
"pistonVelocity")
332 np[patchPoints[ppI]] += vel*time().deltaTValue();
343 Foam::linearValveLayersFvMesh::linearValveLayersFvMesh(
const IOobject& io)
359 ).optionalSubDict(typeName +
"Coeffs")
362 addZonesAndModifiers();
378 Info<<
"Decoupling sliding interfaces" <<
endl;
388 Info<<
"Sliding interfaces decoupled" <<
endl;
399 if (topoChangeMap.valid())
401 if (topoChangeMap().hasMotionPoints())
403 Info<<
"Topology change; executing pre-motion" <<
endl;
404 movePoints(topoChangeMap().preMotionPoints());
412 Info<<
"Coupling sliding interfaces" <<
endl;
424 Info<<
"Sliding interfaces coupled: " << attached() <<
endl;
virtual bool update()
Update the mesh for both mesh motion and topology change.
#define forAll(list, i)
Loop across all elements in list.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool movePoints()
Do what is neccessary if the mesh has moved.
Vector< scalar > vector
A scalar version of the templated Vector.
const Time & time() const
Return the top-level database.
Macros for easy insertion into run-time selection tables.
virtual ~linearValveLayersFvMesh()
Destructor.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
List< bool > boolList
Bool container classes.
vectorField pointField
pointField is a vectorField.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
Abstract base class for a topology changing fvMesh.
List< label > labelList
A List of labels.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
errorManip< error > abort(error &err)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
Constant dispersed-phase particle diameter model.
A class for managing temporary objects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
#define InfoInFunction
Report an information message using Foam::Info.