OpenFOAM logo
Open Source CFD Toolkit

boundedBackwardDdtScheme.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     boundedBackwardDdtScheme
00027 
00028 Description
00029     Second-order bounded-backward-differencing ddt using the current and
00030     two previous time-step values.
00031 
00032 SourceFiles
00033     boundedBackwardDdtScheme.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef boundedBackwardDdtScheme_H
00038 #define boundedBackwardDdtScheme_H
00039 
00040 #include "ddtScheme.H"
00041 #include "fvMatrices.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace fv
00051 {
00052 
00053 /*---------------------------------------------------------------------------*\
00054                        Class boundedBackwardDdtScheme Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 class boundedBackwardDdtScheme
00058 :
00059     public fv::ddtScheme<scalar>
00060 {
00061     // Private Member Functions
00062 
00063         //- Return the current time-step
00064         scalar deltaT_() const;
00065 
00066         //- Return the previous time-step
00067         scalar deltaT0_() const;
00068 
00069         //- Return the previous time-step or GREAT if the old timestep field
00070         //  wasn't available in which case Euler ddt is used
00071         template<class GeoField>
00072         scalar deltaT0_(const GeoField& vf) const
00073         {
00074             if (vf.oldTime().timeIndex() == vf.oldTime().oldTime().timeIndex())
00075             {
00076                 return GREAT;
00077             }
00078             else
00079             {
00080                 return deltaT0_();
00081             }
00082         }
00083 
00084 
00085         //- Disallow default bitwise copy construct
00086         boundedBackwardDdtScheme(const boundedBackwardDdtScheme&);
00087 
00088         //- Disallow default bitwise assignment
00089         void operator=(const boundedBackwardDdtScheme&);
00090 
00091 
00092 public:
00093 
00094     //- Runtime type information
00095     TypeName("boundedBackward");
00096 
00097 
00098     // Constructors
00099 
00100         //- Construct from mesh
00101         boundedBackwardDdtScheme(const fvMesh& mesh)
00102         :
00103             ddtScheme<scalar>(mesh)
00104         {}
00105 
00106         //- Construct from mesh and Istream
00107         boundedBackwardDdtScheme(const fvMesh& mesh, Istream& is)
00108         :
00109             ddtScheme<scalar>(mesh, is)
00110         {}
00111 
00112 
00113     // Member Functions
00114 
00115         //- Return mesh reference
00116         const fvMesh& mesh() const
00117         {
00118             return fv::ddtScheme<scalar>::mesh();
00119         }
00120 
00121         tmp<volScalarField> fvcDdt
00122         (
00123             const dimensionedScalar&
00124         );
00125 
00126         tmp<volScalarField> fvcDdt
00127         (
00128             const volScalarField&
00129         );
00130 
00131         tmp<volScalarField> fvcDdt
00132         (
00133             const dimensionedScalar&,
00134             const volScalarField&
00135         );
00136 
00137         tmp<volScalarField> fvcDdt
00138         (
00139             const volScalarField&,
00140             const volScalarField&
00141         );
00142 
00143         tmp<fvScalarMatrix> fvmDdt
00144         (
00145             volScalarField&
00146         );
00147 
00148         tmp<fvScalarMatrix> fvmDdt
00149         (
00150             const dimensionedScalar&,
00151             volScalarField&
00152         );
00153 
00154         tmp<fvScalarMatrix> fvmDdt
00155         (
00156             const volScalarField&,
00157             volScalarField&
00158         );
00159 
00160         tmp<surfaceScalarField> fvcDdtPhiCorr
00161         (
00162             const volScalarField& rA,
00163             const volScalarField& U,
00164             const surfaceScalarField& phi
00165         );
00166 
00167         tmp<surfaceScalarField> fvcDdtPhiCorr
00168         (
00169             const volScalarField& rA,
00170             const volScalarField& rho,
00171             const volScalarField& U,
00172             const surfaceScalarField& phi
00173         );
00174 
00175         tmp<surfaceScalarField> meshPhi
00176         (
00177             const volScalarField&
00178         );
00179 };
00180 
00181 
00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00183 
00184 } // End namespace fv
00185 
00186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00187 
00188 } // End namespace Foam
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 #endif
00193 
00194 // ************************************************************************* //
For further information go to www.openfoam.org