OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

supersonicFreestreamFvPatchVectorField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     supersonicFreestreamFvPatchVectorField
00027 
00028 Description
00029     Supersonic free stream condition.
00030 
00031     Supersonic outflow is vented according to ???
00032 
00033     Supersonic inflow is assumed to occur according to the Prandtl-Meyer
00034     expansion process.
00035 
00036     Subsonic outflow is zero-gradiented from inside the domain.
00037 
00038     N.B. This boundary condition is ill-posed if the free-stream flow is
00039          normal to the boundary.
00040 
00041 SourceFiles
00042     supersonicFreestreamFvPatchVectorField.C
00043 
00044 \*---------------------------------------------------------------------------*/
00045 
00046 #ifndef supersonicFreestreamFvPatchVectorFields_H
00047 #define supersonicFreestreamFvPatchVectorFields_H
00048 
00049 #include "fvPatchFields.H"
00050 #include "mixedFvPatchFields.H"
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 namespace Foam
00055 {
00056 
00057 /*---------------------------------------------------------------------------*\
00058                            Class supersonicFreestreamFvPatch Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 class supersonicFreestreamFvPatchVectorField
00062 :
00063     public mixedFvPatchVectorField
00064 {
00065     // Private data
00066 
00067         //- Velocity of the free stream
00068         vector UInf_;
00069 
00070         //- Pressure of the free stream
00071         scalar pInf_;
00072 
00073         //- Temperature of the free stream
00074         scalar TInf_;
00075 
00076         //- Heat capacity ratio
00077         scalar gamma_;
00078 
00079 
00080 public:
00081 
00082     //- Runtime type information
00083     TypeName("supersonicFreestream");
00084 
00085 
00086     // Constructors
00087 
00088         //- Construct from patch and internal field
00089         supersonicFreestreamFvPatchVectorField
00090         (
00091             const fvPatch&,
00092             const DimensionedField<vector, volMesh>&
00093         );
00094 
00095         //- Construct from patch, internal field and dictionary
00096         supersonicFreestreamFvPatchVectorField
00097         (
00098             const fvPatch&,
00099             const DimensionedField<vector, volMesh>&,
00100             const dictionary&
00101         );
00102 
00103         //- Construct by mapping given supersonicFreestreamFvPatchVectorField
00104         //  onto a new patch
00105         supersonicFreestreamFvPatchVectorField
00106         (
00107             const supersonicFreestreamFvPatchVectorField&,
00108             const fvPatch&,
00109             const DimensionedField<vector, volMesh>&,
00110             const fvPatchFieldMapper&
00111         );
00112 
00113         //- Construct as copy
00114         supersonicFreestreamFvPatchVectorField
00115         (
00116             const supersonicFreestreamFvPatchVectorField&
00117         );
00118 
00119         //- Construct and return a clone
00120         virtual tmp<fvPatchVectorField> clone() const
00121         {
00122             return tmp<fvPatchVectorField>
00123             (
00124                 new supersonicFreestreamFvPatchVectorField(*this)
00125             );
00126         }
00127 
00128         //- Construct as copy setting internal field reference
00129         supersonicFreestreamFvPatchVectorField
00130         (
00131             const supersonicFreestreamFvPatchVectorField&,
00132             const DimensionedField<vector, volMesh>&
00133         );
00134 
00135         //- Construct and return a clone setting internal field reference
00136         virtual tmp<fvPatchVectorField> clone
00137         (
00138             const DimensionedField<vector, volMesh>& iF
00139         ) const
00140         {
00141             return tmp<fvPatchVectorField>
00142             (
00143                 new supersonicFreestreamFvPatchVectorField(*this, iF)
00144             );
00145         }
00146 
00147 
00148     // Member functions
00149 
00150         // Access
00151 
00152             //- Return the velocity at infinity
00153             const vector& UInf() const
00154             {
00155                 return UInf_;
00156             }
00157 
00158             //- Return reference to the velocity at infinity to allow adjustment
00159             vector& UInf()
00160             {
00161                 return UInf_;
00162             }
00163 
00164             //- Return the pressure at infinity
00165             scalar pInf() const
00166             {
00167                 return pInf_;
00168             }
00169 
00170             //- Return reference to the pressure at infinity to allow adjustment
00171             scalar& pInf()
00172             {
00173                 return pInf_;
00174             }
00175 
00176             //- Return the temperature at infinity
00177             scalar TInf() const
00178             {
00179                 return TInf_;
00180             }
00181 
00182             //- Return reference to the temperature at infinity 
00183             //  to allow adjustment
00184             scalar& TInf()
00185             {
00186                 return TInf_;
00187             }
00188 
00189 
00190         // Evaluation functions
00191 
00192             //- Update the coefficients associated with the patch field
00193             virtual void updateCoeffs();
00194 
00195 
00196         //- Write
00197         virtual void write(Ostream&) const;
00198 };
00199 
00200 
00201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00202 
00203 } // End namespace Foam
00204 
00205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00206 
00207 #endif
00208 
00209 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd