FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::supersonicFreestreamFvPatchVectorField
00026 
00027 Description
00028     Supersonic free stream condition.
00029 
00030     Supersonic outflow is vented according to ???
00031 
00032     Supersonic inflow is assumed to occur according to the Prandtl-Meyer
00033     expansion process.
00034 
00035     Subsonic outflow is zero-gradiented from inside the domain.
00036 
00037     N.B. This boundary condition is ill-posed if the free-stream flow is
00038          normal to the boundary.
00039 
00040 SourceFiles
00041     supersonicFreestreamFvPatchVectorField.C
00042 
00043 \*---------------------------------------------------------------------------*/
00044 
00045 #ifndef supersonicFreestreamFvPatchVectorFields_H
00046 #define supersonicFreestreamFvPatchVectorFields_H
00047 
00048 #include <finiteVolume/fvPatchFields.H>
00049 #include <finiteVolume/mixedFvPatchFields.H>
00050 
00051 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00052 
00053 namespace Foam
00054 {
00055 
00056 /*---------------------------------------------------------------------------*\
00057                            Class supersonicFreestreamFvPatch Declaration
00058 \*---------------------------------------------------------------------------*/
00059 
00060 class supersonicFreestreamFvPatchVectorField
00061 :
00062     public mixedFvPatchVectorField
00063 {
00064     // Private data
00065 
00066         //- Velocity of the free stream
00067         vector UInf_;
00068 
00069         //- Pressure of the free stream
00070         scalar pInf_;
00071 
00072         //- Temperature of the free stream
00073         scalar TInf_;
00074 
00075         //- Heat capacity ratio
00076         scalar gamma_;
00077 
00078 
00079 public:
00080 
00081     //- Runtime type information
00082     TypeName("supersonicFreestream");
00083 
00084 
00085     // Constructors
00086 
00087         //- Construct from patch and internal field
00088         supersonicFreestreamFvPatchVectorField
00089         (
00090             const fvPatch&,
00091             const DimensionedField<vector, volMesh>&
00092         );
00093 
00094         //- Construct from patch, internal field and dictionary
00095         supersonicFreestreamFvPatchVectorField
00096         (
00097             const fvPatch&,
00098             const DimensionedField<vector, volMesh>&,
00099             const dictionary&
00100         );
00101 
00102         //- Construct by mapping given supersonicFreestreamFvPatchVectorField
00103         //  onto a new patch
00104         supersonicFreestreamFvPatchVectorField
00105         (
00106             const supersonicFreestreamFvPatchVectorField&,
00107             const fvPatch&,
00108             const DimensionedField<vector, volMesh>&,
00109             const fvPatchFieldMapper&
00110         );
00111 
00112         //- Construct as copy
00113         supersonicFreestreamFvPatchVectorField
00114         (
00115             const supersonicFreestreamFvPatchVectorField&
00116         );
00117 
00118         //- Construct and return a clone
00119         virtual tmp<fvPatchVectorField> clone() const
00120         {
00121             return tmp<fvPatchVectorField>
00122             (
00123                 new supersonicFreestreamFvPatchVectorField(*this)
00124             );
00125         }
00126 
00127         //- Construct as copy setting internal field reference
00128         supersonicFreestreamFvPatchVectorField
00129         (
00130             const supersonicFreestreamFvPatchVectorField&,
00131             const DimensionedField<vector, volMesh>&
00132         );
00133 
00134         //- Construct and return a clone setting internal field reference
00135         virtual tmp<fvPatchVectorField> clone
00136         (
00137             const DimensionedField<vector, volMesh>& iF
00138         ) const
00139         {
00140             return tmp<fvPatchVectorField>
00141             (
00142                 new supersonicFreestreamFvPatchVectorField(*this, iF)
00143             );
00144         }
00145 
00146 
00147     // Member functions
00148 
00149         // Access
00150 
00151             //- Return the velocity at infinity
00152             const vector& UInf() const
00153             {
00154                 return UInf_;
00155             }
00156 
00157             //- Return reference to the velocity at infinity to allow adjustment
00158             vector& UInf()
00159             {
00160                 return UInf_;
00161             }
00162 
00163             //- Return the pressure at infinity
00164             scalar pInf() const
00165             {
00166                 return pInf_;
00167             }
00168 
00169             //- Return reference to the pressure at infinity to allow adjustment
00170             scalar& pInf()
00171             {
00172                 return pInf_;
00173             }
00174 
00175             //- Return the temperature at infinity
00176             scalar TInf() const
00177             {
00178                 return TInf_;
00179             }
00180 
00181             //- Return reference to the temperature at infinity 
00182             //  to allow adjustment
00183             scalar& TInf()
00184             {
00185                 return TInf_;
00186             }
00187 
00188 
00189         // Evaluation functions
00190 
00191             //- Update the coefficients associated with the patch field
00192             virtual void updateCoeffs();
00193 
00194 
00195         //- Write
00196         virtual void write(Ostream&) const;
00197 };
00198 
00199 
00200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00201 
00202 } // End namespace Foam
00203 
00204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00205 
00206 #endif
00207 
00208 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines