acousticDampingSource.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) 2016 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fv::acousticDampingSource
28 
29 Group
30  grpFvOptionsSources
31 
32 Description
33  Acoustic damping source
34 
35  \heading Source usage
36 
37  Example usage:
38  \verbatim
39  acousticDampingSourceCoeffs
40  {
41  timeStart 0.004;
42  duration 1000.0;
43  selectionMode all;
44  origin (-1.25 0 0);
45  radius1 1.2;
46  radius2 1.65;
47  frequency 3000;
48  URef UMean;
49  }
50  \endverbatim
51 
52 SourceFiles
53  acousticDampingSource.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef acousticDampingSource_H
58 #define acousticDampingSource_H
59 
60 #include "cellSetOption.H"
61 #include "volFields.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 class porosityModel;
69 
70 namespace fv
71 {
72 
73 
74 /*---------------------------------------------------------------------------*\
75  Class acousticDampingSource Declaration
76 \*---------------------------------------------------------------------------*/
77 
79 :
80  public cellSetOption
81 {
82 
83 protected:
84 
85  // Protected data
86 
87  //- Frequency [Hz]
89 
90  //- Blending factor []
92 
93  //- Name of reference velocity field
95 
96  // Sphere centre location or damping
97  point x0_;
98 
99  // Inner radius at which to start damping
100  scalar r1_;
101 
102  // Outer radius beyond which damping is applied
103  scalar r2_;
104 
105  //- Stencil width, default = 20
106  label w_;
107 
108 
109  // Protected Member Functions
110 
111  //- Helper function to set the blending factor
112  void setBlendingFactor();
113 
114 
115 private:
116 
117  // Private Member Functions
118 
119  //- No copy construct
121 
122  //- No copy assignment
123  void operator=(const acousticDampingSource&) = delete;
124 
125 
126 public:
127 
128  //- Runtime type information
129  TypeName("acousticDampingSource");
130 
131 
132  // Constructors
133 
134  //- Construct from components
136  (
137  const word& name,
138  const word& modelType,
139  const dictionary& dict,
140  const fvMesh& mesh
141  );
142 
143 
144  //- Destructor
145  virtual ~acousticDampingSource() = default;
146 
147 
148  // Member Functions
149 
150  //- Add implicit contribution to momentum equation
151  virtual void addSup
152  (
153  fvMatrix<vector>& eqn,
154  const label fieldI
155  );
156 
157  //- Add implicit contribution to compressible momentum equation
158  virtual void addSup
159  (
160  const volScalarField& rho,
161  fvMatrix<vector>& eqn,
162  const label fieldI
163  );
164 
165  //- Add implicit contribution to phase momentum equation
166  virtual void addSup
167  (
168  const volScalarField& alpha,
169  const volScalarField& rho,
170  fvMatrix<vector>& eqn,
171  const label fieldI
172  );
173 
174 
175  //- Read dictionary
176  virtual bool read(const dictionary& dict);
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace fv
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
volFields.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::cellSetOption
Cell-set options abstract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:72
Foam::fv::acousticDampingSource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldI)
Add implicit contribution to momentum equation.
Definition: acousticDampingSource.C:124
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:30
Foam::fv::acousticDampingSource::r2_
scalar r2_
Definition: acousticDampingSource.H:102
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::fv::acousticDampingSource::setBlendingFactor
void setBlendingFactor()
Helper function to set the blending factor.
Definition: acousticDampingSource.C:55
Foam::fv::acousticDampingSource::frequency_
dimensionedScalar frequency_
Frequency [Hz].
Definition: acousticDampingSource.H:87
Foam::fv::acousticDampingSource::URefName_
word URefName_
Name of reference velocity field.
Definition: acousticDampingSource.H:93
Foam::fv::acousticDampingSource::x0_
point x0_
Definition: acousticDampingSource.H:96
Foam::fv::acousticDampingSource::r1_
scalar r1_
Definition: acousticDampingSource.H:99
Foam::fv::acousticDampingSource::TypeName
TypeName("acousticDampingSource")
Runtime type information.
rho
rho
Definition: readInitialConditions.H:88
cellSetOption.H
Foam::fv::acousticDampingSource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: acousticDampingSource.C:180
Foam::fv::acousticDampingSource::~acousticDampingSource
virtual ~acousticDampingSource()=default
Destructor.
Foam::fv::acousticDampingSource
Acoustic damping source.
Definition: acousticDampingSource.H:77
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:121
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
Foam::fv::acousticDampingSource::w_
label w_
Stencil width, default = 20.
Definition: acousticDampingSource.H:105
Foam::Vector< scalar >
Foam::fv::acousticDampingSource::blendFactor_
volScalarField blendFactor_
Blending factor [].
Definition: acousticDampingSource.H:90
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:36
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76
Foam::GeometricField< scalar, fvPatchField, volMesh >