sixDoFAccelerationSource.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) 2015-2023 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::sixDoFAccelerationSource
26 
27 Description
28  Solid-body 6-DoF acceleration source
29 
30 Usage
31  Example usage:
32  \verbatim
33  SBM
34  {
35  type sixDoFAccelerationSource;
36 
37  accelerations <function1>;
38  }
39  \endverbatim
40 
41 SourceFiles
42  sixDoFAccelerationSource.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef sixDoFAccelerationSource_H
47 #define sixDoFAccelerationSource_H
48 
49 #include "fvModel.H"
50 #include "Function1.H"
51 #include "dimensionedTypes.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class sixDoFAccelerationSource Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 :
66  public fvModel
67 {
68 public:
69 
70  //- Accelerations type comprising
71  // linear acceleration vector
72  // angular velocity vector
73  // angular acceleration vector
75 
76 
77 private:
78 
79  // Private data
80 
81  //- Velocity field name, default = U
82  word UName_;
83 
84  //- Accelerations function returning a vector containing
85  // linear acceleration vector
86  // angular velocity vector
87  // angular acceleration vector
89 
90  //- Optional gravitational acceleration
92 
93 
94  // Private Member Functions
95 
96  //- Non-virtual read
97  void readCoeffs();
98 
99  //- Add force to a momentum equation
100  template<class AlphaFieldType, class RhoFieldType>
101  void addForce
102  (
103  const AlphaFieldType& alpha,
104  const RhoFieldType& rho,
105  fvMatrix<vector>& eqn,
106  const word& fieldName
107  ) const;
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("sixDoFAccelerationSource");
114 
115 
116  // Constructors
117 
118  //- Construct from components
120  (
121  const word& name,
122  const word& modelType,
123  const fvMesh& mesh,
124  const dictionary& dict
125  );
126 
127  //- Disallow default bitwise copy construction
129  (
131  ) = delete;
132 
133 
134  //- Destructor
135  virtual ~sixDoFAccelerationSource()
136  {}
137 
138 
139  // Member Functions
140 
141  //- Return the list of fields for which the fvModel adds source term
142  // to the transport equation
143  virtual wordList addSupFields() const;
144 
145  //- Source term to momentum equation
146  virtual void addSup
147  (
148  fvMatrix<vector>& eqn,
149  const word& fieldName
150  ) const;
151 
152  //- Source term to compressible momentum equation
153  virtual void addSup
154  (
155  const volScalarField& rho,
156  fvMatrix<vector>& eqn,
157  const word& fieldName
158  ) const;
159 
160  //- Source term to phase momentum equation
161  virtual void addSup
162  (
163  const volScalarField& alpha,
164  const volScalarField& rho,
165  fvMatrix<vector>& eqn,
166  const word& fieldName
167  ) const;
168 
169 
170  // Mesh changes
171 
172  //- Update for mesh motion
173  virtual bool movePoints();
174 
175  //- Update topology using the given map
176  virtual void topoChange(const polyTopoChangeMap&);
177 
178  //- Update from another mesh using the given map
179  virtual void mapMesh(const polyMeshMap&);
180 
181  //- Redistribute or update using the given distribution map
182  virtual void distribute(const polyDistributionMap&);
183 
184 
185  //- Read dictionary
186  virtual bool read(const dictionary& dict);
187 
188 
189  // Member Operators
190 
191  //- Disallow default bitwise assignment
192  void operator=(const sixDoFAccelerationSource&) = delete;
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace fv
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #ifdef NoRepository
205 #endif
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
Generic GeometricField class.
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 keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Finite volume model abstract base class.
Definition: fvModel.H:59
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
Solid-body 6-DoF acceleration source.
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void addSup(fvMatrix< vector > &eqn, const word &fieldName) const
Source term to momentum equation.
void operator=(const sixDoFAccelerationSource &)=delete
Disallow default bitwise assignment.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Vector< vector > accelerationVectors
Accelerations type comprising.
sixDoFAccelerationSource(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
TypeName("sixDoFAccelerationSource")
Runtime type information.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict