chemistryModel features electron reaction detection

This commit is contained in:
ignis 2016-06-19 20:55:50 +09:00
parent bef8f8f584
commit adbbe5d96e

View file

@ -832,6 +832,28 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
const scalarField& Te = this->mesh().template lookupObject<volScalarField>("Te").internalField();
const scalarField& ne = this->mesh().template lookupObject<volScalarField>("ne").internalField();
PtrList<Reaction<ThermoType> > eReactions_(nReaction_);
label neReactions_ = 0;
for (label i=0; i<nReaction_; i++)
{
if (reactions_[i].species().contains("E-"))
{
// Info << "With E- " << reactions_[i] << endl;
eReactions_.set(neReactions_, const_cast<Reaction<ThermoType>*>(reactions_(i)));
neReactions_++;
}
else
{
// Info << "Without E- " << reactions_[i] << endl;
}
}
for (label i=0; i<neReactions_; i++)
{
Info << eReactions_[i] << endl;
}
forAll(rho, celli)
{
const scalar rhoi = rho[celli];
@ -840,16 +862,23 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
scalar nei = ne[celli];
scalar Tei = Te[celli];
nei = Tei;
Tei = nei;
// nei = Tei;
// Tei = nei;
for (label i=0; i<nReaction_; i++)
for (label i=0; i<neReactions_; i++)
{
reactions_[i].species().contains("E-");
// Info << eReactions_[i] << endl;
eReactions_[i].Te() = Tei;
}
for (label i=0; i<nSpecie_; i++)
{
if (Y_[i].name() == "E-")
{
c[i] = nei / thermoType::NA;
c0[i] = c[i];
}
else
{
c[i] = rhoi*Y_[i][celli]/specieThermo_[i].W();
c0[i] = c[i];
@ -871,6 +900,11 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
for (label i=0; i<nSpecie_; i++)
{
if (Y_[i].name() == "E-")
{
RR_[i][celli] = (c[i] - c0[i])*thermoType::NA/deltaT[celli];
}
else
{
RR_[i][celli] = (c[i] - c0[i])*specieThermo_[i].W()/deltaT[celli];
}