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