Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / thermophysicalModels / basic / derivedFvPatchFields / isentropicTotalTemperature / isentropicTotalTemperatureFvPatchScalarField.H
bloba9605a216e7e9a7ea8521079d1be72e01f7fb456
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::isentropicTotalTemperatureFvPatchScalarField
27 Description
28     Isentropic total temperature boundary condition.  The snGrad is set to
29     zero to stop back-diffusion
31 SourceFiles
32     isentropicTotalTemperatureFvPatchScalarField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef isentropicTotalTemperatureFvPatchScalarField_H
37 #define isentropicTotalTemperatureFvPatchScalarField_H
39 #include "fixedValueFvPatchFields.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47          Class isentropicTotalTemperatureFvPatchScalarField Declaration
48 \*---------------------------------------------------------------------------*/
50 class isentropicTotalTemperatureFvPatchScalarField
52     public fixedValueFvPatchScalarField
54     // Private data
56         //- Name of the static pressure field
57         word pName_;
59         //- Total temperature field
60         scalarField T0_;
63 public:
65     //- Runtime type information
66     TypeName("isentropicTotalTemperature");
69     // Constructors
71         //- Construct from patch and internal field
72         isentropicTotalTemperatureFvPatchScalarField
73         (
74             const fvPatch&,
75             const DimensionedField<scalar, volMesh>&
76         );
78         //- Construct from patch, internal field and dictionary
79         isentropicTotalTemperatureFvPatchScalarField
80         (
81             const fvPatch&,
82             const DimensionedField<scalar, volMesh>&,
83             const dictionary&
84         );
86         //- Construct by mapping given
87         //  isentropicTotalTemperatureFvPatchScalarField onto a new patch
88         isentropicTotalTemperatureFvPatchScalarField
89         (
90             const isentropicTotalTemperatureFvPatchScalarField&,
91             const fvPatch&,
92             const DimensionedField<scalar, volMesh>&,
93             const fvPatchFieldMapper&
94         );
96         //- Construct as copy
97         isentropicTotalTemperatureFvPatchScalarField
98         (
99             const isentropicTotalTemperatureFvPatchScalarField&
100         );
102         //- Construct and return a clone
103         virtual tmp<fvPatchScalarField> clone() const
104         {
105             return tmp<fvPatchScalarField>
106             (
107                 new isentropicTotalTemperatureFvPatchScalarField(*this)
108             );
109         }
111         //- Construct as copy setting internal field reference
112         isentropicTotalTemperatureFvPatchScalarField
113         (
114             const isentropicTotalTemperatureFvPatchScalarField&,
115             const DimensionedField<scalar, volMesh>&
116         );
118         //- Construct and return a clone setting internal field reference
119         virtual tmp<fvPatchScalarField> clone
120         (
121             const DimensionedField<scalar, volMesh>& iF
122         ) const
123         {
124             return tmp<fvPatchScalarField>
125             (
126                 new isentropicTotalTemperatureFvPatchScalarField(*this, iF)
127             );
128         }
131     // Member functions
133         // Access
135             //- Return the total pressure
136             const scalarField& T0() const
137             {
138                 return T0_;
139             }
141             //- Return reference to the total pressure to allow adjustment
142             scalarField& T0()
143             {
144                 return T0_;
145             }
148         // Mapping functions
150             //- Map (and resize as needed) from self given a mapping object
151             virtual void autoMap
152             (
153                 const fvPatchFieldMapper&
154             );
156             //- Reverse map the given fvPatchField onto this fvPatchField
157             virtual void rmap
158             (
159                 const fvPatchScalarField&,
160                 const labelList&
161             );
164         // Evaluation functions
166             //- Update the coefficients associated with the patch field
167             //  using the given patch velocity field
168             virtual void updateCoeffs(const vectorField& Up);
170             //- Update the coefficients associated with the patch field
171             virtual void updateCoeffs();
173             //- Return patch-normal gradient: set to zero
174             virtual tmp<scalarField> snGrad() const;
176             //- Return the matrix diagonal coefficients corresponding to the
177             //  evaluation of the gradient of this patchField
178             //  Removed gradient contribution
179             virtual tmp<scalarField> gradientInternalCoeffs() const;
181             //- Return the matrix source coefficients corresponding to the
182             //  evaluation of the gradient of this patchField
183             virtual tmp<scalarField> gradientBoundaryCoeffs() const;
186         //- Write
187         virtual void write(Ostream&) const;
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 } // End namespace Foam
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 #endif
199 // ************************************************************************* //