rigidBodySectionalForceProbes.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::functionObjects::rigidBodySectionalForceProbes
26 
27 Description
28  This function calculates the fluid and acceleration forces and moments at a
29  number of section-planes through a given rigid body. It writes the result
30  into a log file.
31 
32  The cut-planes are defined as normal to an axis in the local coordinate
33  system of the rigid body, and through a number of coordinates along that
34  axis.
35 
36  Note that this function does not take into account the effect of joints or
37  restraints attached to the body, so if these are applied then the forces
38  generated will be somewhat incomplete. Note that ramping, acceleration
39  relaxation, and solution tolerance can also result in components of the
40  forces and moments to be missing from the output.
41 
42  Example of function object specification
43  \verbatim
44  rigidBodySectionalForceProbes
45  {
46  type rigidBodySectionalForceProbes;
47  libs ("librigidBodyForces.so");
48  body beam;
49  patches (beam);
50  axis x;
51  coordinates (4.2 5 5.8);
52  }
53  \endverbatim
54 
55 Usage
56  \table
57  Property | Description | Required | Default value
58  type | Type name: rigidBodySectionalForceProbes | yes |
59  body | The name of the rigid body | yes |
60  patches | Patches included in the forces calculation | yes |
61  axis | Local axis normal to the section planes | yes |
62  coordinates | Coordinates of the section planes | yes |
63  p | Pressure field name | no | p
64  U | Velocity field name | no | U
65  rho | Density field name | no | rho
66  phase | Phase name for phase-fraction | no |
67  rhoRef | Reference density | if incompressible |
68  pRef | Reference pressure | no | 0
69  \endtable
70 
71 SourceFiles
72  rigidBodySectionalForceProbes.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef rigidBodySectionalForceProbes_functionObject_H
77 #define rigidBodySectionalForceProbes_functionObject_H
78 
80 #include "logFiles.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 namespace functionObjects
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class rigidBodySectionalForceProbes Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class rigidBodySectionalForceProbes
94 :
95  public rigidBodySectionalForcesBase,
96  public logFiles
97 {
98  // Private Data
99 
100  //- Coordinates of the section planes
101  List<scalar> coordinates_;
102 
103  //- The sorted order of the coordinates
104  labelList coordinateOrders_;
105 
106 
107  // Private Member Functions
108 
109  //- Return the distances from the origin to the section planes
110  virtual tmp<scalarField> distances() const;
111 
112  //- Output file header information
113  virtual void writeFileHeader(const label i = 0);
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("rigidBodySectionalForceProbes");
120 
121 
122  // Constructors
123 
124  //- Construct from Time and dictionary
126  (
127  const word& name,
128  const Time& runTime,
129  const dictionary& dict
130  );
131 
132  //- Disallow default bitwise copy construction
134  (
136  ) = delete;
137 
138 
139  //- Destructor
141 
142 
143  // Member Functions
144 
145  //- Read the rigidBodySectionalForceProbes data
146  virtual bool read(const dictionary&);
147 
148  //- Write the rigidBodySectionalForceProbes
149  virtual bool write();
150 
151 
152  // Member Operators
153 
154  //- Disallow default bitwise assignment
155  void operator=(const rigidBodySectionalForceProbes&) = delete;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace functionObjects
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
const word & name() const
Return the name of this functionObject.
This function calculates the fluid and acceleration forces and moments at a number of section-planes ...
TypeName("rigidBodySectionalForceProbes")
Runtime type information.
rigidBodySectionalForceProbes(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
void operator=(const rigidBodySectionalForceProbes &)=delete
Disallow default bitwise assignment.
virtual bool write()
Write the rigidBodySectionalForceProbes.
virtual bool read(const dictionary &)
Read the rigidBodySectionalForceProbes data.
Motion of the mesh specified as a list of pointMeshMovers.
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: labelList.H:56
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dictionary dict