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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2017 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fv::tabulatedAccelerationSource
29 
30 Group
31  grpFvOptionsSources
32 
33 Description
34  Solid-body 6-DoF acceleration source.
35 
36 Usage
37  Minimal example by using \c constant/fvOptions:
38  \verbatim
39  tabulatedAccelerationSource1
40  {
41  // Mandatory entries (unmodifiable)
42  type tabulatedAccelerationSource;
43  timeDataFileName "constant/acceleration-terms.dat";
44 
45  // Optional entries (unmodifiable)
46  U U;
47 
48  // Mandatory/Optional (inherited) entries
49  ...
50  }
51  \endverbatim
52 
53  where the entries mean:
54  \table
55  Property | Description | Type | Reqd | Dflt
56  type | Type name: tabulatedAccelerationSource | word | yes | -
57  timeDataFileName | Name of tabulated data file | word | yes | -
58  U | Name of operand velocity field | word | no | U
59  \endtable
60 
61  The inherited entries are elaborated in:
62  - \link fvOption.H \endlink
63 
64 SourceFiles
65  tabulatedAccelerationSource.C
66  tabulatedAccelerationSourceTemplates.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef tabulatedAccelerationSource_H
71 #define tabulatedAccelerationSource_H
72 
73 #include "fvOption.H"
75 #include "dimensionedTypes.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 namespace fv
82 {
83 
84 /*---------------------------------------------------------------------------*\
85  Class tabulatedAccelerationSource Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class tabulatedAccelerationSource
89 :
90  public fv::option
91 {
92 protected:
93 
94  // Protected Data
95 
96  //- Run-time selectable acceleration model
97  tabulated6DoFAcceleration motion_;
98 
99  //- Name of operand velocity field
100  word UName_;
101 
102  //- Gravitational accelaration
104 
105 
106 private:
107 
108  // Private Member Functions
109 
110  //- Source term to momentum equation
111  template<class RhoFieldType>
112  void addSup
113  (
114  const RhoFieldType& rho,
115  fvMatrix<vector>& eqn,
116  const label fieldi
117  );
118 
119 
120 public:
121 
122  //- Runtime type information
123  TypeName("tabulatedAccelerationSource");
124 
125 
126  // Constructors
127 
128  //- Construct from components
130  (
131  const word& name,
132  const word& modelType,
133  const dictionary& dict,
134  const fvMesh& mesh
135  );
136 
137  //- No copy construct
139  (
141  ) = delete;
142 
143  //- No copy assignment
144  void operator=(const tabulatedAccelerationSource&) = delete;
145 
146 
147  //- Destructor
148  virtual ~tabulatedAccelerationSource() = default;
149 
150 
151  // Member Functions
152 
153  //- Add explicit contribution to momentum equation
154  virtual void addSup
155  (
156  fvMatrix<vector>& eqn,
157  const label fieldi
158  );
159 
160  //- Add explicit contribution to compressible momentum equation
161  virtual void addSup
162  (
163  const volScalarField& rho,
164  fvMatrix<vector>& eqn,
165  const label fieldi
166  );
167 
168 
169  //- Read source dictionary
170  virtual bool read(const dictionary& dict);
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace fv
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Foam::fv::option::name
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
tabulatedAccelerationSourceTemplates.C
Foam::fv::tabulatedAccelerationSource
Solid-body 6-DoF acceleration source.
Definition: tabulatedAccelerationSource.H:111
Foam::fv::tabulatedAccelerationSource::TypeName
TypeName("tabulatedAccelerationSource")
Runtime type information.
rho
rho
Definition: readInitialConditions.H:88
Foam::tabulated6DoFAcceleration
Tabulated 6DoF acceleration.
Definition: tabulated6DoFAcceleration.H:56
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition: dimensionedVector.H:50
Foam::fv::tabulatedAccelerationSource::g0_
dimensionedVector g0_
Gravitational accelaration.
Definition: tabulatedAccelerationSource.H:126
Foam::fv::tabulatedAccelerationSource::operator=
void operator=(const tabulatedAccelerationSource &)=delete
No copy assignment.
Foam::fv::option
Base abstract class for handling finite volume options (i.e. fvOption).
Definition: fvOption.H:126
Foam::fv::tabulatedAccelerationSource::tabulatedAccelerationSource
tabulatedAccelerationSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: tabulatedAccelerationSource.C:50
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned< vector >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
Foam::fv::option::mesh
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
fvOption.H
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:120
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::fv::tabulatedAccelerationSource::read
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: tabulatedAccelerationSource.C:95
Foam::fv::tabulatedAccelerationSource::~tabulatedAccelerationSource
virtual ~tabulatedAccelerationSource()=default
Destructor.
Foam::fv::tabulatedAccelerationSource::UName_
word UName_
Name of operand velocity field.
Definition: tabulatedAccelerationSource.H:123