OpenFOAM logo
Open Source CFD Toolkit

pressureTransmissiveFvPatchScalarField.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     pressureTransmissiveFvPatchScalarField
00027 
00028 Description
00029 
00030 SourceFiles
00031     pressureTransmissiveFvPatchScalarField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef pressureTransmissiveFvPatchScalarFields_H
00036 #define pressureTransmissiveFvPatchScalarFields_H
00037 
00038 #include "mixedFvPatchFields.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                  Class pressureTransmissiveFvPatch Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 class pressureTransmissiveFvPatchScalarField
00050 :
00051     public mixedFvPatchScalarField
00052 {
00053 
00054     // Private data
00055 
00056         //- Pressure of the free stream
00057         scalar pInf_;
00058 
00059         //- Relaxation length-scale
00060         scalar lInf_;
00061 
00062         //- Time index
00063         label curTimeIndex_;
00064 
00065         //- Old time patch field
00066         Field<scalar> pb0_;
00067 
00068         //- Old-old time patch field
00069         Field<scalar> pb00_;
00070 
00071 
00072 public:
00073 
00074     //- Runtime type information
00075     TypeName("pressureTransmissive");
00076 
00077 
00078     // Constructors
00079 
00080         //- Construct from patch and internal field
00081         pressureTransmissiveFvPatchScalarField
00082         (
00083             const fvPatch&,
00084             const scalarField&
00085         );
00086 
00087         //- Construct from patch, internal field and dictionary
00088         pressureTransmissiveFvPatchScalarField
00089         (
00090             const fvPatch&,
00091             const scalarField&,
00092             const dictionary&
00093         );
00094 
00095         //- Construct by mapping given pressureTransmissiveFvPatchScalarField
00096         //  onto a new patch
00097         pressureTransmissiveFvPatchScalarField
00098         (
00099             const pressureTransmissiveFvPatchScalarField&,
00100             const fvPatch&,
00101             const scalarField&,
00102             const fvPatchFieldMapper&
00103         );
00104 
00105         //- Construct and return a clone
00106         virtual tmp<fvPatchScalarField> clone() const
00107         {
00108             return tmp<fvPatchScalarField>
00109             (
00110                 new pressureTransmissiveFvPatchScalarField(*this)
00111             );
00112         }
00113 
00114         //- Construct as copy setting internal field reference
00115         pressureTransmissiveFvPatchScalarField
00116         (
00117             const pressureTransmissiveFvPatchScalarField&,
00118             const scalarField&
00119         );
00120 
00121         //- Construct and return a clone setting internal field reference
00122         virtual tmp<fvPatchScalarField> clone(const scalarField& iF) const
00123         {
00124             return tmp<fvPatchScalarField>
00125             (
00126                 new pressureTransmissiveFvPatchScalarField(*this, iF)
00127             );
00128         }
00129 
00130 
00131     // Member functions
00132 
00133         // Access
00134 
00135             //- Return the pressure at infinity
00136             scalar pInf() const
00137             {
00138                 return pInf_;
00139             }
00140 
00141             //- Return reference to the pressure at infinity to allow adjustment
00142             scalar& pInf()
00143             {
00144                 return pInf_;
00145             }
00146 
00147             //- Return the relaxation length-scale
00148             scalar lInf() const
00149             {
00150                 return lInf_;
00151             }
00152 
00153             //- Return reference to the relaxation length-scale
00154             //  to allow adjustment
00155             scalar& lInf()
00156             {
00157                 return lInf_;
00158             }
00159 
00160 
00161         // Mapping functions
00162 
00163             //- Map (and resize as needed) from self given a mapping object
00164             virtual void autoMap
00165             (
00166                 const fvPatchFieldMapper&
00167             );
00168 
00169             //- Reverse map the given fvPatchField onto this fvPatchField
00170             virtual void rmap
00171             (
00172                 const fvPatchField<scalar>&,
00173                 const labelList&
00174             );
00175 
00176 
00177         // Evaluation functions
00178 
00179             //- Update the coefficients associated with the patch field
00180             virtual void updateCoeffs();
00181 
00182 
00183         //- Write
00184         virtual void write(Ostream&) const;
00185 };
00186 
00187 
00188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00189 
00190 } // End namespace Foam
00191 
00192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00193 
00194 #endif
00195 
00196 // ************************************************************************* //
For further information go to www.openfoam.org