Loading...
Searching...
No Matches
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>
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
138 const fvPatch&,
140 const fvPatchFieldMapper&
141 );
142
143 //- Construct as copy
145 (
147 );
148
149 //- Construct as copy setting internal field reference
151 (
154 );
155
156 //- Return a clone
157 virtual tmp<fvPatchField<Type>> clone() const
158 {
160 }
161
162 //- Clone with an internal field reference
164 (
166 ) const
167 {
168 return fvPatchField<Type>::Clone(*this, iF);
169 }
170
171
172 // Member functions
173
174 // Access
175
176 //- Return the heat capacity ratio
177 scalar gamma() const
178 {
179 return gamma_;
180 }
181
182 //- Return reference to the heat capacity ratio to allow adjustment
183 scalar& gamma()
184 {
185 return gamma_;
186 }
187
189 // Evaluation functions
190
191 //- Calculate and return the advection speed at the boundary
192 virtual tmp<scalarField> advectionSpeed() const;
193
194
195 //- Write
196 virtual void write(Ostream&) const;
197};
198
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202} // End namespace Foam
203
204// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
206#ifdef NoRepository
208#endif
209
210// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212#endif
213
214// ************************************************************************* //
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:59
This boundary condition provides an advective outflow condition, based on solving DDt(W,...
advectiveFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
This boundary condition provides a wave transmissive outflow condition, based on solving DDt(W,...
waveTransmissiveFvPatchField(const waveTransmissiveFvPatchField< Type > &, const fvPatch &, const DimensionedField< Type, volMesh > &, const fvPatchFieldMapper &)
Construct by mapping given waveTransmissiveFvPatchField.
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
Return a clone.
scalar gamma() const
Return the heat capacity ratio.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
TypeName("waveTransmissive")
Runtime type information.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68