34 namespace functionObjects
57 return points_.first();
64 const scalar dot0 = points_.first() & normal_;
65 const scalar dot1 = points_.last() & normal_;
68 (
pointField(points_, pointOrders_) & normal_) - dot0;
71 const scalar maxDistance =
gMax(patchPointDistances());
73 distances.
append((1 + 2*small)*
max(maxDistance, dot1 - dot0));
93 writeCommented(
file(),
"Point");
98 << w << i << w <<
' ' << w <<
' '
99 << w <<
' ' << w <<
' ' << w <<
' ';
103 writeCommented(
file(),
"Time");
108 << w <<
"Force" << w <<
' ' << w <<
' '
109 << w <<
"Moment" << w <<
' ' << w <<
' ';
113 writeCommented(
file(),
"");
118 << w <<
'x' << w <<
'y' << w <<
'z'
119 << w <<
'x' << w <<
'y' << w <<
'z';
161 <<
"At least one point must be specified"
170 /
mag(points_.last() - points_.first())
172 const scalar maxPointDeviation =
max(pointDeviation);
173 if (maxPointDeviation > rootSmall)
177 <<
" are out of line in the direction " << normal_ <<
" by up to "
178 << maxPointDeviation*100 <<
"\% of the total span. This means"
179 <<
" that the moments computed at the points have different"
180 <<
" origins, and therefore may not be comparable." <<
endl;
183 pointOrders_.setSize(points_.size());
202 moment.
map(moment, pointOrders_);
217 << w << moment[i].x()
218 << w << moment[i].y()
219 << w << moment[i].z();
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
void map(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 map from the given field
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void append(const T &)
Append an element at the end of the list.
Pre-declare related SubField type.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
T & first()
Return the first element of the list.
static bool master(const label communicator=0)
Am I the master process.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Abstract base-class for Time/database functionObjects.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...
virtual bool write()
Write function.
Calculates the magnitude of a field.
This function calculates the fluid forces and moments at a number of section-planes through a given s...
sectionalForceProbes(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual ~sectionalForceProbes()
Destructor.
virtual void writeFileHeader(const label i=0)
Output file header information.
virtual tmp< scalarField > distances() const
Return the distances from the origin to the section planes.
virtual point origin() const
Return the origin of the plot.
virtual vector normal() const
Return the normal to the section planes.
virtual bool write()
Write the sectionalForceProbes.
virtual bool read(const dictionary &)
Read the sectionalForceProbes data.
Base class for sectional forces function objects.
void addFluid(vectorField &force, vectorField &moment) const
Calculate the forces and moments at the cuts.
virtual bool read(const dictionary &)
Read the sectionalForcesBase data.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define WarningInFunction
Report a warning using Foam::Warning.
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
addToRunTimeSelectionTable(functionObject, fvModel, dictionary)
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensionSet normalised(const dimensionSet &)
Type gMax(const UList< Type > &f, const label comm)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)