1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::timeVaryingUniformTotalPressureFvPatchScalarField
29 A time-varying form of a uniform total pressure boundary condition.
32 Foam::timeVaryingUniformFixedValueFvPatchField
33 and Foam::totalPressureFvPatchScalarField.H
36 timeVaryingUniformTotalPressureFvPatchScalarField.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef timeVaryingUniformTotalPressureFvPatchScalarField_H
41 #define timeVaryingUniformTotalPressureFvPatchScalarField_H
43 #include "fixedValueFvPatchFields.H"
44 #include "interpolationTable.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class timeVaryingTotalPressureFvPatch Declaration
53 \*---------------------------------------------------------------------------*/
55 class timeVaryingUniformTotalPressureFvPatchScalarField
57 public fixedValueFvPatchScalarField
61 //- Name of the velocity field
64 //- Name of the flux transporting the field
67 //- Name of the density field used to normalise the mass flux
71 //- Name of the compressibility field used to calculate the wave speed
74 //- Heat capacity ratio
80 //- Table of time vs total pressure, including the bounding treatment
81 interpolationTable<scalar> timeSeries_;
86 //- Runtime type information
87 TypeName("timeVaryingTotalPressure");
92 //- Construct from patch and internal field
93 timeVaryingUniformTotalPressureFvPatchScalarField
96 const DimensionedField<scalar, volMesh>&
99 //- Construct from patch, internal field and dictionary
100 timeVaryingUniformTotalPressureFvPatchScalarField
103 const DimensionedField<scalar, volMesh>&,
107 //- Construct by mapping given patch field onto a new patch
108 timeVaryingUniformTotalPressureFvPatchScalarField
110 const timeVaryingUniformTotalPressureFvPatchScalarField&,
112 const DimensionedField<scalar, volMesh>&,
113 const fvPatchFieldMapper&
116 //- Construct as copy
117 timeVaryingUniformTotalPressureFvPatchScalarField
119 const timeVaryingUniformTotalPressureFvPatchScalarField&
122 //- Construct and return a clone
123 virtual tmp<fvPatchScalarField> clone() const
125 return tmp<fvPatchScalarField>
127 new timeVaryingUniformTotalPressureFvPatchScalarField(*this)
131 //- Construct as copy setting internal field reference
132 timeVaryingUniformTotalPressureFvPatchScalarField
134 const timeVaryingUniformTotalPressureFvPatchScalarField&,
135 const DimensionedField<scalar, volMesh>&
138 //- Construct and return a clone setting internal field reference
139 virtual tmp<fvPatchScalarField> clone
141 const DimensionedField<scalar, volMesh>& iF
144 return tmp<fvPatchScalarField>
146 new timeVaryingUniformTotalPressureFvPatchScalarField(*this, iF)
155 //- Return the name of the velocity field
156 const word& UName() const
161 //- Return reference to the name of the velocity field
162 // to allow adjustment
168 //- Return the heat capacity ratio
174 //- Return reference to the heat capacity ratio to allow adjustment
180 //- Return the total pressure
186 //- Return reference to the total pressure to allow adjustment
192 //- Return the time series used
193 const interpolationTable<scalar>& totalPressureTimeSeries() const
199 // Evaluation functions
201 //- Update the coefficients associated with the patch field
202 // using the given patch velocity field
203 virtual void updateCoeffs(const vectorField& Up);
205 //- Update the coefficients associated with the patch field
206 virtual void updateCoeffs();
210 virtual void write(Ostream&) const;
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 // ************************************************************************* //