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()
193 topoChanges[modI].enable();
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()
219 topoChanges[modI].disable();
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
264 <<
"Slider " << modI <<
" named "
265 << topoChanges[modI].name()
266 <<
" out of sync: Should be" << result
276Foam::tmp<Foam::pointField> Foam::linearValveLayersFvMesh::newPoints()
const
279 auto& np = tnewPoints();
281 const word layerPatchName
283 motionDict_.subDict(
"layer").get<
word>(
"patch")
288 const labelList& patchPoints = layerPatch.meshPoints();
292 motionDict_.get<
vector>(
"pistonVelocity")
297 np[patchPoints[ppI]] += vel*time().deltaTValue();
308Foam::linearValveLayersFvMesh::linearValveLayersFvMesh(
const IOobject&
io)
322 ).optionalSubDict(
typeName +
"Coeffs")
325 addZonesAndModifiers();
341 Info<<
"Decoupling sliding interfaces" <<
endl;
351 Info<<
"Sliding interfaces decoupled" <<
endl;
359 setMorphTimeIndex(3*time().
timeIndex() + 1);
364 if (topoChangeMap().hasMotionPoints())
366 Info<<
"Topology change; executing pre-motion" <<
endl;
367 movePoints(topoChangeMap().preMotionPoints());
372 movePoints(newPoints());
375 Info<<
"Coupling sliding interfaces" <<
endl;
380 setMorphTimeIndex(3*time().
timeIndex() + 2);
387 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
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
static dictionary readContents(const IOobject &io)
Read and return contents, testing for "dictionary" type. The IOobject will not be registered.
@ MUST_READ
Reading required.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
label size() const noexcept
The number of entries in the list.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
const Time & time() const
Return the top-level database.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
virtual void movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
A sliding linear valve with layers.
virtual ~linearValveLayersFvMesh()
Destructor.
virtual bool update()
Update the mesh for both mesh motion and topology change.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
void addZones(PtrList< pointZone > &&pz, PtrList< faceZone > &&fz, PtrList< cellZone > &&cz)
Add mesh zones.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
A patch is a list of labels that address the faces in the global face list.
List of mesh modifiers defining the mesh dynamics.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Abstract base class for a topology changing fvMesh.
polyTopoChanger topoChanger_
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define InfoInFunction
Report an information message using Foam::Info.
Different types of constants.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define forAll(list, i)
Loop across all elements in list.