Calculates the forces and moments by integrating the pressure and skin-friction forces over a given list of patches. More...
#include <forces/forces.H>
Calculates the forces and moments by integrating the pressure and skin-friction forces over a given list of patches.
Member function calcForcesMoment()calculates and returns the forces and moments.
Member function forces::write() calls calcForcesMoment() and writes the forces and moments into the file <timeDir>/forces.dat
Inheritance diagram for forces:
Collaboration diagram for forces:Classes | |
| class | sumOp |
| Sum operation class to accumulate the pressure, viscous forces and moments. More... | |
Public Types | |
| typedef Tuple2< vector, vector > | pressureViscous |
| typedef Tuple2 < pressureViscous, pressureViscous > | forcesMoments |
Public Member Functions | |
| TypeName ("forces") | |
| Runtime type information. | |
| forces (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false) | |
| Construct for given objectRegistry and dictionary. | |
| virtual | ~forces () |
| Destructor. | |
| virtual const word & | name () const |
| Return name of the set of forces. | |
| virtual void | read (const dictionary &) |
| Read the forces data. | |
| virtual void | execute () |
| Execute, currently does nothing. | |
| virtual void | end () |
| Execute at the final time-loop, currently does nothing. | |
| virtual void | write () |
| Write the forces. | |
| virtual forcesMoments | calcForcesMoment () const |
| Calculate and return forces and moment. | |
| virtual void | updateMesh (const mapPolyMesh &) |
| Update for changes of mesh. | |
| virtual void | movePoints (const pointField &) |
| Update for changes of mesh. | |
Protected Member Functions | |
| void | makeFile () |
| If the forces file has not been created create it. | |
| virtual void | writeFileHeader () |
| Output file header information. | |
| tmp< volSymmTensorField > | devRhoReff () const |
| Return the effective viscous stress (laminar + turbulent). | |
| tmp< volScalarField > | rho () const |
| Return rho if rhoName is specified otherwise rhoRef. | |
| scalar | rho (const volScalarField &p) const |
| Return rhoRef if the pressure field is dynamic, i.e. p/rho. | |
| forces (const forces &) | |
| Disallow default bitwise copy construct. | |
| void | operator= (const forces &) |
| Disallow default bitwise assignment. | |
Protected Attributes | |
| word | name_ |
| Name of this set of forces,. | |
| const objectRegistry & | obr_ |
| bool | active_ |
| on/off switch | |
| Switch | log_ |
| Switch to send output to Info as well as to file. | |
| labelHashSet | patchSet_ |
| Patches to integrate forces over. | |
| word | pName_ |
| Name of pressure field. | |
| word | UName_ |
| Name of velocity field. | |
| word | rhoName_ |
| Name of density field (optional) | |
| Switch | directForceDensity_ |
| Is the force density being supplied directly? | |
| word | fDName_ |
| The name of the force density (fD) field. | |
| scalar | rhoRef_ |
| Reference density needed for incompressible calculations. | |
| scalar | pRef_ |
| Reference pressure. | |
| vector | CofR_ |
| Centre of rotation. | |
| autoPtr< OFstream > | forcesFilePtr_ |
| Forces/moment file ptr. | |
| typedef Tuple2<pressureViscous, pressureViscous> forcesMoments |
| forces | ( | const word & | name, |
| const objectRegistry & | obr, | ||
| const dictionary & | dict, | ||
| const bool | loadFromFiles = false |
||
| ) |
Construct for given objectRegistry and dictionary.
Allow the possibility to load fields from files
Definition at line 174 of file forces.C.
References Foam::endl(), and WarningIn.
|
protected |
If the forces file has not been created create it.
Definition at line 302 of file forces.C.
References Foam::endl(), Foam::Info, Pstream::master(), Foam::mkDir(), Pstream::parRun(), fileName::path(), and Foam::type().
|
protectedvirtual |
Output file header information.
Reimplemented in forceCoeffs.
Definition at line 343 of file forces.C.
References Foam::endl(), and Foam::tab.
|
protected |
Return the effective viscous stress (laminar + turbulent).
Definition at line 49 of file forces.C.
References Foam::dev(), Foam::exit(), Foam::FatalError, FatalErrorIn, objectRegistry::foundObject(), Foam::fvc::grad(), dictionary::lookup(), objectRegistry::lookupObject(), basicThermo::mu(), nu, singlePhaseTransportModel::nu(), GeometricField< symmTensor, fvPatchField, volMesh >::null(), forces::obr_, RASModel(), forces::rho(), thermo, transportProperties(), Foam::twoSymm(), U, and forces::UName_.
|
protected |
Return rho if rhoName is specified otherwise rhoRef.
Definition at line 123 of file forces.C.
References Foam::dimDensity, mesh, fvMesh::time(), and Time::timeName().
Referenced by forces::devRhoReff().
|
protected |
Return rhoRef if the pressure field is dynamic, i.e. p/rho.
otherwise return 1
Definition at line 151 of file forces.C.
References DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimPressure, Foam::exit(), Foam::FatalError, and FatalErrorIn.
|
protected |
Disallow default bitwise assignment.
| TypeName | ( | "forces" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the set of forces.
Definition at line 208 of file forces.H.
References forces::name_.
|
virtual |
Read the forces data.
Reimplemented in forceCoeffs.
Definition at line 225 of file forces.C.
References polyMesh::boundaryMesh(), Foam::endl(), Foam::Info, dictionary::lookup(), dictionary::lookupOrDefault(), mesh, Foam::nl, polyBoundaryMesh::patchSet(), dictionary::readIfPresent(), Foam::readScalar(), and WarningIn.
Referenced by forceCoeffs::read().
|
virtual |
Execute, currently does nothing.
Reimplemented in forceCoeffs.
|
virtual |
Execute at the final time-loop, currently does nothing.
Reimplemented in forceCoeffs.
|
virtual |
Write the forces.
Reimplemented in forceCoeffs.
Definition at line 367 of file forces.C.
References Foam::endl(), Tuple2< Type1, Type2 >::first(), Foam::Info, Pstream::master(), Foam::nl, Tuple2< Type1, Type2 >::second(), and Foam::tab.
|
virtual |
Calculate and return forces and moment.
Definition at line 392 of file forces.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), Tuple2< Type1, Type2 >::first(), forAllConstIter, Foam::mag(), mesh, DimensionedField< Type, GeoMesh >::mesh(), p, patchi, Foam::reduce(), rho, Tuple2< Type1, Type2 >::second(), Foam::sum(), U, and Vector< scalar >::zero.
Referenced by sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), and forceCoeffs::write().
|
inlinevirtual |
|
inlinevirtual |
|
protected |
Name of this set of forces,.
Also used as the name of the probes directory.
Definition at line 113 of file forces.H.
Referenced by forces::name().
|
protected |
Definition at line 115 of file forces.H.
Referenced by forces::devRhoReff().
|
protected |
|
protected |
|
protected |
Name of velocity field.
Definition at line 132 of file forces.H.
Referenced by forces::devRhoReff().
|
protected |
|
protected |
|
protected |