rigidBodyPropellerDisk.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::fv::rigidBodyPropellerDisk
26 
27 Description
28  Disk momentum source derived from Foam::fv::propellerDisk with support
29  for motion of the body the propeller is attached to.
30 
31 Usage
32  Example usage:
33  \verbatim
34  diskSource
35  {
36  type rigidBodyPropellerDisk;
37 
38  libs ("librigidBodyPropellerDisk.so");
39 
40  cellZone propeller;
41 
42  body hull;
43 
44  centre (0 0 0); // Centre of the propeller
45  normal (1 0 0); // Normal direction of the propeller
46 
47  n 26.03; // Rotation speed [1/s]
48 
49  dPropeller 0.203; // Propeller diameter
50  dHub 0.039179; // Hub diameter
51 
52  propellerCurve
53  {
54  type table;
55 
56  // J Kt Kq
57  values
58  (
59  (0.10 (0.3267 0.03748))
60  (0.15 (0.3112 0.03629))
61  (0.20 (0.2949 0.03500))
62  (0.25 (0.2777 0.03361))
63  (0.30 (0.2598 0.03210))
64  (0.35 (0.2410 0.03047))
65  (0.40 (0.2214 0.02871))
66  (0.45 (0.2010 0.02682))
67  (0.50 (0.1798 0.02479))
68  (0.55 (0.1577 0.02261))
69  (0.60 (0.1349 0.02027))
70  (0.65 (0.1112 0.01777))
71  (0.70 (0.0867 0.01509))
72  (0.75 (0.0614 0.01224))
73  (0.80 (0.0353 0.00921))
74  );
75  }
76  }
77  \endverbatim
78 
79 See also
80  Foam::fv::propellerDisk
81 
82 SourceFiles
83  rigidBodyPropellerDisk.C
84  rigidBodyPropellerDiskTemplates.C
85 
86 \*---------------------------------------------------------------------------*/
87 
88 #ifndef rigidBodyPropellerDisk_H
89 #define rigidBodyPropellerDisk_H
90 
91 #include "propellerDisk.H"
92 #include "rigidBodyMotion.H"
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 namespace Foam
97 {
98 namespace fv
99 {
100 
101 /*---------------------------------------------------------------------------*\
102  Class rigidBodyPropellerDisk Declaration
103 \*---------------------------------------------------------------------------*/
104 
106 :
107  public propellerDisk
108 {
109  // Private Member Data
110 
111  const RBD::rigidBodyMotion& motion_;
112 
113  //- Name of the body
114  word body_;
115 
116  //- ID of the body
117  label bodyID_;
118 
119 
120 protected:
121 
122  // Protected Member Functions
123 
124  //- Read the model coefficients
125  virtual void readCoeffs(const dictionary& dict);
126 
127  //- Return the current propeller normal
128  virtual vector normal() const;
129 
130 
131 public:
132 
133  //- Runtime type information
134  TypeName("rigidBodyPropellerDisk");
135 
136 
137  // Constructors
138 
139  //- Construct from components
141  (
142  const word& name,
143  const word& modelType,
144  const fvMesh& mesh,
145  const dictionary& dict
146  );
147 
148  //- Disallow default bitwise copy construction
150 
151 
152  //- Destructor
153  virtual ~rigidBodyPropellerDisk()
154  {}
155 
156 
157  // Member Functions
158 
159  //- Return the current propeller centre
160  virtual vector centre() const;
161 
162  label bodyID() const
163  {
164  return bodyID_;
165  }
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace fv
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
Six degree of freedom motion for a rigid body.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:69
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:57
Disk momentum source which approximates a propeller based on a given propeller curve.
Disk momentum source derived from Foam::fv::propellerDisk with support for motion of the body the pro...
virtual void readCoeffs(const dictionary &dict)
Read the model coefficients.
TypeName("rigidBodyPropellerDisk")
Runtime type information.
virtual vector centre() const
Return the current propeller centre.
virtual vector normal() const
Return the current propeller normal.
rigidBodyPropellerDisk(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
A class for handling words, derived from string.
Definition: word.H:62
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
labelList fv(nPoints)
dictionary dict