39 Foam::scalar Foam::fvMeshMovers::multiValveEngine::pistonObject::bore()
const
50 if (pbm[
patchi].localPoints().size())
52 pistonMax =
max(pistonMax,
max(pbm[
patchi].localPoints()));
53 pistonMin =
min(pistonMin,
min(pbm[
patchi].localPoints()));
57 reduce(pistonMax, maxOp<point>());
58 reduce(pistonMin, minOp<point>());
64 (pistonMax - (
axis& pistonMax)*pistonMax)
65 - (pistonMin - (
axis& pistonMin)*pistonMin)
70 void Foam::fvMeshMovers::multiValveEngine::pistonObject::correctClearance
79 const polyPatch& pp = meshMover_.mesh().boundaryMesh()[iter.key()];
80 const labelList& meshPoints = pp.meshPoints();
84 clearance_ =
min(clearance_, pDist[meshPoints[pointi]]);
88 reduce(clearance_, minOp<scalar>());
114 return motion_->value(theta);
121 return position(meshMover_.userTime());
129 position(meshMover_.userTime() - meshMover_.userDeltaT())
136 return displacement()/(meshMover_.mesh().time().deltaTValue() + vSmall);
143 if (
mag(position() - position0_) > travelInterval_)
152 return clearance_ - displacement();
162 const scalar position = this->position();
168 ||
mag(position - position0_) > travelInterval_
171 Info <<
" Updating scale field" <<
endl;
195 correctClearance(pDistMoving);
202 movingFrozenLayerThickness_,
204 staticFrozenLayerThickness_
207 position0_ = position;
210 const vector translationVector(displacement()*axis);
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static pointMesh & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const dictionary & dict() const
Return the dynamicMeshDict/mover dict.
fvMesh & mesh()
Return the fvMesh.
const multiValveEngine & meshMover_
Reference to engine mesh mover.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
const labelHashSet & patchSet
Object patchSet.
pistonObject(const word &name, const multiValveEngine &engine, const dictionary &dict)
Construct from dictionary.
static word pistonBowlName
Name of the piston bowl pointZone.
scalar position() const
Return the current piston position.
scalar clearance() const
Return clearance estimate.
scalar displacement() const
Return piston displacement for current time-step.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
void updatePoints(pointField &)
update points due to piston motion
scalar speed() const
Return piston position for current time-step.
A mesh mover using explicit node translation based on scaled distance functions per moving object....
Calculates the distance to the specified sets of patch and pointZone points or for all points.
Mesh representing a set of points created from polyMesh.
Class containing mesh-to-mesh mapping information.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A class for handling words, derived from string.
List< label > labelList
A List of labels.
void transformPoints(vectorField &, const spatialTransform &, const vectorField &)
Transform given vectorField of coordinates with the given spatialTransform.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.