waveTransmissiveFvPatchField.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) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::waveTransmissiveFvPatchField
28
29Group
30 grpOutletBoundaryConditions
31
32Description
33 This boundary condition provides a wave transmissive outflow condition,
34 based on solving DDt(W, field) = 0 at the boundary \c W is the wave velocity
35 and \c field is the field to which this boundary condition is applied.
36
37 The wave speed is calculated using:
38
39 \f[
40 w_p = \frac{\phi_p}{|Sf|} + \sqrt{\frac{\gamma}{\psi_p}}
41 \f]
42
43 where
44
45 \vartable
46 w_p | patch wave speed
47 \phi_p | patch face flux
48 \psi_p | patch compressibility
49 Sf | patch face area vector
50 \gamma | ratio of specific heats
51 \endvartable
52
53Usage
54 \table
55 Property | Description | Required | Default value
56 phi | flux field name | no | phi
57 rho | density field name | no | rho
58 psi | compressibility field name | no | thermo:psi
59 gamma | ratio of specific heats (Cp/Cv) | yes |
60 \endtable
61
62 Example of the boundary condition specification:
63 \verbatim
64 <patchName>
65 {
66 type waveTransmissive;
67 phi phi;
68 psi psi;
69 gamma 1.4;
70 }
71 \endverbatim
72
73See also
74 Foam::advectiveFvPatchField
75
76SourceFiles
77 waveTransmissiveFvPatchField.C
78
79\*---------------------------------------------------------------------------*/
80
81#ifndef waveTransmissiveFvPatchField_H
82#define waveTransmissiveFvPatchField_H
83
85
86// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87
88namespace Foam
89{
90
91/*---------------------------------------------------------------------------*\
92 Class waveTransmissiveFvPatchField Declaration
93\*---------------------------------------------------------------------------*/
94
95template<class Type>
96class waveTransmissiveFvPatchField
97:
98 public advectiveFvPatchField<Type>
99{
100
101 // Private data
102
103 //- Name of the compressibility field used to calculate the wave speed
104 word psiName_;
105
106 //- Heat capacity ratio
107 scalar gamma_;
108
109
110public:
111
112 //- Runtime type information
113 TypeName("waveTransmissive");
114
115
116 // Constructors
117
118 //- Construct from patch and internal field
120 (
121 const fvPatch&,
122 const DimensionedField<Type, volMesh>&
123 );
124
125 //- Construct from patch, internal field and dictionary
127 (
128 const fvPatch&,
129 const DimensionedField<Type, volMesh>&,
130 const dictionary&
131 );
132
133 //- Construct by mapping given waveTransmissiveFvPatchField
134 // onto a new patch
136 (
137 const waveTransmissiveFvPatchField<Type>&,
138 const fvPatch&,
139 const DimensionedField<Type, volMesh>&,
141 );
142
143 //- Construct as copy
145 (
147 );
148
149 //- Construct and return a clone
150 virtual tmp<fvPatchField<Type>> clone() const
151 {
153 (
155 );
156 }
158 //- Construct as copy setting internal field reference
160 (
163 );
164
165 //- Construct and return a clone setting internal field reference
167 (
169 ) const
170 {
172 (
174 );
175 }
176
177
178 // Member functions
180 // Access
181
182 //- Return the heat capacity ratio
183 scalar gamma() const
184 {
185 return gamma_;
186 }
187
188 //- Return reference to the heat capacity ratio to allow adjustment
189 scalar& gamma()
190 {
191 return gamma_;
192 }
193
195 // Evaluation functions
196
197 //- Calculate and return the advection speed at the boundary
198 virtual tmp<scalarField> advectionSpeed() const;
199
200
201 //- Write
202 virtual void write(Ostream&) const;
203};
204
205
206// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207
208} // End namespace Foam
209
210// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212#ifdef NoRepository
214#endif
215
216// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217
218#endif
219
220// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
This boundary condition provides an advective outflow condition, based on solving DDt(W,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
This boundary condition provides a wave transmissive outflow condition, based on solving DDt(W,...
scalar & gamma()
Return reference to the heat capacity ratio to allow adjustment.
waveTransmissiveFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< scalarField > advectionSpeed() const
Calculate and return the advection speed at the boundary.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
scalar gamma() const
Return the heat capacity ratio.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("waveTransmissive")
Runtime type information.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73