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

fvcMeshPhi.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 "fvcMeshPhi.H"
00028 #include "fvMesh.H"
00029 #include "ddtScheme.H"
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 Foam::tmp<Foam::surfaceScalarField> Foam::fvc::meshPhi
00034 (
00035     const volVectorField& vf
00036 )
00037 {
00038     return fv::ddtScheme<vector>::New
00039     (
00040         vf.mesh(),
00041         vf.mesh().ddtScheme("ddt(" + vf.name() + ')')
00042     )().meshPhi(vf);
00043 }
00044 
00045 
00046 Foam::tmp<Foam::surfaceScalarField> Foam::fvc::meshPhi
00047 (
00048     const dimensionedScalar& rho,
00049     const volVectorField& vf
00050 )
00051 {
00052     return fv::ddtScheme<vector>::New
00053     (
00054         vf.mesh(),
00055         vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')')
00056     )().meshPhi(vf);
00057 }
00058 
00059 
00060 Foam::tmp<Foam::surfaceScalarField> Foam::fvc::meshPhi
00061 (
00062     const volScalarField& rho,
00063     const volVectorField& vf
00064 )
00065 {
00066     return fv::ddtScheme<vector>::New
00067     (
00068         vf.mesh(),
00069         vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')')
00070     )().meshPhi(vf);
00071 }
00072 
00073 
00074 void Foam::fvc::makeRelative
00075 (
00076     surfaceScalarField& phi,
00077     const volVectorField& U
00078 )
00079 {
00080     if (phi.mesh().moving())
00081     {
00082         phi -= fvc::meshPhi(U);
00083     }
00084 }
00085 
00086 void Foam::fvc::makeRelative
00087 (
00088     surfaceScalarField& phi,
00089     const dimensionedScalar& rho,
00090     const volVectorField& U
00091 )
00092 {
00093     if (phi.mesh().moving())
00094     {
00095         phi -= rho*fvc::meshPhi(rho, U);
00096     }
00097 }
00098 
00099 void Foam::fvc::makeRelative
00100 (
00101     surfaceScalarField& phi,
00102     const volScalarField& rho,
00103     const volVectorField& U
00104 )
00105 {
00106     if (phi.mesh().moving())
00107     {
00108         phi -= fvc::interpolate(rho)*fvc::meshPhi(rho, U);
00109     }
00110 }
00111 
00112 
00113 void Foam::fvc::makeAbsolute
00114 (
00115     surfaceScalarField& phi,
00116     const volVectorField& U
00117 )
00118 {
00119     if (phi.mesh().moving())
00120     {
00121         phi += fvc::meshPhi(U);
00122     }
00123 }
00124 
00125 void Foam::fvc::makeAbsolute
00126 (
00127     surfaceScalarField& phi,
00128     const dimensionedScalar& rho,
00129     const volVectorField& U
00130 )
00131 {
00132     if (phi.mesh().moving())
00133     {
00134         phi += rho*fvc::meshPhi(rho, U);
00135     }
00136 }
00137 
00138 void Foam::fvc::makeAbsolute
00139 (
00140     surfaceScalarField& phi,
00141     const volScalarField& rho,
00142     const volVectorField& U
00143 )
00144 {
00145     if (phi.mesh().moving())
00146     {
00147         phi += fvc::interpolate(rho)*fvc::meshPhi(rho, U);
00148     }
00149 }
00150 
00151 
00152 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd