OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

steadyStateD2dt2Scheme.C

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-2009 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 \*---------------------------------------------------------------------------*/
00026 
00027 #include "steadyStateD2dt2Scheme.H"
00028 #include "fvcDiv.H"
00029 #include "fvMatrices.H"
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 
00036 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00037 
00038 namespace fv
00039 {
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 template<class Type>
00044 tmp<GeometricField<Type, fvPatchField, volMesh> >
00045 steadyStateD2dt2Scheme<Type>::fvcD2dt2
00046 (
00047     const GeometricField<Type, fvPatchField, volMesh>& vf
00048 )
00049 {
00050     return tmp<GeometricField<Type, fvPatchField, volMesh> >
00051     (
00052         new GeometricField<Type, fvPatchField, volMesh>
00053         (
00054             IOobject
00055             (
00056                 "d2dt2("+vf.name()+')',
00057                 mesh().time().timeName(),
00058                 mesh(),
00059                 IOobject::NO_READ,
00060                 IOobject::NO_WRITE
00061             ),
00062             mesh(),
00063             dimensioned<Type>
00064             (
00065                 "0",
00066                 vf.dimensions()/dimTime/dimTime,
00067                 pTraits<Type>::zero
00068             )
00069         )
00070     );
00071 }
00072 
00073 
00074 template<class Type>
00075 tmp<GeometricField<Type, fvPatchField, volMesh> >
00076 steadyStateD2dt2Scheme<Type>::fvcD2dt2
00077 (
00078     const volScalarField& rho,
00079     const GeometricField<Type, fvPatchField, volMesh>& vf
00080 )
00081 {
00082     return tmp<GeometricField<Type, fvPatchField, volMesh> >
00083     (
00084         new GeometricField<Type, fvPatchField, volMesh>
00085         (
00086             IOobject
00087             (
00088                 "d2dt2("+rho.name()+','+vf.name()+')',
00089                 mesh().time().timeName(),
00090                 mesh(),
00091                 IOobject::NO_READ,
00092                 IOobject::NO_WRITE
00093             ),
00094             mesh(),
00095             dimensioned<Type>
00096             (
00097                 "0",
00098                 rho.dimensions()*vf.dimensions()/dimTime/dimTime,
00099                 pTraits<Type>::zero
00100             )
00101         )
00102     );
00103 }
00104 
00105 
00106 template<class Type>
00107 tmp<fvMatrix<Type> >
00108 steadyStateD2dt2Scheme<Type>::fvmD2dt2
00109 (
00110     GeometricField<Type, fvPatchField, volMesh>& vf
00111 )
00112 {
00113     tmp<fvMatrix<Type> > tfvm
00114     (
00115         new fvMatrix<Type>
00116         (
00117             vf,
00118             vf.dimensions()*dimVol/dimTime/dimTime
00119         )
00120     );
00121 
00122     return tfvm;
00123 }
00124 
00125 
00126 template<class Type>
00127 tmp<fvMatrix<Type> >
00128 steadyStateD2dt2Scheme<Type>::fvmD2dt2
00129 (
00130     const dimensionedScalar& rho,
00131     GeometricField<Type, fvPatchField, volMesh>& vf
00132 )
00133 {
00134     tmp<fvMatrix<Type> > tfvm
00135     (
00136         new fvMatrix<Type>
00137         (
00138             vf,
00139             rho.dimensions()*vf.dimensions()*dimVol/dimTime/dimTime
00140         )
00141     );
00142 
00143     return tfvm;
00144 }
00145 
00146 
00147 template<class Type>
00148 tmp<fvMatrix<Type> >
00149 steadyStateD2dt2Scheme<Type>::fvmD2dt2
00150 (
00151     const volScalarField& rho,
00152     GeometricField<Type, fvPatchField, volMesh>& vf
00153 )
00154 {
00155     tmp<fvMatrix<Type> > tfvm
00156     (
00157         new fvMatrix<Type>
00158         (
00159             vf,
00160             rho.dimensions()*vf.dimensions()*dimVol/dimTime/dimTime
00161         )
00162     );
00163 
00164     return tfvm;
00165 }
00166 
00167 
00168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00169 
00170 } // End namespace fv
00171 
00172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00173 
00174 } // End namespace Foam
00175 
00176 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd