OpenFOAM logo
Open Source CFD Toolkit

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-2005 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 
00077 public:
00078 
00079     //- Runtime type information
00080     TypeName("supersonicFreestream");
00081 
00082 
00083     // Constructors
00084 
00085         //- Construct from patch and internal field
00086         supersonicFreestreamFvPatchVectorField
00087         (
00088             const fvPatch&,
00089             const vectorField&
00090         );
00091 
00092         //- Construct from patch, internal field and dictionary
00093         supersonicFreestreamFvPatchVectorField
00094         (
00095             const fvPatch&,
00096             const vectorField&,
00097             const dictionary&
00098         );
00099 
00100         //- Construct by mapping given supersonicFreestreamFvPatchVectorField
00101         //  onto a new patch
00102         supersonicFreestreamFvPatchVectorField
00103         (
00104             const supersonicFreestreamFvPatchVectorField&,
00105             const fvPatch&,
00106             const vectorField&,
00107             const fvPatchFieldMapper&
00108         );
00109 
00110         //- Construct and return a clone
00111         virtual tmp<fvPatchVectorField> clone() const
00112         {
00113             return tmp<fvPatchVectorField>
00114             (
00115                 new supersonicFreestreamFvPatchVectorField(*this)
00116             );
00117         }
00118 
00119         //- Construct as copy setting internal field reference
00120         supersonicFreestreamFvPatchVectorField
00121         (
00122             const supersonicFreestreamFvPatchVectorField&,
00123             const vectorField&
00124         );
00125 
00126         //- Construct and return a clone setting internal field reference
00127         virtual tmp<fvPatchVectorField> clone(const vectorField& iF) const
00128         {
00129             return tmp<fvPatchVectorField>
00130             (
00131                 new supersonicFreestreamFvPatchVectorField(*this, iF)
00132             );
00133         }
00134 
00135 
00136     // Member functions
00137 
00138         // Access
00139 
00140             //- Return the velocity at infinity
00141             const vector& UInf() const
00142             {
00143                 return UInf_;
00144             }
00145 
00146             //- Return reference to the velocity at infinity to allow adjustment
00147             vector& UInf()
00148             {
00149                 return UInf_;
00150             }
00151 
00152             //- Return the pressure at infinity
00153             scalar pInf() const
00154             {
00155                 return pInf_;
00156             }
00157 
00158             //- Return reference to the pressure at infinity to allow adjustment
00159             scalar& pInf()
00160             {
00161                 return pInf_;
00162             }
00163 
00164             //- Return the temperature at infinity
00165             scalar TInf() const
00166             {
00167                 return TInf_;
00168             }
00169 
00170             //- Return reference to the temperature at infinity 
00171             //  to allow adjustment
00172             scalar& TInf()
00173             {
00174                 return TInf_;
00175             }
00176 
00177 
00178         // Evaluation functions
00179 
00180             //- Update the coefficients associated with the patch field
00181             virtual void updateCoeffs();
00182 
00183 
00184         //- Write
00185         virtual void write(Ostream&) const;
00186 };
00187 
00188 
00189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00190 
00191 } // End namespace Foam
00192 
00193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00194 
00195 #endif
00196 
00197 // ************************************************************************* //
For further information go to www.openfoam.org