fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / derived / supersonicFreestream / supersonicFreestreamFvPatchVectorField.H
blob62513161522b5c85cb3731343f4bb14b7f180a49
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::supersonicFreestreamFvPatchVectorField
28 Description
29     Supersonic free stream condition.
31     Supersonic outflow is vented according to ???
33     Supersonic inflow is assumed to occur according to the Prandtl-Meyer
34     expansion process.
36     Subsonic outflow is zero-gradiented from inside the domain.
38     N.B. This boundary condition is ill-posed if the free-stream flow is
39          normal to the boundary.
41 SourceFiles
42     supersonicFreestreamFvPatchVectorField.C
44 \*---------------------------------------------------------------------------*/
46 #ifndef supersonicFreestreamFvPatchVectorFields_H
47 #define supersonicFreestreamFvPatchVectorFields_H
49 #include "fvPatchFields.H"
50 #include "mixedFvPatchFields.H"
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 namespace Foam
57 /*---------------------------------------------------------------------------*\
58                            Class supersonicFreestreamFvPatch Declaration
59 \*---------------------------------------------------------------------------*/
61 class supersonicFreestreamFvPatchVectorField
63     public mixedFvPatchVectorField
65     // Private data
67         //- Velocity of the free stream
68         vector UInf_;
70         //- Pressure of the free stream
71         scalar pInf_;
73         //- Temperature of the free stream
74         scalar TInf_;
76         //- Heat capacity ratio
77         scalar gamma_;
80 public:
82     //- Runtime type information
83     TypeName("supersonicFreestream");
86     // Constructors
88         //- Construct from patch and internal field
89         supersonicFreestreamFvPatchVectorField
90         (
91             const fvPatch&,
92             const DimensionedField<vector, volMesh>&
93         );
95         //- Construct from patch, internal field and dictionary
96         supersonicFreestreamFvPatchVectorField
97         (
98             const fvPatch&,
99             const DimensionedField<vector, volMesh>&,
100             const dictionary&
101         );
103         //- Construct by mapping given supersonicFreestreamFvPatchVectorField
104         //  onto a new patch
105         supersonicFreestreamFvPatchVectorField
106         (
107             const supersonicFreestreamFvPatchVectorField&,
108             const fvPatch&,
109             const DimensionedField<vector, volMesh>&,
110             const fvPatchFieldMapper&
111         );
113         //- Construct as copy
114         supersonicFreestreamFvPatchVectorField
115         (
116             const supersonicFreestreamFvPatchVectorField&
117         );
119         //- Construct and return a clone
120         virtual tmp<fvPatchVectorField> clone() const
121         {
122             return tmp<fvPatchVectorField>
123             (
124                 new supersonicFreestreamFvPatchVectorField(*this)
125             );
126         }
128         //- Construct as copy setting internal field reference
129         supersonicFreestreamFvPatchVectorField
130         (
131             const supersonicFreestreamFvPatchVectorField&,
132             const DimensionedField<vector, volMesh>&
133         );
135         //- Construct and return a clone setting internal field reference
136         virtual tmp<fvPatchVectorField> clone
137         (
138             const DimensionedField<vector, volMesh>& iF
139         ) const
140         {
141             return tmp<fvPatchVectorField>
142             (
143                 new supersonicFreestreamFvPatchVectorField(*this, iF)
144             );
145         }
148     // Member functions
150         // Access
152             //- Return the velocity at infinity
153             const vector& UInf() const
154             {
155                 return UInf_;
156             }
158             //- Return reference to the velocity at infinity to allow adjustment
159             vector& UInf()
160             {
161                 return UInf_;
162             }
164             //- Return the pressure at infinity
165             scalar pInf() const
166             {
167                 return pInf_;
168             }
170             //- Return reference to the pressure at infinity to allow adjustment
171             scalar& pInf()
172             {
173                 return pInf_;
174             }
176             //- Return the temperature at infinity
177             scalar TInf() const
178             {
179                 return TInf_;
180             }
182             //- Return reference to the temperature at infinity 
183             //  to allow adjustment
184             scalar& TInf()
185             {
186                 return TInf_;
187             }
190         // Evaluation functions
192             //- Update the coefficients associated with the patch field
193             virtual void updateCoeffs();
196         //- Write
197         virtual void write(Ostream&) const;
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 } // End namespace Foam
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 #endif
209 // ************************************************************************* //