OpenFOAM logo
Open Source CFD Toolkit

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