67 "sixDoFRigidBodyMotionState",
76 "sixDoFRigidBodyMotionState",
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 cOfGdisplacement_(coeffDict().getOrDefault<
word>(
"cOfGdisplacement",
"none"))
112 if (rhoName_ ==
"rhoInf")
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())),
241 forcesDict.
add(
"patches", patches_);
242 forcesDict.
add(
"rhoInf", rhoInf_);
243 forcesDict.
add(
"rho", rhoName_);
244 forcesDict.
add(
"CofR", motion_.centreOfRotation());
246 vector oldPos = motion_.centreOfRotation();
250 f.calcForcesMoments();
255 ramp*(
f.forceEff() + motion_.mass()*
g.
value()),
259 + motion_.mass()*(motion_.momentArm() ^
g.
value())
265 if (cOfGdisplacement_ !=
"none")
269 db().time().foundObject<uniformDimensionedVectorField>
281 disp += (motion_.centreOfRotation() - oldPos);
287 pointDisplacement_.primitiveFieldRef() =
293 pointDisplacement_.mesh()
294 ).constrainDisplacement(pointDisplacement_);
308 "sixDoFRigidBodyMotionState",
318 motion_.state().write(
dict);
319 return dict.regIOobject::write();
327 motion_.read(coeffDict());
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
const uniformDimensionedVectorField & g
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
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 Time & time() const
Return Time associated with the objectRegistry.
The IOstreamOption is a simple container for options an IOstream can normally have.
virtual bool read()
Re-read model coefficients if they have changed.
scalar deltaTValue() const noexcept
Return time step value.
scalar deltaT0Value() const noexcept
Return old time step value.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A List with indirect addressing. Like IndirectList but does not store addressing.
void size(const label n)
Older name for setAddressableSize.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
const Type & value() const
Return const reference to value.
bool readIfPresent(const dictionary &dict)
Virtual base class for displacement motion solver.
Computes forces and moments over a given list of patches by integrating pressure and viscous forces a...
const Time & time() const
Return the top-level database.
Virtual base class for mesh motion solver.
const polyMesh & mesh() const
Return reference to mesh.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
const Type & lookupObject(const word &name, const bool recursive=false) const
Mesh representing a set of points created from polyMesh.
Calculation of distance to nearest patch for all points.
pointField & points0() noexcept
Return reference to the reference ('0') pointField.
Mesh consisting of general polyhedral cells.
label nPoints() const noexcept
Number of mesh points.
virtual bool write(const bool valid=true) const
Write using setting from DB.
6-DoF solid-body mesh motion solver for an fvMesh.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
const sixDoFRigidBodyMotion & motion() const
Return the six DoF motion object.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write state using stream options.
virtual void solve()
Solve for motion.
virtual bool read()
Read dynamicMeshDict dictionary.
Six degree of freedom motion for a rigid body.
A class for managing temporary objects.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr scalar pi(M_PI)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
vectorField pointField
pointField is a vectorField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimAcceleration
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar cos(const dimensionedScalar &ds)
static const char *const typeName
The type name used in ensight case files.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, false)))