OpenFOAM中的Chemistry类
化学反应相关的类,以热学相关的类为基础,它位于路径src/chemistryModel/。它的类间关系如下:
护理职业生涯规划接下来我们逐个介绍这些类的内容
basicChemistryModel
最基础的类,头⽂件内容如下:
class basicChemistryModel
:
public IOdictionary
{
protected:
//- Reference to the mesh databa
const fvMesh& mesh_;
//- Chemistry activation switch
Switch chemistry_;
/
/- Initial chemical time step
const scalar deltaTChemIni_;
//- Maximum chemical time step
const scalar deltaTChemMax_;
//- Latest estimation of integration step
volScalarField::Internal deltaTChem_;
构造函数和析构函数
返回类中的成员变量
//- Return const access to chemical source terms
virtual const volScalarField::Internal& R(const label i)=0
//- Return reaction rate of the speciei in reactioni
virtual tmp<volScalarField::Internal> calculateRR(const label reactioni,const label speciei)=0
//Solve the reaction system for the given time step
风寒型感冒virtual scalar solve(const scalar deltaT) = 0;
//- Return the heat relea rate [kg/m/s^3]
virtual tmp<volScalarField> Qdot() const = 0;
};
最重要的功能是最后⼏个函数,可以计算化学源项,以及反映速率。还有chemFoam中使⽤的solve函数,以及放热速率。不过这⾥的⼏个函数均为纯虚函数,需要后⾯给出具体的实现
BasicChemistryModel
其头⽂件内容如下:
template<class ReactionThermo>
class BasicChemistryModel
:
public basicChemistryModel
{
protected:
//- Thermo
ReactionThermo& thermo_;
构造函数和析构函数
返回成员变量thermo_
};
相当于在基础类basicChemistryModel的基础上,添加了热学相关的类。但是并没有给出前⾯的纯虚函数的具体定义。StandardChemistryModel
类的描述如下:
尼爵
Description
Extends ba chemistry model by adding a thermo package, and ODE functions.
Introduces chemistry equation system and evaluation of chemical source
terms.
在基础类上添加热学包,和ode函数。引⼊化学⽅程和化学源项的实现
头⽂件内容如下:
template<class ReactionThermo, class ThermoType>
class StandardChemistryModel
:
public BasicChemistryModel<ReactionThermo>,
public ODESystem
{ 成员变量,含有各种组分的信息,以及反应速率
//- Reference to the field of specie mass fractions陈伟煌
PtrList<volScalarField>& Y_;
//- Reactions
const PtrList<Reaction<ThermoType>>& reactions_;
//- Thermodynamic data of the species
const PtrList<ThermoType>& specieThermo_;
//- Number of species
label nSpecie_;
//- Number of reactions
label nReaction_;
/
/- Temperature below which the reaction rates are assumed 0
scalar Treact_;
//- List of reaction rate per specie [kg/m^3/s]
PtrList<volScalarField::Internal> RR_;
//- Temporary concentration field
mutable scalarField c_;
//- Temporary rate-of-change of concentration field
mutable scalarField dcdt_;
构造函数和析构函数
各类功能性的成员函数
};
这⾥我们⽐较关注的是solve函数具体实现,这⾥把它贴出来:
template<class ReactionThermo, class ThermoType>
template<class DeltaTType>
Foam::scalar Foam::StandardChemistryModel<ReactionThermo, ThermoType>::solve
(
const DeltaTType& deltaT
)
)
{
BasicChemistryModel<ReactionThermo>::correct();
scalar deltaTMin = great;
if (!this->chemistry_)
{
return deltaTMin;
}
tmp<volScalarField> trho(this->thermo().rho());
const scalarField& rho = trho(); //得到密度域
const scalarField& T = this->thermo().T(); //得到速度和压⼒域
const scalarField& p = this->thermo().p();
scalarField c0(nSpecie_); //得到各个组分的浓度
forAll(rho, celli) //对每个单元遍历
{
scalar Ti = T[celli];
if (Ti > Treact_) //超出燃点后才会发⽣反应
{
const scalar rhoi = rho[celli]; //取出域中的单个密度和压⼒
scalar pi = p[celli];
for (label i=0; i<nSpecie_; i++) //对每个组分计算浓度
{
c_[i] = rhoi*Y_[i][celli]/specieThermo_[i].W();
c0[i] = c_[i];
}
// Initiali time progress
scalar timeLeft = deltaT[celli];
// Calculate the chemical source terms 计算化学源项,调⽤另外⼀个solve while (timeLeft > small)
{
scalar dt = timeLeft;
this->solve(c_, Ti, pi, dt, this->deltaTChem_[celli]);
timeLeft -= dt;
}
deltaTMin = min(this->deltaTChem_[celli], deltaTMin);
this->deltaTChem_[celli] =
min(this->deltaTChem_[celli], this->deltaTChemMax_);
for (label i=0; i<nSpecie_; i++) //计算反应速率
{
RR_[i][celli] =
(c_[i] - c0[i])*specieThermo_[i].W()/deltaT[celli];
}
}
el //如果温度未到,反应速率就为零
{
for (label i=0; i<nSpecie_; i++)
{
RR_[i][celli] = 0;
}
}
}
return deltaTMin;
return deltaTMin;
}
TDACChemistryModel
⾸先看描述
Description
Extends StandardChemistryModel by adding the TDAC method.
References:
\verbatim
Contino, F., Jeanmart, H., Lucchini, T., & D’Errico, G. (2011).
Coupling of in situ adaptive tabulation and dynamic adaptive chemistry:
An effective method for solving combustion in engine simulations.
Proceedings of the Combustion Institute, 33(2), 3057-3064.
首都用英语怎么说Contino, F., Lucchini, T., D'Errico, G., Duynslaegher, C.,
Dias, V., & Jeanmart, H. (2012).
Simulations of advanced combustion modes using detailed chemistry
永远在路上观后感心得体会combined with tabulation and mechanism reduction techniques.
SAE International Journal of Engines,
5(2012-01-0145), 185-196.
Contino, F., Foucher, F., Dagaut, P., Lucchini, T., D’Errico, G., &
梦见受伤
Mounaïm-Rouslle, C. (2013).
Experimental and numerical analysis of nitric oxide effect on the
ignition of iso-octane in a single cylinder HCCI engine.
Combustion and Flame, 160(8), 1476-1483.
Contino, F., Masurier, J. B., Foucher, F., Lucchini, T., D’Errico, G., &
Dagaut, P. (2014).
CFD simulations using the TDAC method to model iso-octane combustion
for a large range of ozone eding and temperature conditions
in a single cylinder HCCI engine.
Fuel, 137, 179-184.
\endverbatim
类继承⾃StandardChemistryModel,这⾥使⽤了⼀个新的⽅法TDAC并给出了若⼲参考⽂献。这⾥也给出了solve⼀个实现,这⾥不再继续展开征信信用查询