1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::totalPressureFvPatchScalarField
28 Foam::totalPressureFvPatchScalarField
31 totalPressureFvPatchScalarField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef totalPressureFvPatchScalarField_H
36 #define totalPressureFvPatchScalarField_H
38 #include "fixedValueFvPatchFields.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class totalPressureFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
49 class totalPressureFvPatchScalarField
51 public fixedValueFvPatchScalarField
55 //- Name of the velocity field
58 //- Name of the flux transporting the field
61 //- Name of the density field used to normalise the mass flux
65 //- Name of the compressibility field used to calculate the wave speed
68 //- Heat capacity ratio
77 //- Runtime type information
78 TypeName("totalPressure");
83 //- Construct from patch and internal field
84 totalPressureFvPatchScalarField
87 const DimensionedField<scalar, volMesh>&
90 //- Construct from patch, internal field and dictionary
91 totalPressureFvPatchScalarField
94 const DimensionedField<scalar, volMesh>&,
98 //- Construct by mapping given totalPressureFvPatchScalarField
100 totalPressureFvPatchScalarField
102 const totalPressureFvPatchScalarField&,
104 const DimensionedField<scalar, volMesh>&,
105 const fvPatchFieldMapper&
108 //- Construct as copy
109 totalPressureFvPatchScalarField
111 const totalPressureFvPatchScalarField&
114 //- Construct and return a clone
115 virtual tmp<fvPatchScalarField> clone() const
117 return tmp<fvPatchScalarField>
119 new totalPressureFvPatchScalarField(*this)
123 //- Construct as copy setting internal field reference
124 totalPressureFvPatchScalarField
126 const totalPressureFvPatchScalarField&,
127 const DimensionedField<scalar, volMesh>&
130 //- Construct and return a clone setting internal field reference
131 virtual tmp<fvPatchScalarField> clone
133 const DimensionedField<scalar, volMesh>& iF
136 return tmp<fvPatchScalarField>
138 new totalPressureFvPatchScalarField(*this, iF)
147 //- Return the name of the velocity field
148 const word& UName() const
153 //- Return reference to the name of the velocity field
154 // to allow adjustment
160 //- Return the heat capacity ratio
166 //- Return reference to the heat capacity ratio to allow adjustment
172 //- Return the total pressure
173 const scalarField& p0() const
178 //- Return reference to the total pressure to allow adjustment
187 //- Map (and resize as needed) from self given a mapping object
190 const fvPatchFieldMapper&
193 //- Reverse map the given fvPatchField onto this fvPatchField
196 const fvPatchScalarField&,
201 // Evaluation functions
203 //- Update the coefficients associated with the patch field
204 // using the given patch velocity field
205 virtual void updateCoeffs(const vectorField& Up);
207 //- Update the coefficients associated with the patch field
208 virtual void updateCoeffs();
212 virtual void write(Ostream&) const;
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 } // End namespace Foam
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 // ************************************************************************* //