Go to the documentation of this file.
47 sixDoFRigidBodyMotionSolver,
55 Foam::sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver
67 "sixDoFRigidBodyMotionState",
68 mesh.time().timeName(),
71 ).typeHeaderOk<IOdictionary>(
true)
76 "sixDoFRigidBodyMotionState",
77 mesh.time().timeName(),
80 IOobject::READ_IF_PRESENT,
88 patches_(coeffDict().get<
wordRes>(
"patches")),
90 di_(coeffDict().get<scalar>(
"innerDistance")),
91 do_(coeffDict().get<scalar>(
"outerDistance")),
92 test_(coeffDict().getOrDefault(
"test", false)),
94 rhoName_(coeffDict().getOrDefault<
word>(
"rho",
"rho")),
110 CofGvelocity_(coeffDict().getOrDefault<
word>(
"CofGvelocity",
"none"))
112 if (rhoName_ ==
"rhoInf")
114 coeffDict().
readEntry(
"rhoInf", rhoInf_);
126 scale_.primitiveFieldRef() =
138 scale_.primitiveFieldRef() =
145 *
cos(scale_.primitiveField()
171 points0() + pointDisplacement_.primitiveField()
182 return ttransformedPts;
196 <<
"The number of points in the mesh seems to have changed." <<
endl
197 <<
"In constant/polyMesh there are " <<
points0().size()
198 <<
" points; in the current mesh there are " <<
mesh().
nPoints()
203 bool firstIter =
false;
204 if (curTimeIndex_ != this->db().time().
timeIndex())
207 curTimeIndex_ = this->db().time().timeIndex();
213 if (db().time().foundObject<uniformDimensionedVectorField>(
"g"))
223 const scalar ramp = 1.0;
230 ramp*(motion_.mass()*
g.
value()),
231 ramp*(motion_.mass()*(motion_.momentArm() ^
g.
value())),
240 forcesDict.
add(
"type", functionObjects::forces::typeName);
241 forcesDict.
add(
"patches", patches_);
242 forcesDict.
add(
"rhoInf", rhoInf_);
243 forcesDict.
add(
"rho", rhoName_);
244 forcesDict.
add(
"CofR", motion_.centreOfRotation());
248 f.calcForcesMoment();
253 ramp*(
f.forceEff() + motion_.mass()*
g.
value()),
257 + motion_.mass()*(motion_.momentArm() ^
g.
value())
263 if (CofGvelocity_ !=
"none")
284 pointDisplacement_.primitiveFieldRef() =
290 pointDisplacement_.mesh()
291 ).constrainDisplacement(pointDisplacement_);
305 "sixDoFRigidBodyMotionState",
315 motion_.state().write(
dict);
316 return dict.regIOobject::write();
324 motion_.read(coeffDict());
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
vectorField pointField
pointField is a vectorField.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
Calculates the forces and moments by integrating the pressure and skin-friction forces over a given l...
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
static const pointConstraints & New(const pointMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
const Time & time() const
Return time.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Mesh consisting of general polyhedral cells.
virtual void solve()
Solve for motion.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
bool readIfPresent(const dictionary &dict)
The IOstreamOption is a simple container for options an IOstream can normally have.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
const sixDoFRigidBodyMotion & motion() const
Return the six DoF motion object.
const Type & lookupObject(const word &name, const bool recursive=false) const
virtual bool read()
Read dynamicMeshDict dictionary.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write state using stream options.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Virtual base class for displacement motion solver.
Macros for easy insertion into run-time selection tables.
const uniformDimensionedVectorField & g
Mesh representing a set of points created from polyMesh.
scalar deltaT0Value() const
Return old time step value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionSet dimAcceleration
Type & lookupObjectRef(const word &name, const bool recursive=false) const
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Calculation of distance to nearest patch for all points.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, false)))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Six degree of freedom motion for a rigid body.
constexpr scalar pi(M_PI)
scalar deltaTValue() const
Return time step value.
label nPoints() const
Number of mesh points.
A List of wordRe with additional matching capabilities.
const Time & time() const
Return the top-level database.
virtual bool read()
Read dynamicMeshDict dictionary.
A List with indirect addressing.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
defineTypeNameAndDebug(combustionModel, 0)
dimensionedScalar cos(const dimensionedScalar &ds)