FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

fvcFlux.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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Description
00025     
00026 
00027 \*---------------------------------------------------------------------------*/
00028 
00029 #include "fvcFlux.H"
00030 #include <finiteVolume/fvMesh.H>
00031 #include <finiteVolume/convectionScheme.H>
00032 
00033 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00034 
00035 namespace Foam
00036 {
00037 
00038 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00039 
00040 namespace fvc
00041 {
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 template<class Type>
00046 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00047 flux
00048 (
00049     const surfaceScalarField& phi,
00050     const GeometricField<Type, fvPatchField, volMesh>& vf,
00051     const word& name
00052 )
00053 {
00054     return fv::convectionScheme<Type>::New
00055     (
00056         vf.mesh(),
00057         phi,
00058         vf.mesh().divScheme(name)
00059     )().flux(phi, vf);
00060 }
00061 
00062 
00063 template<class Type>
00064 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00065 flux
00066 (
00067     const tmp<surfaceScalarField>& tphi,
00068     const GeometricField<Type, fvPatchField, volMesh>& vf,
00069     const word& name
00070 )
00071 {
00072     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00073     (
00074         fvc::flux(tphi(), vf, name)
00075     );
00076     tphi.clear();
00077     return Flux;
00078 }
00079 
00080 
00081 template<class Type>
00082 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00083 flux
00084 (
00085     const surfaceScalarField& phi,
00086     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00087     const word& name
00088 )
00089 {
00090     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00091     (
00092         fvc::flux(phi, tvf(), name)
00093     );
00094     tvf.clear();
00095     return Flux;
00096 }
00097 
00098 
00099 template<class Type>
00100 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00101 flux
00102 (
00103     const tmp<surfaceScalarField>& tphi,
00104     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00105     const word& name
00106 )
00107 {
00108     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00109     (
00110         fvc::flux(tphi(), tvf(), name)
00111     );
00112     tphi.clear();
00113     tvf.clear();
00114     return Flux;
00115 }
00116 
00117 
00118 template<class Type>
00119 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00120 flux
00121 (
00122     const surfaceScalarField& phi,
00123     const GeometricField<Type, fvPatchField, volMesh>& vf
00124 )
00125 {
00126     return fvc::flux
00127     (
00128         phi, vf, "flux("+phi.name()+','+vf.name()+')'
00129     );
00130 }
00131 
00132 
00133 template<class Type>
00134 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00135 flux
00136 (
00137     const tmp<surfaceScalarField>& tphi,
00138     const GeometricField<Type, fvPatchField, volMesh>& vf
00139 )
00140 {
00141     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00142     (
00143         fvc::flux(tphi(), vf)
00144     );
00145     tphi.clear();
00146     return Flux;
00147 }
00148 
00149 
00150 template<class Type>
00151 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00152 flux
00153 (
00154     const surfaceScalarField& phi,
00155     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00156 )
00157 {
00158     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00159     (
00160         fvc::flux(phi, tvf())
00161     );
00162     tvf.clear();
00163     return Flux;
00164 }
00165 
00166 
00167 template<class Type>
00168 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00169 flux
00170 (
00171     const tmp<surfaceScalarField>& tphi,
00172     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00173 )
00174 {
00175     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00176     (
00177         fvc::flux(tphi(), tvf())
00178     );
00179     tphi.clear();
00180     tvf.clear();
00181     return Flux;
00182 }
00183 
00184 
00185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00186 
00187 } // End namespace fvc
00188 
00189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00190 
00191 } // End namespace Foam
00192 
00193 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines