tabulatedAccelerationSource.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2015 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::tabulatedAccelerationSource
26 
27 Description
28  Solid-body 6-DoF acceleration source
29 
30  \heading Source usage
31 
32  Example usage:
33  \verbatim
34  SBM
35  {
36  type tabulatedAccelerationSource;
37  active yes;
38 
39  tabulatedAccelerationSourceCoeffs
40  {
41  timeDataFileName "constant/acceleration-terms.dat";
42  }
43  }
44  \endverbatim
45 
46 
47 SourceFiles
48  tabulatedAccelerationSource.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef tabulatedAccelerationSource_H
53 #define tabulatedAccelerationSource_H
54 
55 #include "fvOption.H"
57 #include "dimensionedTypes.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace fv
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class tabulatedAccelerationSource Declaration
68 \*---------------------------------------------------------------------------*/
69 
71 :
72  public option
73 {
74 
75 protected:
76 
77  // Protected data
78 
79  //- Run-time selectable acceleration model
81 
82  //- Velocity field name, default = U
83  word UName_;
84 
86 
87 private:
88 
89  // Private Member Functions
90 
91  //- Disallow default bitwise copy construct
93 
94  //- Disallow default bitwise assignment
95  void operator=(const tabulatedAccelerationSource&);
96 
97 
98  //- Source term to momentum equation
99  template<class RhoFieldType>
100  void addSup
101  (
102  const RhoFieldType& rho,
103  fvMatrix<vector>& eqn,
104  const label fieldi
105  );
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("tabulatedAccelerationSource");
112 
113 
114  // Constructors
115 
116  //- Construct from components
118  (
119  const word& name,
120  const word& modelType,
121  const dictionary& dict,
122  const fvMesh& mesh
123  );
124 
125 
126  //- Destructor
128  {}
129 
130 
131  // Member Functions
132 
133  //- Source term to momentum equation
134  virtual void addSup
135  (
136  fvMatrix<vector>& eqn,
137  const label fieldi
138  );
139 
140  //- Source term to compressible momentum equation
141  virtual void addSup
142  (
143  const volScalarField& rho,
144  fvMatrix<vector>& eqn,
145  const label fieldi
146  );
147 
148  //- Read dictionary
149  virtual bool read(const dictionary& dict);
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace fv
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #ifdef NoRepository
162 #endif
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
Finite volume options abtract base class. Provides a base set of controls, e.g.
Definition: fvOption.H:65
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
Tabulated 6DoF acceleration.
A class for handling words, derived from string.
Definition: word.H:59
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
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:68
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
word UName_
Velocity field name, default = U.
dictionary dict
Solid-body 6-DoF acceleration source.
labelList fv(nPoints)
TypeName("tabulatedAccelerationSource")
Runtime type information.
tabulated6DoFAcceleration motion_
Run-time selectable acceleration model.
virtual bool read(const dictionary &dict)
Read dictionary.