acousticWaveTransmissiveFvPatchField.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) 2020 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::acousticWaveTransmissiveFvPatchField
28 
29 Group
30  grpOutletBoundaryConditions
31 
32 Description
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  The wave speed is input in the BC.
37 
38 Usage
39  Example of the boundary condition specification:
40  \verbatim
41  <patchName>
42  {
43  // Mandatory entries (unmodifiable)
44  type acousticWaveTransmissive;
45  advectiveSpeed 50.0;
46 
47  // Mandatory/Optional (inherited) entries
48  ...
49  }
50  \endverbatim
51 
52  where the entries mean:
53  \table
54  Property | Description | Type | Reqd | Dflt
55  type | Type name: acousticWaveTransmissive | word | yes | -
56  advectiveSpeed | Advective speed value | scalar | yes | -
57  \endtable
58 
59  The inherited entries are elaborated in:
60  - \link advectiveFvPatchField.H \endlink
61 
62 See also
63  - Foam::advectiveFvPatchFields
64 
65 SourceFiles
66  acousticWaveTransmissiveFvPatchField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef acousticWaveTransmissiveFvPatchField_H
71 #define acousticWaveTransmissiveFvPatchField_H
72 
73 #include "advectiveFvPatchFields.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class acousticWaveTransmissiveFvPatchField Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 template<class Type>
85 class acousticWaveTransmissiveFvPatchField
86 :
87  public advectiveFvPatchField<Type>
88 {
89  // Private Data
90 
91  //- Advection speed value
92  scalar advectiveU_;
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("acousticWaveTransmissive");
99 
100 
101  // Constructors
102 
103  //- Construct from patch and internal field
105  (
106  const fvPatch&,
108  );
109 
110  //- Construct from patch, internal field and dictionary
112  (
113  const fvPatch&,
115  const dictionary&
116  );
117 
118  //- Construct by mapping given acousticWaveTransmissiveFvPatchField
119  //- onto a new patch
121  (
123  const fvPatch&,
125  const fvPatchFieldMapper&
126  );
127 
128  //- Construct as copy
130  (
132  );
133 
134  //- Construct and return a clone
135  virtual tmp<fvPatchField<Type>> clone() const
136  {
137  return tmp<fvPatchField<Type>>
138  (
140  );
141  }
142 
143  //- Construct as copy setting internal field reference
145  (
148  );
149 
150  //- Construct and return a clone setting internal field reference
152  (
154  ) const
155  {
156  return tmp<fvPatchField<Type>>
157  (
159  );
160  }
161 
162 
163  // Member Functions
164 
165  // Evaluation
166 
167  //- Calculate and return the advection speed at the boundary
168  virtual tmp<scalarField> advectionSpeed() const;
169 
170 
171  // IO
172 
173  //- Write
174  virtual void write(Ostream&) const;
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #ifdef NoRepository
186 #endif
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
advectiveFvPatchFields.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::acousticWaveTransmissiveFvPatchField::TypeName
TypeName("acousticWaveTransmissive")
Runtime type information.
Foam::acousticWaveTransmissiveFvPatchField
This boundary condition provides a wave transmissive outflow condition, based on solving DDt(W,...
Definition: acousticWaveTransmissiveFvPatchField.H:102
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::acousticWaveTransmissiveFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: acousticWaveTransmissiveFvPatchField.C:111
Foam::acousticWaveTransmissiveFvPatchField::advectionSpeed
virtual tmp< scalarField > advectionSpeed() const
Calculate and return the advection speed at the boundary.
Definition: acousticWaveTransmissiveFvPatchField.C:104
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
acousticWaveTransmissiveFvPatchField.C
Foam::acousticWaveTransmissiveFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: acousticWaveTransmissiveFvPatchField.H:152
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::acousticWaveTransmissiveFvPatchField::acousticWaveTransmissiveFvPatchField
acousticWaveTransmissiveFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: acousticWaveTransmissiveFvPatchField.C:40
Foam::advectiveFvPatchField
This boundary condition provides an advective outflow condition, based on solving DDt(W,...
Definition: advectiveFvPatchField.H:120
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54