45 sixDoFRigidBodyMotionSolver,
66 "sixDoFRigidBodyMotionState",
75 "sixDoFRigidBodyMotionState",
87 patchSet_(mesh.boundaryMesh().patchSet(patches_)),
88 di_(coeffDict().
lookup<scalar>(
"innerDistance")),
89 do_(coeffDict().
lookup<scalar>(
"outerDistance")),
90 test_(coeffDict().lookupOrDefault<
Switch>(
"test", false)),
92 rhoName_(coeffDict().lookupOrDefault<
word>(
"rho",
"rho")),
109 if (rhoName_ ==
"rhoInf")
111 rhoInf_ = coeffDict().lookup<scalar>(
"rhoInf");
123 scale_.primitiveFieldRef() =
135 scale_.primitiveFieldRef() =
142 *
cos(scale_.primitiveField()
166 return points0() + pointDisplacement_.primitiveField();
177 <<
"The number of points in the mesh seems to have changed." <<
endl 178 <<
"In constant/polyMesh there are " << points0().size()
179 <<
" points; in the current mesh there are " <<
mesh().
nPoints()
184 bool firstIter =
false;
194 if (
mesh().foundObject<uniformDimensionedVectorField>(
"g"))
198 else if (coeffDict().found(
"g"))
200 coeffDict().lookup(
"g") >>
g;
211 ramp*(mass()*g.
value()),
212 ramp*(mass()*(momentArm() ^ g.
value())),
221 forcesDict.
add(
"type", functionObjects::forces::typeName);
222 forcesDict.
add(
"patches", patches_);
223 forcesDict.
add(
"rhoInf", rhoInf_);
224 forcesDict.
add(
"rho", rhoName_);
225 forcesDict.
add(
"CofR", centreOfRotation());
238 + mass()*(momentArm() ^ g.
value())
246 pointDisplacement_.primitiveFieldRef() =
247 transform(points0(), scale_) - points0();
252 pointDisplacement_.mesh()
253 ).constrainDisplacement(pointDisplacement_);
263 "sixDoFRigidBodyMotionState",
276 dict.regIOobject::writeObject
280 mesh().time().writeCompression(),
Six degree of freedom motion for a rigid body.
virtual vector momentEff() const
Return the total moment.
virtual bool write() const
Write motion state information for restart.
Virtual base class for displacement motion solver.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Templated form of IOobject providing type information for file reading and header type checking...
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/any.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
virtual vector forceEff() const
Return the total force.
const dimensionSet dimless
const Time & time() const
Return the top-level database.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
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.
virtual bool write() const
Write points0 if the mesh topology changed.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Mesh representing a set of points created from polyMesh.
sixDoFRigidBodyMotionSolver(const word &name, const polyMesh &, const dictionary &dict)
Construct from polyMesh and dictionary.
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar cos(const dimensionedScalar &ds)
const dimensionSet dimAcceleration
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
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.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
virtual void calcForcesMoment()
Calculate the forces and moments.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const Time & time() const
Return time.
defineTypeNameAndDebug(combustionModel, 0)
static pointMesh & New(polyMesh &mesh)
virtual void solve()
Solve for motion.
timeIOdictionary derived from IOdictionary with globalFile set false to enable writing to processor t...
label timeIndex() const
Return current time index.
static const versionNumber currentVersion
Current version number.
~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.
dimensionSet transform(const dimensionSet &)