34 namespace fvMeshMovers
51 conRodLength_(
"conRodLength",
dimLength, meshCoeffs_),
53 stroke_(
"stroke",
dimLength, meshCoeffs_),
54 clearance_(
"clearance",
dimLength, meshCoeffs_),
57 cylinderHeadIndex_(-1),
58 deckHeight_(
"deckHeight",
dimLength, great),
59 pistonPosition_(
"pistonPosition",
dimLength, -great)
61 bool foundPiston =
false;
62 bool foundLiner =
false;
63 bool foundCylinderHead =
false;
67 if (mesh.
boundary()[i].name() ==
"piston")
72 else if (mesh.
boundary()[i].name() ==
"liner")
77 else if (mesh.
boundary()[i].name() ==
"cylinderHead")
80 foundCylinderHead =
true;
91 <<
"cannot find piston patch" 98 <<
"cannot find liner patch" 102 if (!foundCylinderHead)
105 <<
"cannot find cylinderHead patch" 201 "pistonDisplacement",
virtual scalar deltaTheta() const
Return crank-angle increment.
dimensionedScalar pistonDisplacement() const
Return piston displacement for current time step.
engine(fvMesh &mesh)
Construct from fvMesh.
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar pistonSpeed() const
Return piston speed for current time step.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Unit conversion functions.
To & refCast(From &r)
Reference type cast template function.
virtual ~engine()
Destructor.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Abstract base class for fvMesh movers.
dimensionedScalar conRodLength_
Optional engine geometry parameters.
dimensionedScalar pistonPosition_
const Time & time() const
Return the top-level database.
dimensionedScalar pistonPosition() const
Return current piston position.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
const dimensionSet dimLength
scalar userTimeValue() const
Return current user time value.
dimensionedScalar deckHeight_
defineTypeNameAndDebug(none, 0)
dimensionedScalar cos(const dimensionedScalar &ds)
const Type & value() const
Return const reference to value.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar clearance_
virtual scalar theta() const
Return current crank-angle.
dimensionedScalar sin(const dimensionedScalar &ds)
const dimensionSet dimVelocity
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
label size() const
Return the number of elements in the UPtrList.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
Basic mesh motion specifically for engines.
fvMesh & mesh()
Return the fvMesh.
scalar timeToUserTime(const scalar t) const
Convert the real-time (s) into user-time (e.g. CA deg)
An abstract class for the user time description.
dimensionedScalar stroke_
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.