OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

CoEulerDdtScheme.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-2009 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     Foam::fv::CoEulerDdtScheme
00027 
00028 Description
00029     Courant number limited first-order Euler implicit/explicit ddt.
00030 
00031     The time-step is adjusted locally so that the local Courant number
00032     does not exceed the specified value.
00033 
00034     This scheme should only be used for steady-state computations
00035     using transient codes where local time-stepping is preferably to
00036     under-relaxation for transport consistency reasons.
00037 
00038 SourceFiles
00039     CoEulerDdtScheme.C
00040 
00041 \*---------------------------------------------------------------------------*/
00042 
00043 #ifndef CoEulerDdtScheme_H
00044 #define CoEulerDdtScheme_H
00045 
00046 #include "ddtScheme.H"
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace Foam
00051 {
00052 
00053 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00054 
00055 namespace fv
00056 {
00057 
00058 /*---------------------------------------------------------------------------*\
00059                        Class CoEulerDdtScheme Declaration
00060 \*---------------------------------------------------------------------------*/
00061 
00062 template<class Type>
00063 class CoEulerDdtScheme
00064 :
00065     public fv::ddtScheme<Type>
00066 {
00067     // Private Data
00068 
00069         //- Name of the flux field used to calculate the local time-step
00070         word phiName_;
00071 
00072         //- Name of the density field used to obtain the volumetric flux
00073         //  from the mass flux if required
00074         word rhoName_;
00075 
00076         //- Maximum local Courant number
00077         scalar maxCo_;
00078 
00079 
00080     // Private Member Functions
00081 
00082         //- Disallow default bitwise copy construct
00083         CoEulerDdtScheme(const CoEulerDdtScheme&);
00084 
00085         //- Disallow default bitwise assignment
00086         void operator=(const CoEulerDdtScheme&);
00087 
00088         //- Return the reciprocal of the Courant-number limited time-step
00089         tmp<volScalarField> CorDeltaT() const;
00090 
00091         //- Return the reciprocal of the face-Courant-number limited time-step
00092         tmp<surfaceScalarField> CofrDeltaT() const;
00093 
00094 
00095 public:
00096 
00097     //- Runtime type information
00098     TypeName("CoEuler");
00099 
00100 
00101     // Constructors
00102 
00103         //- Construct from mesh and Istream
00104         CoEulerDdtScheme(const fvMesh& mesh, Istream& is)
00105         :
00106             ddtScheme<Type>(mesh, is),
00107             phiName_(is),
00108             rhoName_(is),
00109             maxCo_(readScalar(is))
00110         {}
00111 
00112 
00113     // Member Functions
00114 
00115         //- Return mesh reference
00116         const fvMesh& mesh() const
00117         {
00118             return fv::ddtScheme<Type>::mesh();
00119         }
00120 
00121         tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
00122         (
00123             const dimensioned<Type>&
00124         );
00125 
00126         tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
00127         (
00128             const GeometricField<Type, fvPatchField, volMesh>&
00129         );
00130 
00131         tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
00132         (
00133             const dimensionedScalar&,
00134             const GeometricField<Type, fvPatchField, volMesh>&
00135         );
00136 
00137         tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
00138         (
00139             const volScalarField&,
00140             const GeometricField<Type, fvPatchField, volMesh>&
00141         );
00142 
00143         tmp<fvMatrix<Type> > fvmDdt
00144         (
00145             GeometricField<Type, fvPatchField, volMesh>&
00146         );
00147 
00148         tmp<fvMatrix<Type> > fvmDdt
00149         (
00150             const dimensionedScalar&,
00151             GeometricField<Type, fvPatchField, volMesh>&
00152         );
00153 
00154         tmp<fvMatrix<Type> > fvmDdt
00155         (
00156             const volScalarField&,
00157             GeometricField<Type, fvPatchField, volMesh>&
00158         );
00159 
00160         typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType;
00161 
00162         tmp<fluxFieldType> fvcDdtPhiCorr
00163         (
00164             const volScalarField& rA,
00165             const GeometricField<Type, fvPatchField, volMesh>& U,
00166             const fluxFieldType& phi
00167         );
00168 
00169         tmp<fluxFieldType> fvcDdtPhiCorr
00170         (
00171             const volScalarField& rA,
00172             const volScalarField& rho,
00173             const GeometricField<Type, fvPatchField, volMesh>& U,
00174             const fluxFieldType& phi
00175         );
00176 
00177         tmp<surfaceScalarField> meshPhi
00178         (
00179             const GeometricField<Type, fvPatchField, volMesh>&
00180         );
00181 };
00182 
00183 
00184 template<>
00185 tmp<surfaceScalarField> CoEulerDdtScheme<scalar>::fvcDdtPhiCorr
00186 (
00187     const volScalarField& rA,
00188     const volScalarField& U,
00189     const surfaceScalarField& phi
00190 );
00191 
00192 
00193 template<>
00194 tmp<surfaceScalarField> CoEulerDdtScheme<scalar>::fvcDdtPhiCorr
00195 (
00196     const volScalarField& rA,
00197     const volScalarField& rho,
00198     const volScalarField& U,
00199     const surfaceScalarField& phi
00200 );
00201 
00202 
00203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00204 
00205 } // End namespace fv
00206 
00207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00208 
00209 } // End namespace Foam
00210 
00211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00212 
00213 #ifdef NoRepository
00214 #   include "CoEulerDdtScheme.C"
00215 #endif
00216 
00217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00218 
00219 #endif
00220 
00221 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd