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-2021 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  //- Source term to momentum equation
100  template<class RhoFieldType>
101  void addSup
102  (
103  const RhoFieldType& rho,
104  fvMatrix<vector>& eqn,
105  const word& fieldName
106  ) const;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("sixDoFAccelerationSource");
113 
114 
115  // Constructors
116 
117  //- Construct from components
119  (
120  const word& name,
121  const word& modelType,
122  const dictionary& dict,
123  const fvMesh& mesh
124  );
125 
126  //- Disallow default bitwise copy construction
128  (
130  ) = delete;
131 
132 
133  //- Destructor
134  virtual ~sixDoFAccelerationSource()
135  {}
136 
137 
138  // Member Functions
139 
140  //- Return the list of fields for which the fvModel adds source term
141  // to the transport equation
142  virtual wordList addSupFields() const;
143 
144  //- Source term to momentum equation
145  virtual void addSup
146  (
147  fvMatrix<vector>& eqn,
148  const word& fieldName
149  ) const;
150 
151  //- Source term to compressible momentum equation
152  virtual void addSup
153  (
154  const volScalarField& rho,
155  fvMatrix<vector>& eqn,
156  const word& fieldName
157  ) const;
158 
159  //- Read dictionary
160  virtual bool read(const dictionary& dict);
161 
162 
163  // Member Operators
164 
165  //- Disallow default bitwise assignment
166  void operator=(const sixDoFAccelerationSource&) = delete;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace fv
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #ifdef NoRepository
179 #endif
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
dictionary dict
Vector< vector > accelerationVectors
Accelerations type comprising.
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
Finite volume model abstract base class.
Definition: fvModel.H:55
TypeName("sixDoFAccelerationSource")
Runtime type information.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
sixDoFAccelerationSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
void operator=(const sixDoFAccelerationSource &)=delete
Disallow default bitwise assignment.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Solid-body 6-DoF acceleration source.
Namespace for OpenFOAM.
virtual bool read(const dictionary &dict)
Read dictionary.