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
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 // ************************************************************************* //
Foam::fv::tabulatedAccelerationSource::addSup
void addSup(const RhoFieldType &rho, fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
Definition: tabulatedAccelerationSourceTemplates.C:35
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
tabulatedAccelerationSourceTemplates.C
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
Foam::fv::tabulatedAccelerationSource::~tabulatedAccelerationSource
virtual ~tabulatedAccelerationSource()
Destructor.
Definition: tabulatedAccelerationSource.H:126
Foam::fv::tabulatedAccelerationSource
Solid-body 6-DoF acceleration source.
Definition: tabulatedAccelerationSource.H:69
Foam::fv::tabulatedAccelerationSource::TypeName
TypeName("tabulatedAccelerationSource")
Runtime type information.
Foam::tabulated6DoFAcceleration
Tabulated 6DoF acceleration.
Definition: tabulated6DoFAcceleration.H:53
Foam::fv::tabulatedAccelerationSource::g0_
dimensionedVector g0_
Definition: tabulatedAccelerationSource.H:84
Foam::label
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
Foam::fv::option
Finite volume options abtract base class. Provides a base set of controls, e.g.
Definition: fvOption.H:65
Foam::fv::tabulatedAccelerationSource::operator=
void operator=(const tabulatedAccelerationSource &)
Disallow default bitwise assignment.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
rho
rho
Definition: pEqn.H:3
fv
labelList fv(nPoints)
fvOption.H
Foam::fv::tabulatedAccelerationSource::tabulatedAccelerationSource
tabulatedAccelerationSource(const tabulatedAccelerationSource &)
Disallow default bitwise copy construct.
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
dimensionedTypes.H
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
tabulated6DoFAcceleration.H
Foam::fv::tabulatedAccelerationSource::motion_
tabulated6DoFAcceleration motion_
Run-time selectable acceleration model.
Definition: tabulatedAccelerationSource.H:79
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::fv::tabulatedAccelerationSource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: tabulatedAccelerationSource.C:97
Foam::fv::tabulatedAccelerationSource::UName_
word UName_
Velocity field name, default = U.
Definition: tabulatedAccelerationSource.H:82