propellerDiskForce.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) 2024-2025 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::RBD::restraints::propellerDiskForce
26 
27 Description
28  rigidBodyPropellerDisk force restraint.
29 
30  Applies the opposite force and moment of the propellerDisk onto the body
31  the propeller is attached to.
32 
33 Usage
34  Example applying the propeller force and moment to the floatingObject:
35  \verbatim
36  restraints
37  {
38  force
39  {
40  type propellerDiskForce;
41  body floatingObject;
42  }
43  }
44  \endverbatim
45 
46 See also
47  Foam::fv::rigidBodyPropellerDisk
48  Foam::fv::propellerDisk
49 
50 SourceFiles
51  propellerDiskForce.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef propellerDiskForce_RBD_restraint_H
56 #define propellerDiskForce_RBD_restraint_H
57 
58 #include "rigidBodyRestraint.H"
59 #include "Function1.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 namespace RBD
66 {
67 namespace restraints
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class propellerDiskForce Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public restraint
77 {
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("propellerDiskForce");
83 
84 
85  // Constructors
86 
87  //- Construct from components
89  (
90  const word& name,
91  const dictionary& dict,
92  const rigidBodyModel& model
93  );
94 
95  //- Construct and return a clone
96  virtual autoPtr<restraint> clone() const
97  {
98  return autoPtr<restraint>
99  (
100  new propellerDiskForce(*this)
101  );
102  }
103 
104 
105  //- Destructor
106  virtual ~propellerDiskForce();
107 
108 
109  // Member Functions
110 
111  //- Accumulate the retraint internal joint forces into the tau field and
112  // external forces into the fx field
113  virtual void restrain
114  (
115  scalarField& tau,
117  const rigidBodyModelState& state
118  ) const;
119 
120  //- Update properties from given dictionary
121  virtual bool read(const dictionary& dict);
122 
123  //- Write
124  virtual void write(Ostream&) const;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace restraints
131 } // End namespace RBD
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Base class for defining restraints for rigid-body dynamics.
const word & name() const
Return the name.
rigidBodyPropellerDisk force restraint.
virtual void write(Ostream &) const
Write.
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
virtual void restrain(scalarField &tau, Field< spatialVector > &fx, const rigidBodyModelState &state) const
Accumulate the retraint internal joint forces into the tau field and.
virtual autoPtr< restraint > clone() const
Construct and return a clone.
propellerDiskForce(const word &name, const dictionary &dict, const rigidBodyModel &model)
Construct from components.
TypeName("propellerDiskForce")
Runtime type information.
Holds the motion state of rigid-body model.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A class for handling words, derived from string.
Definition: word.H:62
const vector tau
Namespace for OpenFOAM.
dictionary dict