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

waveTransmissiveFvPatchField.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     waveTransmissiveFvPatchField
00027 
00028 Description
00029 
00030 SourceFiles
00031     waveTransmissiveFvPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef waveTransmissiveFvPatchField_H
00036 #define waveTransmissiveFvPatchField_H
00037 
00038 #include "mixedFvPatchFields.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                  Class waveTransmissiveFvPatch Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template<class Type>
00050 class waveTransmissiveFvPatchField
00051 :
00052     public mixedFvPatchField<Type>
00053 {
00054 
00055     // Private data
00056 
00057         //- Name of the field
00058         word fieldName_;
00059 
00060         //- Name of the flux transporting the field
00061         word phiName_;
00062 
00063         //- Name of the density field used to normalise the mass flux
00064         //  if neccessary
00065         word rhoName_;
00066 
00067         //- Name of the compressibility field used to calculate the wave speed
00068         word psiName_;
00069 
00070         //- Heat capacity ratio
00071         scalar gamma_;
00072 
00073         //- Field value of the far-field
00074         Type fieldInf_;
00075 
00076         //- Relaxation length-scale
00077         scalar lInf_;
00078 
00079 
00080 public:
00081 
00082     //- Runtime type information
00083     TypeName("waveTransmissive");
00084 
00085 
00086     // Constructors
00087 
00088         //- Construct from patch and internal field
00089         waveTransmissiveFvPatchField
00090         (
00091             const fvPatch&,
00092             const DimensionedField<Type, volMesh>&
00093         );
00094 
00095         //- Construct from patch, internal field and dictionary
00096         waveTransmissiveFvPatchField
00097         (
00098             const fvPatch&,
00099             const DimensionedField<Type, volMesh>&,
00100             const dictionary&
00101         );
00102 
00103         //- Construct by mapping given waveTransmissiveFvPatchField
00104         //  onto a new patch
00105         waveTransmissiveFvPatchField
00106         (
00107             const waveTransmissiveFvPatchField<Type>&,
00108             const fvPatch&,
00109             const DimensionedField<Type, volMesh>&,
00110             const fvPatchFieldMapper&
00111         );
00112 
00113         //- Construct as copy
00114         waveTransmissiveFvPatchField
00115         (
00116             const waveTransmissiveFvPatchField&
00117         );
00118 
00119         //- Construct and return a clone
00120         virtual tmp<fvPatchField<Type> > clone() const
00121         {
00122             return tmp<fvPatchField<Type> >
00123             (
00124                 new waveTransmissiveFvPatchField<Type>(*this)
00125             );
00126         }
00127 
00128         //- Construct as copy setting internal field reference
00129         waveTransmissiveFvPatchField
00130         (
00131             const waveTransmissiveFvPatchField&,
00132             const DimensionedField<Type, volMesh>&
00133         );
00134 
00135         //- Construct and return a clone setting internal field reference
00136         virtual tmp<fvPatchField<Type> > clone
00137         (
00138             const DimensionedField<Type, volMesh>& iF
00139         ) const
00140         {
00141             return tmp<fvPatchField<Type> >
00142             (
00143                 new waveTransmissiveFvPatchField<Type>(*this, iF)
00144             );
00145         }
00146 
00147 
00148     // Member functions
00149 
00150         // Access
00151 
00152             //- Return the field at infinity
00153             const Type& fieldInf() const
00154             {
00155                 return fieldInf_;
00156             }
00157 
00158             //- Return reference to the field at infinity to allow adjustment
00159             Type& fieldInf()
00160             {
00161                 return fieldInf_;
00162             }
00163 
00164             //- Return the heat capacity ratio
00165             scalar gamma() const
00166             {
00167                 return gamma_;
00168             }
00169 
00170             //- Return reference to the heat capacity ratio to allow adjustment
00171             scalar& gamma()
00172             {
00173                 return gamma_;
00174             }
00175 
00176             //- Return the relaxation length-scale
00177             scalar lInf() const
00178             {
00179                 return lInf_;
00180             }
00181 
00182             //- Return reference to the relaxation length-scale
00183             //  to allow adjustment
00184             scalar& lInf()
00185             {
00186                 return lInf_;
00187             }
00188 
00189 
00190         // Mapping functions
00191 
00192             //- Map (and resize as needed) from self given a mapping object
00193             virtual void autoMap
00194             (
00195                 const fvPatchFieldMapper&
00196             );
00197 
00198             //- Reverse map the given fvPatchField onto this fvPatchField
00199             virtual void rmap
00200             (
00201                 const fvPatchField<Type>&,
00202                 const labelList&
00203             );
00204 
00205 
00206         // Evaluation functions
00207 
00208             //- Update the coefficients associated with the patch field
00209             virtual void updateCoeffs();
00210 
00211 
00212         //- Write
00213         virtual void write(Ostream&) const;
00214 };
00215 
00216 
00217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00218 
00219 } // End namespace Foam
00220 
00221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00222 
00223 #ifdef NoRepository
00224 #   include "waveTransmissiveFvPatchField.C"
00225 #endif
00226 
00227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00228 
00229 #endif
00230 
00231 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd