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

fvmDiv.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 Description
00026     
00027 
00028 \*---------------------------------------------------------------------------*/
00029 
00030 #include "fvmDiv.H"
00031 #include "fvMesh.H"
00032 #include "fvMatrix.H"
00033 #include "convectionScheme.H"
00034 
00035 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00036 
00037 namespace Foam
00038 {
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace fvm
00043 {
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 template<class Type>
00048 tmp<fvMatrix<Type> >
00049 div
00050 (
00051     const surfaceScalarField& flux,
00052     GeometricField<Type, fvPatchField, volMesh>& vf,
00053     const word& name
00054 )
00055 {
00056     return fv::convectionScheme<Type>::New
00057     (
00058         vf.mesh(),
00059         flux,
00060         vf.mesh().divScheme(name)
00061     )().fvmDiv(flux, vf);
00062 }
00063 
00064 template<class Type>
00065 tmp<fvMatrix<Type> >
00066 div
00067 (
00068     const tmp<surfaceScalarField>& tflux,
00069     GeometricField<Type, fvPatchField, volMesh>& vf,
00070     const word& name
00071 )
00072 {
00073     tmp<fvMatrix<Type> > Div(fvm::div(tflux(), vf, name));
00074     tflux.clear();
00075     return Div;
00076 }
00077 
00078 
00079 template<class Type>
00080 tmp<fvMatrix<Type> >
00081 div
00082 (
00083     const surfaceScalarField& flux,
00084     GeometricField<Type, fvPatchField, volMesh>& vf
00085 )
00086 {
00087     return fvm::div(flux, vf, "div("+flux.name()+','+vf.name()+')');
00088 }
00089 
00090 template<class Type>
00091 tmp<fvMatrix<Type> >
00092 div
00093 (
00094     const tmp<surfaceScalarField>& tflux,
00095     GeometricField<Type, fvPatchField, volMesh>& vf
00096 )
00097 {
00098     tmp<fvMatrix<Type> > Div(fvm::div(tflux(), vf));
00099     tflux.clear();
00100     return Div;
00101 }
00102 
00103 
00104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00105 
00106 } // End namespace fvm
00107 
00108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00109 
00110 } // End namespace Foam
00111 
00112 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd