rigidBodySectionalForcesBase.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::rigidBodySectionalForcesBase
26 
27 Description
28  Base class for rigid-body sectional forces function objects
29 
30 SourceFiles
31  rigidBodySectionalForcesBase.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef rigidBodySectionalForcesBase_functionObject_H
36 #define rigidBodySectionalForcesBase_functionObject_H
37 
38 #include "sectionalForcesBase.H"
39 #include "coordSet.H"
40 #include "rigidBodyMotion.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace functionObjects
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class rigidBodySectionalForcesBase Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public sectionalForcesBase
56 {
57  // Private Data
58 
59  //- Name of the rigid body
60  word body_;
61 
62  //- The axis on which to plot the results
63  coordSet::axisType axis_;
64 
65  //- Local origin of the plot
66  point localOrigin_;
67 
68  //- The axis on which to plot the results
69  label axisi_;
70 
71 
72 protected:
73 
74  // Protected Member Functions
75 
76  //- Return the motion system
77  const RBD::rigidBodyMotion& motion() const;
78 
79  //- Return the index of the body
80  label bodyIndex() const;
81 
82  //- Return the body
83  const RBD::rigidBody& body() const;
84 
85  //- Return the axis on which to plot the result
86  label axisi() const;
87 
88  //- Return the name of the axis on which to plot the result
89  const word& axisName() const;
90 
91  //- Return the vector axis on which to plot the result. Note that this
92  // is in the local coordinate system of the body. The global axis is
93  // given by the 'normal' method.
94  vector axis() const;
95 
96  //- Return the local origin of the plot
97  const point& localOrigin() const;
98 
99  //- Return the normal to the section planes
100  virtual vector normal() const;
101 
102  //- Return the origin of the plot
103  virtual point origin() const;
104 
105  //- Calculate the forces and moments at the cuts
106  void addFluid
107  (
109  vectorField& moment
110  ) const;
111 
112  //- Calculate the forces and moments at the cuts
113  void addBody
114  (
116  vectorField& moment
117  ) const;
118 
119 
120 public:
121 
122  //- Runtime type information
123  TypeName("rigidBodySectionalForcesBase");
124 
125 
126  // Constructors
127 
128  //- Construct from Time and dictionary
130  (
131  const word& name,
132  const Time& runTime,
133  const dictionary& dict
134  );
135 
136  //- Disallow default bitwise copy construction
138  (
140  ) = delete;
141 
142 
143  //- Destructor
145 
146 
147  // Member Functions
148 
149  //- Read the rigidBodySectionalForcesBase data
150  virtual bool read(const dictionary&);
151 
152  //- Update for mesh point-motion
153  virtual void movePoints(const polyMesh&);
154 
155 
156  // Member Operators
157 
158  //- Disallow default bitwise assignment
159  void operator=(const rigidBodySectionalForcesBase&) = delete;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace functionObjects
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
Six degree of freedom motion for a rigid body.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
axisType
Enumeration defining the output format for coordinates.
Definition: coordSet.H:58
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Base class for rigid-body sectional forces function objects.
const RBD::rigidBodyMotion & motion() const
Return the motion system.
label axisi() const
Return the axis on which to plot the result.
label bodyIndex() const
Return the index of the body.
void operator=(const rigidBodySectionalForcesBase &)=delete
Disallow default bitwise assignment.
vector axis() const
Return the vector axis on which to plot the result. Note that this.
const point & localOrigin() const
Return the local origin of the plot.
rigidBodySectionalForcesBase(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual void movePoints(const polyMesh &)
Update for mesh point-motion.
void addFluid(vectorField &force, vectorField &moment) const
Calculate the forces and moments at the cuts.
const word & axisName() const
Return the name of the axis on which to plot the result.
const RBD::rigidBody & body() const
Return the body.
virtual point origin() const
Return the origin of the plot.
virtual vector normal() const
Return the normal to the section planes.
void addBody(vectorField &force, vectorField &moment) const
Calculate the forces and moments at the cuts.
virtual bool read(const dictionary &)
Read the rigidBodySectionalForcesBase data.
TypeName("rigidBodySectionalForcesBase")
Runtime type information.
Base class for sectional forces function objects.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
A class for handling words, derived from string.
Definition: word.H:63
const dimensionSet force
Namespace for OpenFOAM.
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