sixDoFAcceleration.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-2024 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::sixDoFAcceleration
26 
27 Description
28  Solid-body 6-DoF acceleration source
29 
30 Usage
31  Example usage:
32  \verbatim
33  SBM
34  {
35  type sixDoFAcceleration;
36 
37  accelerations <function1>;
38  }
39  \endverbatim
40 
41 SourceFiles
42  sixDoFAcceleration.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef sixDoFAcceleration_H
47 #define sixDoFAcceleration_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 sixDoFAcceleration Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 :
66  public fvModel
67 {
68 private:
69 
70  // Private data
71 
72  //- Velocity field name, default = U
73  word UName_;
74 
75  //- Linear acceleration function
76  autoPtr<Function1<vector>> acceleration_;
77 
78  //- Angular velocity function
79  autoPtr<Function1<vector>> angularVelocity_;
80 
81  //- Angular acceleration function
82  autoPtr<Function1<vector>> angularAcceleration_;
83 
84  //- Optional gravitational acceleration
86 
87 
88  // Private Member Functions
89 
90  //- Non-virtual read
91  void readCoeffs(const dictionary& dict);
92 
93  //- Add force to a momentum equation
94  template<class AlphaFieldType, class RhoFieldType>
95  inline void addForce
96  (
97  const AlphaFieldType& alpha,
98  const RhoFieldType& rho,
99  const volVectorField& U,
100  fvMatrix<vector>& eqn
101  ) const;
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("sixDoFAcceleration");
108 
109 
110  // Constructors
111 
112  //- Construct from components
114  (
115  const word& name,
116  const word& modelType,
117  const fvMesh& mesh,
118  const dictionary& dict
119  );
120 
121  //- Disallow default bitwise copy construction
123  (
124  const sixDoFAcceleration&
125  ) = delete;
126 
127 
128  //- Destructor
129  virtual ~sixDoFAcceleration()
130  {}
131 
132 
133  // Member Functions
134 
135  //- Return the list of fields for which the fvModel adds source term
136  // to the transport equation
137  virtual wordList addSupFields() const;
138 
139  //- Source term to momentum equation
140  virtual void addSup
141  (
142  const volVectorField& U,
143  fvMatrix<vector>& eqn
144  ) const;
145 
146  //- Source term to compressible momentum equation
147  virtual void addSup
148  (
149  const volScalarField& rho,
150  const volVectorField& U,
151  fvMatrix<vector>& eqn
152  ) const;
153 
154  //- Source term to phase momentum equation
155  virtual void addSup
156  (
157  const volScalarField& alpha,
158  const volScalarField& rho,
159  const volVectorField& U,
160  fvMatrix<vector>& eqn
161  ) const;
162 
163 
164  // Mesh changes
165 
166  //- Update for mesh motion
167  virtual bool movePoints();
168 
169  //- Update topology using the given map
170  virtual void topoChange(const polyTopoChangeMap&);
171 
172  //- Update from another mesh using the given map
173  virtual void mapMesh(const polyMeshMap&);
174 
175  //- Redistribute or update using the given distribution map
176  virtual void distribute(const polyDistributionMap&);
177 
178 
179  //- Read dictionary
180  virtual bool read(const dictionary& dict);
181 
182 
183  // Member Operators
184 
185  //- Disallow default bitwise assignment
186  void operator=(const sixDoFAcceleration&) = delete;
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace fv
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
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:96
Finite volume model abstract base class.
Definition: fvModel.H:60
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
Solid-body 6-DoF acceleration source.
virtual bool movePoints()
Update for mesh motion.
virtual void addSup(const volVectorField &U, fvMatrix< vector > &eqn) const
Source term to momentum equation.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
TypeName("sixDoFAcceleration")
Runtime type information.
void operator=(const sixDoFAcceleration &)=delete
Disallow default bitwise assignment.
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.
sixDoFAcceleration(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual ~sixDoFAcceleration()
Destructor.
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
U
Definition: pEqn.H:72
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