54void Foam::linearValveLayersFvMesh::addZonesAndModifiers()
67 <<
"Zones and modifiers already present. Skipping."
74 <<
"Adding zones and modifiers to the mesh" <<
endl;
77 List<pointZone*> pz(1);
78 List<faceZone*> fz(4);
79 List<cellZone*> cz(0);
83 pz[0] =
new pointZone(
"cutPointZone", 0,
pointZones());
89 const word innerSliderName
91 motionDict_.
subDict(
"slider").
get<word>(
"inside")
93 const polyPatch& innerSlider =
boundaryMesh()[innerSliderName];
105 const word outerSliderName
107 motionDict_.
subDict(
"slider").
get<word>(
"outside")
109 const polyPatch& outerSlider =
boundaryMesh()[outerSliderName];
121 fz[2] =
new faceZone(
"cutFaceZone", 2,
faceZones());
124 const word layerPatchName
126 motionDict_.
subDict(
"layer").
get<word>(
"patch")
129 const polyPatch& layerPatch =
boundaryMesh()[layerPatchName];
142 Info<<
"Adding point and face zones" <<
endl;
147 List<polyMeshModifier*> tm(2);
149 tm[0] =
new slidingInterface
154 outerSliderName +
"Zone",
155 innerSliderName +
"Zone",
165 new layerAdditionRemoval
171 motionDict_.
subDict(
"layer").
get<scalar>(
"minThickness"),
172 motionDict_.
subDict(
"layer").
get<scalar>(
"maxThickness")
176 Info<<
"Adding topology modifiers" <<
endl;
177 addTopologyModifiers(tm);
184void Foam::linearValveLayersFvMesh::makeLayersLive()
186 const polyTopoChanger& topoChanges = topoChanger_;
191 if (isA<layerAdditionRemoval>(topoChanges[modI]))
193 topoChanges[modI].enable();
195 else if (isA<slidingInterface>(topoChanges[modI]))
197 topoChanges[modI].disable();
202 <<
"Don't know what to do with mesh modifier "
203 << modI <<
" of type " << topoChanges[modI].type()
210void Foam::linearValveLayersFvMesh::makeSlidersLive()
212 const polyTopoChanger& topoChanges = topoChanger_;
217 if (isA<layerAdditionRemoval>(topoChanges[modI]))
219 topoChanges[modI].disable();
221 else if (isA<slidingInterface>(topoChanges[modI]))
223 topoChanges[modI].enable();
228 <<
"Don't know what to do with mesh modifier "
229 << modI <<
" of type " << topoChanges[modI].type()
236bool Foam::linearValveLayersFvMesh::attached()
const
238 const polyTopoChanger& topoChanges = topoChanger_;
244 if (isA<slidingInterface>(topoChanges[modI]))
248 || refCast<const slidingInterface>(topoChanges[modI]).attached();
255 if (isA<slidingInterface>(topoChanges[modI]))
260 != refCast<const slidingInterface>(topoChanges[modI]).attached()
264 <<
"Slider " << modI <<
" named "
265 << topoChanges[modI].name()
266 <<
" out of sync: Should be" << result
278 tmp<pointField> tnewPoints
285 const word layerPatchName
287 motionDict_.subDict(
"layer").get<word>(
"patch")
290 const polyPatch& layerPatch = boundaryMesh()[layerPatchName];
292 const labelList& patchPoints = layerPatch.meshPoints();
296 motionDict_.get<
vector>(
"pistonVelocity")
301 np[patchPoints[ppI]] += vel*time().deltaTValue();
328 ).optionalSubDict(typeName +
"Coeffs")
331 addZonesAndModifiers();
347 Info<<
"Decoupling sliding interfaces" <<
endl;
357 Info<<
"Sliding interfaces decoupled" <<
endl;
365 setMorphTimeIndex(3*time().
timeIndex() + 1);
370 if (topoChangeMap().hasMotionPoints())
372 Info<<
"Topology change; executing pre-motion" <<
endl;
373 movePoints(topoChangeMap().preMotionPoints());
378 movePoints(newPoints());
381 Info<<
"Coupling sliding interfaces" <<
endl;
386 setMorphTimeIndex(3*time().
timeIndex() + 2);
393 Info<<
"Sliding interfaces coupled: " << attached() <<
endl;
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,...
static word timeName(const scalar t, const int precision=precision_)
label size() const noexcept
The number of elements in the list.
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.
const Time & time() const
Return the top-level database.
A sliding linear valve with layers.
virtual ~linearValveLayersFvMesh()
Destructor.
virtual bool update()
Update the mesh for both mesh motion and topology change.
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.
A class for managing temporary objects.
Abstract base class for a topology changing fvMesh.
polyTopoChanger topoChanger_
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#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 InfoInFunction
Report an information message using Foam::Info.
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.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vectorField pointField
pointField is a vectorField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
#define forAll(list, i)
Loop across all elements in list.