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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::fv::tabulatedAccelerationSource
29
30Group
31 grpFvOptionsSources
32
33Description
34 Solid-body 6-DoF acceleration source.
35
36Usage
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
64SourceFiles
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
79namespace Foam
80{
81namespace fv
82{
83
84/*---------------------------------------------------------------------------*\
85 Class tabulatedAccelerationSource Declaration
86\*---------------------------------------------------------------------------*/
87
88class tabulatedAccelerationSource
89:
90 public fv::option
91{
92protected:
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
106private:
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
120public:
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
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 );
168
169 //- Read source dictionary
170 virtual bool read(const dictionary& dict);
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// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:121
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Base abstract class for handling finite volume options (i.e. fvOption).
Definition: fvOption.H:127
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
Solid-body 6-DoF acceleration source.
word UName_
Name of operand velocity field.
void operator=(const tabulatedAccelerationSource &)=delete
No copy assignment.
dimensionedVector g0_
Gravitational accelaration.
virtual bool read(const dictionary &dict)
Read source dictionary.
tabulated6DoFAcceleration motion_
Run-time selectable acceleration model.
TypeName("tabulatedAccelerationSource")
Runtime type information.
tabulatedAccelerationSource(const tabulatedAccelerationSource &)=delete
No copy construct.
virtual ~tabulatedAccelerationSource()=default
Destructor.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73