44 sixDoFRigidBodyMotionSolver,
52 Foam::sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver
64 "sixDoFRigidBodyMotionState",
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()
164 return points0() + pointDisplacement_.primitiveField();
175 <<
"The number of points in the mesh seems to have changed." <<
endl 176 <<
"In constant/polyMesh there are " << points0().size()
177 <<
" points; in the current mesh there are " <<
mesh().
nPoints()
182 bool firstIter =
false;
183 if (curTimeIndex_ != this->db().time().
timeIndex())
186 curTimeIndex_ = this->db().time().timeIndex();
192 if (db().foundObject<uniformDimensionedVectorField>(
"g"))
196 else if (coeffDict().found(
"g"))
198 coeffDict().lookup(
"g") >>
g;
209 ramp*(motion_.mass()*g.
value()),
210 ramp*(motion_.mass()*(motion_.momentArm() ^ g.
value())),
219 forcesDict.
add(
"type", functionObjects::forces::typeName);
220 forcesDict.
add(
"patches", patches_);
221 forcesDict.
add(
"rhoInf", rhoInf_);
222 forcesDict.
add(
"rho", rhoName_);
223 forcesDict.
add(
"CofR", motion_.centreOfRotation());
236 + motion_.mass()*(motion_.momentArm() ^ g.
value())
244 pointDisplacement_.primitiveFieldRef() =
245 motion_.transform(points0(), scale_) - points0();
250 pointDisplacement_.mesh()
251 ).constrainDisplacement(pointDisplacement_);
266 "sixDoFRigidBodyMotionState",
276 motion_.state().write(dict);
277 return dict.regIOobject::write();
285 motion_.read(coeffDict());
const Time & time() const
Return time.
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.
virtual vector forceEff() const
Return the total force.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
scalar deltaT0Value() const
Return old time step value.
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.
const Type & value() const
Return const reference to value.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
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.
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
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.
const dimensionSet dimAcceleration
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar cos(const dimensionedScalar &ds)
A class for handling words, derived from string.
Calculation of distance to nearest patch for all points.
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 succesful.
virtual bool read()
Read dynamicMeshDict dictionary.
compressionType
Enumeration for the format of data in the stream.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
const dimensionedVector & g
defineTypeNameAndDebug(combustionModel, 0)
scalar deltaTValue() const
Return time step value.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual vector momentEff() const
Return the total moment.
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.
This function object calculates the forces and moments by integrating the pressure and skin-friction ...
A class for managing temporary objects.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write state using given format, version and compression.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const Time & time() const
Return the top-level database.