diffusion.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) 2012-2023 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 "diffusion.H"
27 #include "fvcGrad.H"
29 
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace combustionModels
36 {
39 }
40 }
41 
42 
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 
46 (
47  const word& modelType,
50  const word& combustionProperties
51 )
52 :
54  (
55  modelType,
56  thermo,
57  turb,
58  combustionProperties
59  ),
60  C_(this->coeffs().template lookup<scalar>("C")),
61  oxidantName_(this->coeffs().template lookupOrDefault<word>("oxidant", "O2"))
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
66 
68 {}
69 
70 
71 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
72 
74 {
75  this->wFuel_ ==
77 
78  this->fresCorrect();
79 
80  const label fuelI = this->fuelIndex();
81 
82  const volScalarField& YFuel = this->thermo().Y()[fuelI];
83 
84  if (this->thermo().containsSpecie(oxidantName_))
85  {
86  const volScalarField& YO2 = this->thermo().Y(oxidantName_);
87 
88  this->wFuel_ ==
89  C_*this->thermo().rho()*this->turbulence().nuEff()
90  *mag(fvc::grad(YFuel) & fvc::grad(YO2))
91  *pos0(YFuel)*pos0(YO2);
92  }
93 }
94 
95 
97 {
99  {
100  this->coeffs().lookup("C") >> C_ ;
101  this->coeffs().readIfPresent("oxidant", oxidantName_);
102  return true;
103  }
104  else
105  {
106  return false;
107  }
108 }
109 
110 
111 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
Base class for combustion models.
Simple diffusion-based combustion model based on the principle mixed is burnt. Additional parameter C...
Definition: diffusion.H:55
virtual void correct()
Correct combustion rate.
Definition: diffusion.C:73
virtual ~diffusion()
Destructor.
Definition: diffusion.C:67
diffusion(const word &modelType, const fluidMulticomponentThermo &thermo, const compressibleMomentumTransportModel &turb, const word &combustionProperties)
Construct from components.
Definition: diffusion.C:46
virtual bool read()
Update properties.
Definition: diffusion.C:96
Base class for single-step combustion models.
virtual bool read()
Update properties from given dictionary.
Base class for single-phase compressible turbulence models.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Base-class for multi-component fluid thermodynamic properties.
A class for handling words, derived from string.
Definition: word.H:62
Calculate the gradient of the given field.
defineTypeNameAndDebug(diffusion, 0)
addToRunTimeSelectionTable(combustionModel, diffusion, dictionary)
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
Definition: fvcGrad.C:46
Namespace for OpenFOAM.
dimensionedScalar pos0(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimLength
const dimensionSet dimTime
dimensioned< scalar > mag(const dimensioned< Type > &)
const dimensionSet dimMass
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
autoPtr< incompressible::momentumTransportModel > turbulence(incompressible::momentumTransportModel::New(U, phi, viscosity))
fluidMulticomponentThermo & thermo
Definition: createFields.H:31