39 void Foam::fvMeshMovers::multiValveEngine::pistonObject::calculateBore()
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>());
62 pistonMax -= (
axis & pistonMax)*
axis;
63 pistonMin -= (
axis & pistonMin)*
axis;
65 bore_ =
mag(pistonMax - pistonMin)/
sqrt(2.0);
66 centre_ = (pistonMax + pistonMin)/2;
70 void Foam::fvMeshMovers::multiValveEngine::pistonObject::correctClearance()
72 const polyBoundaryMesh& pbm = meshMover_.mesh().poly().boundary();
75 scalar linerMax(-great);
76 scalar linerMin(great);
81 if (pbm[
patchi].localPoints().size())
83 linerMax =
max(linerMax, axis &
max(pbm[
patchi].localPoints()));
84 linerMin =
min(linerMin, axis &
min(pbm[
patchi].localPoints()));
88 reduce(linerMax, maxOp<scalar>());
89 reduce(linerMin, minOp<scalar>());
91 clearance_ = linerMax - linerMin;
130 return motion_->value(theta);
137 return position(meshMover_.userTime());
145 position(meshMover_.userTime() - meshMover_.userDeltaT())
152 return displacement()/(meshMover_.mesh().time().deltaTValue() + vSmall);
159 if (
mag(
position() - position0_) > travelInterval_)
168 return clearance_ - displacement();
187 Info <<
" Updating scale field" <<
endl;
222 movingFrozenLayerThickness_,
224 staticFrozenLayerThickness_
230 const vector translationVector(displacement()*axis);
#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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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 bore() const
Return the bore.
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.
vector centre() const
Return the piston centre.
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....
const polyMesh & poly() const
Return reference to polyMesh.
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 & boundary() const
Return boundary mesh.
A class for handling words, derived from string.
point position(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the position given the coordinates and tet topology.
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.
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)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)