FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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