44 sixDoFRigidBodyMotionSolver,
52 Foam::sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver
64 "sixDoFRigidBodyMotionState",
68 ).typeHeaderOk<IOdictionary>(
true)
73 "sixDoFRigidBodyMotionState",
88 test_(coeffDict().lookupOrDefault<
Switch>(
"test", false)),
90 rhoName_(coeffDict().lookupOrDefault<
word>(
"rho",
"rho")),
107 if (rhoName_ ==
"rhoInf")
121 scale_.primitiveFieldRef() =
133 scale_.primitiveFieldRef() =
140 *
cos(scale_.primitiveField()
171 return points0() + pointDisplacement_.primitiveField();
182 <<
"The number of points in the mesh seems to have changed." <<
endl 183 <<
"In constant/polyMesh there are " << points0().size()
184 <<
" points; in the current mesh there are " <<
mesh().
nPoints()
189 bool firstIter =
false;
190 if (curTimeIndex_ != this->db().time().
timeIndex())
193 curTimeIndex_ = this->db().time().timeIndex();
199 if (db().foundObject<uniformDimensionedVectorField>(
"g"))
203 else if (coeffDict().found(
"g"))
205 coeffDict().lookup(
"g") >>
g;
216 ramp*(motion_.mass()*g.
value()),
217 ramp*(motion_.mass()*(motion_.momentArm() ^ g.
value())),
226 forcesDict.
add(
"type", functionObjects::forces::typeName);
227 forcesDict.
add(
"patches", patches_);
228 forcesDict.
add(
"rhoInf", rhoInf_);
229 forcesDict.
add(
"rho", rhoName_);
230 forcesDict.
add(
"CofR", motion_.centreOfRotation());
243 + motion_.mass()*(motion_.momentArm() ^ g.
value())
251 pointDisplacement_.primitiveFieldRef() =
252 motion_.transform(points0(), scale_) - points0();
257 pointDisplacement_.mesh()
258 ).constrainDisplacement(pointDisplacement_);
274 "sixDoFRigidBodyMotionState",
284 motion_.state().write(dict);
285 return dict.regIOobject::write();
293 motion_.read(coeffDict());
Six degree of freedom motion for a rigid body.
virtual vector momentEff() const
Return the total moment.
Virtual base class for displacement motion solver.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
virtual vector forceEff() const
Return the total force.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const Time & time() const
Return the top-level database.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
static const pointMesh & New(const polyMesh &mesh)
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Mesh representing a set of points created from polyMesh.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool valid) const
Write state using given format, version and compression.
const dimensionSet dimAcceleration
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar cos(const dimensionedScalar &ds)
scalar deltaT0Value() const
Return old time step value.
A class for handling words, derived from string.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
Calculation of distance to nearest patch for all points.
scalar deltaTValue() const
Return time step value.
const Type & value() const
Return const reference to value.
streamFormat
Enumeration for the format of data in the stream.
virtual void calcForcesMoment()
Calculate the forces and moments.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
virtual bool read()
Read dynamicMeshDict dictionary.
compressionType
Enumeration for the format of data in the stream.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const Time & time() const
Return time.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual void solve()
Solve for motion.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
virtual bool read()
Read dynamicMeshDict dictionary.
~sixDoFRigidBodyMotionSolver()
Destructor.
Mesh consisting of general polyhedral cells.
Calculates the forces and moments by integrating the pressure and skin-friction forces over a given l...
A class for managing temporary objects.
const dimensionedVector & g
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
const sixDoFRigidBodyMotion & motion() const
Return the six DoF motion object.