FreeFOAM The Cross-Platform CFD Toolkit
forces Class Reference

Calculates the forces and moments by integrating the pressure and skin-friction forces over a given list of patches. More...

#include <forces/forces.H>


Detailed Description

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

Source files

Definition at line 68 of file forces.H.

+ Inheritance diagram for forces:
+ Collaboration diagram for forces:

List of all members.

Classes

class  sumOp
 Sum operation class to accumulate the pressure, viscous forces and moments. More...

Public Types

typedef Tuple2< vector, vectorpressureViscous
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 wordname () 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< volSymmTensorFielddevRhoReff () const
 Return the effective viscous stress (laminar + turbulent).
tmp< volScalarFieldrho () 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 objectRegistryobr_
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< OFstreamforcesFilePtr_
 Forces/moment file ptr.

Member Typedef Documentation

Definition at line 73 of file forces.H.

Definition at line 77 of file forces.H.


Constructor & Destructor Documentation

forces ( const forces )
protected

Disallow default bitwise copy construct.

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.

~forces ( )
virtual

Destructor.

Definition at line 219 of file forces.C.


Member Function Documentation

void makeFile ( )
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().

void writeFileHeader ( )
protectedvirtual

Output file header information.

Reimplemented in forceCoeffs.

Definition at line 343 of file forces.C.

References Foam::endl(), and Foam::tab.

Foam::tmp< Foam::volScalarField > rho ( ) const
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().

Foam::scalar rho ( const volScalarField p) const
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.

void operator= ( const forces )
protected

Disallow default bitwise assignment.

TypeName ( "forces"  )

Runtime type information.

virtual const word& name ( ) const
inlinevirtual

Return name of the set of forces.

Definition at line 208 of file forces.H.

References forces::name_.

void read ( const dictionary dict)
virtual
void execute ( )
virtual

Execute, currently does nothing.

Reimplemented in forceCoeffs.

Definition at line 355 of file forces.C.

void end ( )
virtual

Execute at the final time-loop, currently does nothing.

Reimplemented in forceCoeffs.

Definition at line 361 of file forces.C.

void write ( )
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 void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 229 of file forces.H.

virtual void movePoints ( const pointField )
inlinevirtual

Update for changes of mesh.

Definition at line 233 of file forces.H.


Member Data Documentation

word name_
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().

const objectRegistry& obr_
protected

Definition at line 115 of file forces.H.

Referenced by forces::devRhoReff().

bool active_
protected

on/off switch

Definition at line 118 of file forces.H.

Switch log_
protected

Switch to send output to Info as well as to file.

Definition at line 121 of file forces.H.

labelHashSet patchSet_
protected

Patches to integrate forces over.

Definition at line 126 of file forces.H.

word pName_
protected

Name of pressure field.

Definition at line 129 of file forces.H.

word UName_
protected

Name of velocity field.

Definition at line 132 of file forces.H.

Referenced by forces::devRhoReff().

word rhoName_
protected

Name of density field (optional)

Definition at line 135 of file forces.H.

Switch directForceDensity_
protected

Is the force density being supplied directly?

Definition at line 138 of file forces.H.

word fDName_
protected

The name of the force density (fD) field.

Definition at line 141 of file forces.H.

scalar rhoRef_
protected

Reference density needed for incompressible calculations.

Definition at line 144 of file forces.H.

scalar pRef_
protected

Reference pressure.

Definition at line 147 of file forces.H.

vector CofR_
protected

Centre of rotation.

Definition at line 150 of file forces.H.

autoPtr<OFstream> forcesFilePtr_
protected

Forces/moment file ptr.

Definition at line 154 of file forces.H.


The documentation for this class was generated from the following files: