OpenFOAM logo
Open Source CFD Toolkit

backwardFaDdtScheme.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     backwardFaDdtScheme
00027 
00028 Description
00029     Second-order backward-differencing implicit ddt using the current and
00030     two previous time-step values.
00031 
00032 SourceFiles
00033     backwardFaDdtScheme.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef backwardFaDdtScheme_H
00038 #define backwardFaDdtScheme_H
00039 
00040 #include "faDdtScheme.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace fa
00050 {
00051 
00052 /*---------------------------------------------------------------------------*\
00053                        Class backwardFaDdtScheme Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 template<class Type>
00057 class backwardFaDdtScheme
00058 :
00059     public fa::faDdtScheme<Type>
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&) const;
00073 
00074         //- Disallow default bitwise copy construct
00075         backwardFaDdtScheme(const backwardFaDdtScheme&);
00076 
00077         //- Disallow default bitwise assignment
00078         void operator=(const backwardFaDdtScheme&);
00079 
00080 
00081 public:
00082 
00083     //- Runtime type information
00084     TypeName("backward");
00085 
00086 
00087     // Constructors
00088 
00089         //- Construct from mesh
00090         backwardFaDdtScheme(const faMesh& mesh)
00091         :
00092             faDdtScheme<Type>(mesh)
00093         {}
00094 
00095         //- Construct from mesh and Istream
00096         backwardFaDdtScheme(const faMesh& mesh, Istream& is)
00097         :
00098             faDdtScheme<Type>(mesh, is)
00099         {}
00100 
00101 
00102     // Member Functions
00103 
00104         //- Return mesh reference
00105         const faMesh& mesh() const
00106         {
00107             return fa::faDdtScheme<Type>::mesh();
00108         }
00109 
00110         tmp<GeometricField<Type, faPatchField, areaMesh> > facDdt
00111         (
00112             const dimensioned<Type>
00113         );
00114 
00115         tmp<GeometricField<Type, faPatchField, areaMesh> > facDdt0
00116         (
00117             const dimensioned<Type>
00118         );
00119 
00120         tmp<GeometricField<Type, faPatchField, areaMesh> > facDdt
00121         (
00122             const GeometricField<Type, faPatchField, areaMesh>&
00123         );
00124 
00125         tmp<GeometricField<Type, faPatchField, areaMesh> > facDdt0
00126         (
00127             const GeometricField<Type, faPatchField, areaMesh>&
00128         );
00129 
00130         tmp<GeometricField<Type, faPatchField, edgeMesh> > facDdt0
00131         (
00132             const GeometricField<Type, faPatchField, edgeMesh>&
00133         );
00134 
00135         tmp<GeometricField<Type, faPatchField, areaMesh> > facDdt
00136         (
00137             const dimensionedScalar&,
00138             const GeometricField<Type, faPatchField, areaMesh>&
00139         );
00140 
00141         tmp<GeometricField<Type, faPatchField, areaMesh> > facDdt0
00142         (
00143             const dimensionedScalar&,
00144             const GeometricField<Type, faPatchField, areaMesh>&
00145         );
00146 
00147         tmp<GeometricField<Type, faPatchField, areaMesh> > facDdt
00148         (
00149             const areaScalarField&,
00150             const GeometricField<Type, faPatchField, areaMesh>&
00151         );
00152 
00153         tmp<GeometricField<Type, faPatchField, areaMesh> > facDdt0
00154         (
00155             const areaScalarField&,
00156             const GeometricField<Type, faPatchField, areaMesh>&
00157         );
00158 
00159         tmp<faMatrix<Type> > famDdt
00160         (
00161             GeometricField<Type, faPatchField, areaMesh>&
00162         );
00163 
00164         tmp<faMatrix<Type> > famDdt
00165         (
00166             const dimensionedScalar&,
00167             GeometricField<Type, faPatchField, areaMesh>&
00168         );
00169 
00170         tmp<faMatrix<Type> > famDdt
00171         (
00172             const areaScalarField&,
00173             GeometricField<Type, faPatchField, areaMesh>&
00174         );
00175 };
00176 
00177 
00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00179 
00180 } // End namespace fa
00181 
00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00183 
00184 } // End namespace Foam
00185 
00186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00187 
00188 #ifdef NoRepository
00189 #   include "backwardFaDdtScheme.C"
00190 #endif
00191 
00192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00193 
00194 #endif
00195 
00196 // ************************************************************************* //
For further information go to www.openfoam.org