The open source CFD toolbox
acousticWaveTransmissiveFvPatchField.C
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-------------------------------------------------------------------------------
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
26\*---------------------------------------------------------------------------*/
27
30#include "fvPatchFieldMapper.H"
31#include "volFields.H"
32#include "EulerDdtScheme.H"
34#include "backwardDdtScheme.H"
35
36// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37
38template<class Type>
40(
41 const fvPatch& p,
43)
44:
45 advectiveFvPatchField<Type>(p, iF),
46 advectiveU_(0)
47{}
48
49
50template<class Type>
52(
54 const fvPatch& p,
56 const fvPatchFieldMapper& mapper
57)
58:
59 advectiveFvPatchField<Type>(ptf, p, iF, mapper),
60 advectiveU_(ptf.advectiveU_)
61{}
62
63
64template<class Type>
66(
67 const fvPatch& p,
69 const dictionary& dict
70)
71:
72 advectiveFvPatchField<Type>(p, iF, dict),
73 advectiveU_(dict.get<scalar>("advectiveSpeed"))
74{}
75
76
77template<class Type>
79(
81)
82:
83 advectiveFvPatchField<Type>(ptpsf),
84 advectiveU_(ptpsf.advectiveU_)
85{}
86
87
88template<class Type>
90(
93)
94:
95 advectiveFvPatchField<Type>(ptpsf, iF),
96 advectiveU_(ptpsf.advectiveU_)
97{}
98
99
100// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101
102template<class Type>
105{
106 return tmp<scalarField>::New(this->size(), advectiveU_);
107}
108
109
110template<class Type>
112{
114 os.writeEntry("advectiveSpeed", advectiveU_);
115 this->writeEntry("value", os);
116}
117
118
119// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
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
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Definition: Ostream.H:239
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
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.
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
virtual bool write()
Write the output fields.
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
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
dictionary dict