verticalDamping.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) 2017 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::verticalDamping
26 
27 Description
28  This fvOption applies an explicit damping force to components of the vector
29  field in the direction of gravity. Its intended purpose is to damp the
30  vertical motions of an interface in the region approaching an outlet so that
31  no reflections are generated.
32 
33 Usage
34  Example usage:
35  \verbatim
36  verticalDamping1
37  {
38  type verticalDamping;
39 
40  selectionMode cellZone;
41  cellZone nearOutlet;
42 
43  lambda [0 0 -1 0 0 0 0] 1; // Damping coefficient
44 
45  timeStart 0;
46  duration 1e6;
47  }
48  \endverbatim
49 
50 SourceFiles
51  verticalDamping.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef verticalDamping_H
56 #define verticalDamping_H
57 
58 #include "cellSetOption.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 namespace fv
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class verticalDamping Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 class verticalDamping
72 :
73  public cellSetOption
74 {
75 private:
76 
77  // Private data
78 
79  //- Damping coefficient [1/s]
80  dimensionedScalar lambda_;
81 
82 
83  // Private Member Functions
84 
85  //- Source term to momentum equation
86  void add
87  (
88  const volVectorField& alphaRhoU,
89  fvMatrix<vector>& eqn,
90  const label fieldi
91  );
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("verticalDamping");
98 
99 
100  // Constructors
101 
102  //- Construct from components
104  (
105  const word& name,
106  const word& modelType,
107  const dictionary& dict,
108  const fvMesh& mesh
109  );
110 
111 
112  //- Destructor
113  virtual ~verticalDamping()
114  {}
115 
116 
117  // Member Functions
118 
119  // Add explicit and implicit contributions
120 
121  //- Source term to momentum equation
122  virtual void addSup
123  (
124  fvMatrix<vector>& eqn,
125  const label fieldi
126  );
127 
128  //- Source term to compressible momentum equation
129  virtual void addSup
130  (
131  const volScalarField& rho,
132  fvMatrix<vector>& eqn,
133  const label fieldi
134  );
135 
136  //- Source term to phase momentum equation
137  virtual void addSup
138  (
139  const volScalarField& alpha,
140  const volScalarField& rho,
141  fvMatrix<vector>& eqn,
142  const label fieldi
143  );
144 
145 
146  // IO
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 #endif
161 
162 // ************************************************************************* //
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
dictionary dict
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 list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
virtual ~verticalDamping()
Destructor.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
This fvOption applies an explicit damping force to components of the vector field in the direction of...
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
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
virtual bool read(const dictionary &dict)
Read dictionary.
TypeName("verticalDamping")
Runtime type information.
verticalDamping(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Cell-set options abtract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:69
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Namespace for OpenFOAM.