OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

forces Class Reference

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

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, 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 ()
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.
tmp< volSymmTensorField > devRhoReff () const
 Return the effective viscous stress (laminar + turbulent).
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.
virtual void writeFileHeader ()
 Output file header information.

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.
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.
vector CofR_
 Centre of rotation.
autoPtr< OFstream > forcesFilePtr_
 Forces/moment file ptr.

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 63 of file forces.H.


Member Typedef Documentation

Definition at line 68 of file forces.H.

Definition at line 72 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 131 of file forces.C.

References forces::rhoRef_.

~forces (  )  [virtual]

Definition at line 174 of file forces.C.


Member Function Documentation

void makeFile (  )  [protected]

If the forces file has not been created create it.

Definition at line 242 of file forces.C.

Foam::tmp< Foam::volSymmTensorField > devRhoReff (  )  const [protected]

Return the effective viscous stress (laminar + turbulent).

Definition at line 41 of file forces.C.

References Foam::defineTypeNameAndDebug().

Here is the call graph for this function:

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 115 of file forces.C.

void operator= ( const forces &   )  [protected]

Disallow default bitwise assignment.

void writeFileHeader (  )  [protected, virtual]

Output file header information.

Reimplemented in forceCoeffs.

Definition at line 281 of file forces.C.

TypeName ( "forces"   ) 

Runtime type information.

virtual const word& name (  )  const [inline, virtual]

Return name of the set of forces.

Definition at line 201 of file forces.H.

References forces::name_.

void read ( const dictionary &  dict  )  [virtual]

Read the forces data.

Reimplemented in forceCoeffs.

Definition at line 180 of file forces.C.

void execute (  )  [virtual]

Execute, currently does nothing.

Reimplemented in forceCoeffs.

Definition at line 293 of file forces.C.

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

Here is the call graph for this function:

void end (  )  [virtual]

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

Reimplemented in forceCoeffs.

Definition at line 299 of file forces.C.

void write (  )  [virtual]

Write the forces.

Reimplemented in forceCoeffs.

Definition at line 305 of file forces.C.

Foam::forces::forcesMoments calcForcesMoment (  )  const [virtual]

Calculate and return forces and moment.

Definition at line 330 of file forces.C.

virtual void updateMesh ( const mapPolyMesh &   )  [inline, virtual]

Update for changes of mesh.

Definition at line 222 of file forces.H.

virtual void movePoints ( const pointField &   )  [inline, virtual]

Update for changes of mesh.

Definition at line 226 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 110 of file forces.H.

Referenced by forces::name().

const objectRegistry& obr_ [protected]

Definition at line 112 of file forces.H.

bool active_ [protected]

on/off switch

Definition at line 115 of file forces.H.

Switch log_ [protected]

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

Definition at line 118 of file forces.H.

labelHashSet patchSet_ [protected]

Patches to integrate forces over.

Definition at line 123 of file forces.H.

word pName_ [protected]

Name of pressure field.

Definition at line 126 of file forces.H.

word UName_ [protected]

Name of velocity field.

Definition at line 129 of file forces.H.

Is the force density being supplied directly?

Definition at line 132 of file forces.H.

word fDName_ [protected]

The name of the force density (fD) field.

Definition at line 135 of file forces.H.

scalar rhoRef_ [protected]

Reference density needed for incompressible calculations.

Definition at line 138 of file forces.H.

Referenced by forces::forces().

vector CofR_ [protected]

Centre of rotation.

Definition at line 141 of file forces.H.

Forces/moment file ptr.

Definition at line 145 of file forces.H.

Referenced by forceCoeffs::execute(), and forces::execute().


The documentation for this class was generated from the following files:
  • src/postProcessing/functionObjects/forces/forces/forces.H
  • src/postProcessing/functionObjects/forces/forces/forces.C
Copyright © 2000-2009 OpenCFD Ltd