All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups
updateFluxes.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10  Copyright (C) 2016-2019 ISP RAS (www.ispras.ru) UniCFD Group (www.unicfd.ru)
11 -------------------------------------------------------------------------------
12 License
13  This file is part of QGDsolver library, based on OpenFOAM+.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 Global
29  updateFluxes
30 
31 Description
32  Updates fluxes for continuity equation, momentum balance equation,
33  energy balance equation.
34 
35 \*---------------------------------------------------------------------------*/
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 //Gradients and divergence
40 //---------Start---------
42 
43 divUf = tr(gradUf);
44 
46 
48 
49 //---------End---------
50 
51 //Continuity equation fluxes
52 //---------Start---------
53 
54 rhoW = tauQGDf *
55  (
56  ((Uf * gradRhof) & Uf)
57  +
58  (rhoUf * divUf)
59  +
61  );
62 
63 phiw = mesh.Sf() & rhoW;
64 
66 
67 rhoW += tauQGDf * gradPf;
68 
70 
71 phiJm = mesh.Sf() & jm;
72 phi = mesh.Sf() & rhoUf;
73 //---------End---------
74 
75 // Fluxes for momentum balance equation
76 //---------Start---------
77 
79 phiP = mesh.Sf() * pf;
80 
81 Pif =
82  //QGD diffusive fluxes
83  tauQGDf*
84  (
85  (UrhoUf & gradUf)
86  +
87  Uf*gradPf
88  )
89  +
90  tauQGDf *
91  (
92  I * ( (Uf & gradPf) + (gammaf * pf * divUf) )
93  );
94 
96 {
97  Pif +=
98  muf*
99  (
100  gradUf
101  +
102  Foam::T(gradUf)
103  -
104  (2.0/3.0)*I*divUf
105  );
106 }
107 else
108 {
110  phiTauMC = mesh.Sf() & tauMCPtr();
111 }
112 
113 phiPi = mesh.Sf() & Pif;
115 //---------End---------
116 
117 // Fluxes for energy balance equation
118 //---------Start---------
119 phiJmH = qgdFlux(phiJm,H,Hf);
120 
121 qf =
122  -tauQGDf*
123  (
125  (
127  - (pf / rhof / rhof) * gradRhof
128  )
129  );
130 
131 if (!implicitDiffusion)
132 {
133  qf -=
134  alphauf*gradef;
135 }
136 
137 phiQ = mesh.Sf() & qf;
138 
139 phiPiU = mesh.Sf() & (Pif & Uf);
140 
141 //---------End---------
143 
144 // ************************************************************************* //
rhoUf
Definition: updateFields.H:14
gradPf
Definition: updateFluxes.H:33
tmp< GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > > qgdFlux(const GeometricField< scalar, Foam::fvsPatchField, Foam::surfaceMesh > &flux, const GeometricField< T, Foam::fvPatchField, Foam::volMesh > &psi, const GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > &psif, const word fluxName)
pf
Definition: updateFields.H:21
const surfaceScalarField & tauQGDf
Definition: createFields.H:55
phiP
Definition: updateFluxes.H:51
muf
Definition: updateFields.H:38
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
Switch implicitDiffusion(thermo.implicitDiffusion())
gradRhof
Definition: updateFluxes.H:11
phiJmH
——–End———
Definition: updateFluxes.H:95
gradUf
Definition: updateFields.H:34
phiPiU
Definition: updateFluxes.H:115
gradef
Definition: updateFluxes.H:9
gammaf
Definition: updateFields.H:27
phiPi
Definition: updateFluxes.H:85
phiJm
Definition: updateFluxes.H:39
qf
Definition: updateFluxes.H:97
alphauf
Definition: updateFields.H:42
tmp< GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > > qgdInterpolate(const GeometricField< T, Foam::fvPatchField, Foam::volMesh > &psi)
rhof
Definition: updateFields.H:27
H
Definition: updateFields.H:34
autoPtr< surfaceTensorField > tauMCPtr
phiJmU
——–End———
Definition: updateFluxes.H:50
rhoW
——–End———
Definition: updateFluxes.H:22
UrhoUf
Definition: updateFields.H:18
volScalarField & e
Definition: createFields.H:50
Hf
Definition: updateFields.H:35
phiTauMC
Definition: updateFluxes.H:82
divUf
Definition: updateFluxes.H:7
jm
Definition: updateFluxes.H:37
Uf
Definition: updateFields.H:30
phiQ
Definition: updateFluxes.H:113
volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho())
Info<< "Thermo corrected"<< endl;autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:59
volScalarField & T
Definition: createFields.H:53
tmp< surfaceVectorField > grad(const volScalarField &vF)
volScalarField & p
Definition: createFields.H:52
phiw
Definition: updateFluxes.H:31
Pif
Definition: updateFluxes.H:53