47 sixDoFRigidBodyMotionSolver,
55 Foam::sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver
67 "sixDoFRigidBodyMotionState",
76 "sixDoFRigidBodyMotionState",
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")
123 pointPatchDist pDist(pMesh, patchSet_,
points0());
131 (do_ - pDist.primitiveField())/(do_ - di_),
171 points0() + pointDisplacement_.primitiveField()
177 auto& transformedPts = ttransformedPts.ref();
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());
246 vector oldPos = motion_.centreOfRotation();
248 functionObjects::forces
f(
"forces", db(), forcesDict);
250 f.calcForcesMoments();
255 ramp*(
f.forceEff() + motion_.mass()*
g.
value()),
259 + motion_.mass()*(motion_.momentArm() ^
g.
value())
265 if (cOfGdisplacement_ !=
"none")
281 disp += (motion_.centreOfRotation() - oldPos);
287 pointDisplacement_.primitiveFieldRef() =
293 pointDisplacement_.mesh()
294 ).constrainDisplacement(pointDisplacement_);
301 const bool writeOnProc
308 "sixDoFRigidBodyMotionState",
318 motion_.state().write(
dict);
319 return dict.regIOobject::writeObject(streamOpt, writeOnProc);
327 motion_.read(coeffDict());
Six degree of freedom motion for a rigid body.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
const Type & value() const noexcept
Return const reference to value.
void size(const label n)
Older name for setAddressableSize.
Virtual base class for displacement motion solver.
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UniformDimensionedField< vector > uniformDimensionedVectorField
label nPoints() const noexcept
Number of mesh points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
bool readIfPresent(const dictionary &dict)
Update the value of dimensioned<Type> if found in the dictionary, lookup in dictionary with the name(...
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
A simple container for options an IOstream can normally have.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
const Time & time() const
Return the top-level database.
Macros for easy insertion into run-time selection tables.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Mesh representing a set of points created from polyMesh.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
const dimensionSet dimAcceleration
vectorField pointField
pointField is a vectorField.
dimensionedScalar cos(const dimensionedScalar &ds)
A class for handling words, derived from Foam::string.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
A List of wordRe with additional matching capabilities.
constexpr scalar pi(M_PI)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
const Time & time() const noexcept
Return Time associated with the objectRegistry.
virtual bool read()
Read dynamicMeshDict dictionary.
const uniformDimensionedVectorField & g
defineTypeNameAndDebug(combustionModel, 0)
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write state using stream options.
virtual void solve()
Solve for motion.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
A List with indirect addressing. Like IndirectList but does not store addressing. ...
virtual bool read()
Read dynamicMeshDict dictionary.
pointField & points0() noexcept
Return reference to the reference ('0') pointField.
Mesh consisting of general polyhedral cells.
const polyMesh & mesh() const
Return reference to mesh.
A class for managing temporary objects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
Do not request registration (bool: false)
const sixDoFRigidBodyMotion & motion() const
Return the six DoF motion object.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)