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

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-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 "fvcFlux.H"
00031 #include "fvMesh.H"
00032 #include "convectionScheme.H"
00033 
00034 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00035 
00036 namespace Foam
00037 {
00038 
00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00040 
00041 namespace fvc
00042 {
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 template<class Type>
00047 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00048 flux
00049 (
00050     const surfaceScalarField& phi,
00051     const GeometricField<Type, fvPatchField, volMesh>& vf,
00052     const word& name
00053 )
00054 {
00055     return fv::convectionScheme<Type>::New
00056     (
00057         vf.mesh(),
00058         phi,
00059         vf.mesh().divScheme(name)
00060     )().flux(phi, vf);
00061 }
00062 
00063 
00064 template<class Type>
00065 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00066 flux
00067 (
00068     const tmp<surfaceScalarField>& tphi,
00069     const GeometricField<Type, fvPatchField, volMesh>& vf,
00070     const word& name
00071 )
00072 {
00073     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00074     (
00075         fvc::flux(tphi(), vf, name)
00076     );
00077     tphi.clear();
00078     return Flux;
00079 }
00080 
00081 
00082 template<class Type>
00083 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00084 flux
00085 (
00086     const surfaceScalarField& phi,
00087     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00088     const word& name
00089 )
00090 {
00091     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00092     (
00093         fvc::flux(phi, tvf(), name)
00094     );
00095     tvf.clear();
00096     return Flux;
00097 }
00098 
00099 
00100 template<class Type>
00101 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00102 flux
00103 (
00104     const tmp<surfaceScalarField>& tphi,
00105     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00106     const word& name
00107 )
00108 {
00109     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00110     (
00111         fvc::flux(tphi(), tvf(), name)
00112     );
00113     tphi.clear();
00114     tvf.clear();
00115     return Flux;
00116 }
00117 
00118 
00119 template<class Type>
00120 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00121 flux
00122 (
00123     const surfaceScalarField& phi,
00124     const GeometricField<Type, fvPatchField, volMesh>& vf
00125 )
00126 {
00127     return fvc::flux
00128     (
00129         phi, vf, "flux("+phi.name()+','+vf.name()+')'
00130     );
00131 }
00132 
00133 
00134 template<class Type>
00135 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00136 flux
00137 (
00138     const tmp<surfaceScalarField>& tphi,
00139     const GeometricField<Type, fvPatchField, volMesh>& vf
00140 )
00141 {
00142     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00143     (
00144         fvc::flux(tphi(), vf)
00145     );
00146     tphi.clear();
00147     return Flux;
00148 }
00149 
00150 
00151 template<class Type>
00152 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00153 flux
00154 (
00155     const surfaceScalarField& phi,
00156     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00157 )
00158 {
00159     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00160     (
00161         fvc::flux(phi, tvf())
00162     );
00163     tvf.clear();
00164     return Flux;
00165 }
00166 
00167 
00168 template<class Type>
00169 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00170 flux
00171 (
00172     const tmp<surfaceScalarField>& tphi,
00173     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00174 )
00175 {
00176     tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > Flux
00177     (
00178         fvc::flux(tphi(), tvf())
00179     );
00180     tphi.clear();
00181     tvf.clear();
00182     return Flux;
00183 }
00184 
00185 
00186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00187 
00188 } // End namespace fvc
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 } // End namespace Foam
00193 
00194 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd