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 as copy setting internal field reference
136  (
139  );
140 
141  //- Return a clone
142  virtual tmp<fvPatchField<Type>> clone() const
143  {
144  return fvPatchField<Type>::Clone(*this);
145  }
146 
147  //- Clone with an internal field reference
149  (
151  ) const
152  {
153  return fvPatchField<Type>::Clone(*this, iF);
154  }
155 
156 
157  // Member Functions
158 
159  // Evaluation
160 
161  //- Calculate and return the advection speed at the boundary
162  virtual tmp<scalarField> advectionSpeed() const;
163 
164 
165  // IO
166 
167  //- Write
168  virtual void write(Ostream&) const;
169 };
170 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #ifdef NoRepository
180 #endif
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
A FieldMapper for finite-volume patch fields.
TypeName("acousticWaveTransmissive")
Runtime type information.
This boundary condition provides a wave transmissive outflow condition, based on solving DDt(W...
virtual tmp< scalarField > advectionSpeed() const
Calculate and return the advection speed at the boundary.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
acousticWaveTransmissiveFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.