1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Fine-level numeric flux class for density-based solvers
32 Rewrite by Hrvoje Jasak
38 \*---------------------------------------------------------------------------*/
40 #ifndef fineNumericFlux_H
41 #define fineNumericFlux_H
44 #include "volFields.H"
45 #include "surfaceFields.H"
46 #include "basicThermo.H"
48 #include "mgMeshLevel.H"
49 #include "mgFieldLevel.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 /*---------------------------------------------------------------------------*\
57 Class fineNumericFlux Declaration
58 \*---------------------------------------------------------------------------*/
60 template<class Flux, class Limiter>
63 public numericFluxBase<Flux>
67 //- Reference to fine mesh level
68 const mgMeshLevel& meshLevel_;
70 //- Reference to fine fields level
71 const mgFieldLevel& fieldLevel_;
74 // Reference to primitive fields
77 const volScalarField& p_;
80 const volVectorField& U_;
82 //- Static temperature
83 const volScalarField& T_;
85 //- Reference to the thermophysicalModel
92 surfaceScalarField& rhoFlux_;
95 surfaceVectorField& rhoUFlux_;
98 surfaceScalarField& rhoEFlux_;
103 //- Static pressure gradient
104 volVectorField gradP_;
106 //- Velocity gradient
107 volTensorField gradU_;
109 //- Static temperature gradient
110 volVectorField gradT_;
113 // Private Member Functions
115 //- Disallow default bitwise copy construct
116 fineNumericFlux(const fineNumericFlux&);
118 //- Disallow default bitwise assignment
119 void operator=(const fineNumericFlux&);
122 //- Return internal field of mass flux
123 const scalarField& rhoFluxI() const
125 return rhoFlux_.internalField();
128 //- Return access to internal field of mass flux
129 scalarField& rhoFluxI()
131 return rhoFlux_.internalField();
134 //- Return internal field of momentum flux
135 const vectorField& rhoUFluxI() const
137 return rhoUFlux_.internalField();
140 //- Return access to internal field of momentum flux
141 vectorField& rhoUFluxI()
143 return rhoUFlux_.internalField();
146 //- Return access to internal field of energy flux
147 const scalarField& rhoEFluxI() const
149 return rhoEFlux_.internalField();
152 //- Return access to internal field of energy flux
153 scalarField& rhoEFluxI()
155 return rhoEFlux_.internalField();
163 //- Construct from components
166 const mgMeshLevel& meshLevel,
167 const mgFieldLevel& fieldLevel,
174 virtual ~fineNumericFlux()
180 //- Return mesh reference
181 const fvMesh& mesh() const
183 return meshLevel_.mesh();
189 //- Return density flux
190 virtual const surfaceScalarField& rhoFlux() const
195 //- Return velocity flux
196 virtual const surfaceVectorField& rhoUFlux() const
201 //- Return energy flux
202 virtual const surfaceScalarField& rhoEFlux() const
210 //- Return density equation residual
211 virtual tmp<scalarField> rhoResidual() const
213 return fvc::div(rhoFlux_)().internalField();
216 //- Return momentum equation flux
217 virtual tmp<vectorField> rhoUResidual() const
219 return fvc::div(rhoUFlux_)().internalField();
222 //- Return energy equation flux
223 virtual tmp<scalarField> rhoEResidual() const
225 return fvc::div(rhoEFlux_)().internalField();
231 //- Return pressure gradient
232 const volVectorField& gradP() const
237 //- Return pressure gradient
238 const volTensorField& gradU() const
243 //- Return Temperature gradient
244 const volVectorField& gradT() const
250 // Update fluxes based on current state
253 virtual void computeFlux();
257 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259 } // End namespace Foam
262 # include "fineNumericFlux.C"
265 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
269 // ************************************************************************* //