initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / finiteVolume / fvm / fvmDiv.C
blob25af21ef2abcfeb3a215ed765c7b9de5c43a96ff
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Description
26     
28 \*---------------------------------------------------------------------------*/
30 #include "fvmDiv.H"
31 #include "fvMesh.H"
32 #include "fvMatrix.H"
33 #include "convectionScheme.H"
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 namespace Foam
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace fvm
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 template<class Type>
48 tmp<fvMatrix<Type> >
49 div
51     const surfaceScalarField& flux,
52     GeometricField<Type, fvPatchField, volMesh>& vf,
53     const word& name
56     return fv::convectionScheme<Type>::New
57     (
58         vf.mesh(),
59         flux,
60         vf.mesh().divScheme(name)
61     )().fvmDiv(flux, vf);
64 template<class Type>
65 tmp<fvMatrix<Type> >
66 div
68     const tmp<surfaceScalarField>& tflux,
69     GeometricField<Type, fvPatchField, volMesh>& vf,
70     const word& name
73     tmp<fvMatrix<Type> > Div(fvm::div(tflux(), vf, name));
74     tflux.clear();
75     return Div;
79 template<class Type>
80 tmp<fvMatrix<Type> >
81 div
83     const surfaceScalarField& flux,
84     GeometricField<Type, fvPatchField, volMesh>& vf
87     return fvm::div(flux, vf, "div("+flux.name()+','+vf.name()+')');
90 template<class Type>
91 tmp<fvMatrix<Type> >
92 div
94     const tmp<surfaceScalarField>& tflux,
95     GeometricField<Type, fvPatchField, volMesh>& vf
98     tmp<fvMatrix<Type> > Div(fvm::div(tflux(), vf));
99     tflux.clear();
100     return Div;
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 } // End namespace fvm
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 } // End namespace Foam
112 // ************************************************************************* //