Fourier.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "Fourier.H"
27 #include "fvmLaplacian.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace laminarThermophysicalTransportModels
34 {
35 
36 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 
38 template<class BasicThermophysicalTransportModel>
40 (
41  const momentumTransportModel& momentumTransport,
42  const thermoModel& thermo
43 )
44 :
46  (
47  typeName,
48  momentumTransport,
49  thermo
50  )
51 {}
52 
53 
54 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
55 
56 template<class BasicThermophysicalTransportModel>
57 const dictionary&
59 {
60  return dictionary::null;
61 }
62 
63 
64 template<class BasicThermophysicalTransportModel>
66 {
67  return true;
68 }
69 
70 
71 template<class BasicThermophysicalTransportModel>
73 {
74  return volVectorField::New
75  (
77  (
78  "q",
79  this->momentumTransport().alphaRhoPhi().group()
80  ),
81  -this->thermo().alpha()*this->alpha()*fvc::grad(this->thermo().he())
82  );
83 }
84 
85 
86 template<class BasicThermophysicalTransportModel>
89 {
90  return -fvm::laplacian(this->alpha()*this->thermo().alpha(), he);
91 }
92 
93 
94 template<class BasicThermophysicalTransportModel>
96 (
97  const volScalarField& Yi
98 ) const
99 {
100  return volVectorField::New
101  (
103  (
104  "j(" + Yi.name() + ')',
105  this->momentumTransport().alphaRhoPhi().group()
106  ),
107  -this->thermo().alpha()*this->alpha()*fvc::grad(Yi)
108  );
109 }
110 
111 
112 template<class BasicThermophysicalTransportModel>
115 {
116  return -fvm::laplacian(this->alpha()*this->thermo().alpha(), Yi);
117 }
118 
119 
120 template<class BasicThermophysicalTransportModel>
122 {
124  <
125  BasicThermophysicalTransportModel
126  >::correct();
127 }
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace laminarThermophysicalTransportModels
133 } // End namespace Foam
134 
135 // ************************************************************************* //
volScalarField & he
Definition: YEEqn.H:50
Templated abstract base class for laminar thermophysical transport models.
const char *const group
Group name for atomic constants.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
const word & name() const
Return name.
Definition: IOobject.H:303
Fourier(const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct from components.
Definition: Fourier.C:40
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
BasicThermophysicalTransportModel::momentumTransportModel momentumTransportModel
Definition: Fourier.H:65
static const dictionary null
Null dictionary.
Definition: dictionary.H:241
static tmp< GeometricField< vector, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< vector >> &)
Return a temporary field constructed from name,.
Calculate the matrix for the laplacian of the field.
virtual tmp< volVectorField > q() const
Return the heat flux.
Definition: Fourier.C:72
rhoReactionThermo & thermo
Definition: createFields.H:28
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Definition: Fourier.C:58
BasicThermophysicalTransportModel::thermoModel thermoModel
Definition: Fourier.H:68
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction equation.
Definition: Fourier.C:114
static word groupName(Name name, const word &group)
virtual bool read()
Read thermophysicalTransport dictionary.
Definition: Fourier.C:65
virtual void correct()
Correct the Fourier viscosity.
Definition: Fourier.C:121
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-8/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
Definition: pEqn.H:68
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmLaplacian.C:46
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
Definition: Fourier.C:88
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volVectorField > j(const volScalarField &Yi) const
Return the specie flux for the given specie mass-fraction.
Definition: Fourier.C:96
Namespace for OpenFOAM.