chemistryModel<> called by plasmaReactingFoam behave differently with integration off
This commit is contained in:
parent
c0ea17f615
commit
fbc199b957
1 changed files with 75 additions and 5 deletions
|
|
@ -733,6 +733,10 @@ void Foam::chemistryModel<CompType, ThermoType>::calculate()
|
|||
const scalarField& T = this->thermo().T();
|
||||
const scalarField& p = this->thermo().p();
|
||||
|
||||
const bool neFound = this->mesh().template foundObject<volScalarField>("ne");
|
||||
|
||||
if (!neFound)
|
||||
{
|
||||
forAll(rho, celli)
|
||||
{
|
||||
const scalar rhoi = rho[celli];
|
||||
|
|
@ -753,6 +757,74 @@ void Foam::chemistryModel<CompType, ThermoType>::calculate()
|
|||
RR_[i][celli] = dcdt[i]*specieThermo_[i].W();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const scalarField& En = this->mesh().template lookupObject<volScalarField>("En").internalField();
|
||||
const scalarField& Te = this->mesh().template lookupObject<volScalarField>("Te").internalField();
|
||||
const scalarField& ne = this->mesh().template lookupObject<volScalarField>("ne").internalField();
|
||||
|
||||
label neReactions_ = 0;
|
||||
labelList eRxnLabels;
|
||||
|
||||
for (label i=0; i<nReaction_; i++)
|
||||
{
|
||||
if (reactions_[i].species().contains("E-"))
|
||||
{
|
||||
eRxnLabels.append(i);
|
||||
neReactions_++;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
forAll(rho, celli)
|
||||
{
|
||||
const scalar rhoi = rho[celli];
|
||||
const scalar Ti = T[celli];
|
||||
const scalar pi = p[celli];
|
||||
const scalar nei = ne[celli];
|
||||
const scalar Tei = Te[celli];
|
||||
const scalar Eni = En[celli];
|
||||
|
||||
for (label i=0; i<neReactions_; i++)
|
||||
{
|
||||
label ei = eRxnLabels[i];
|
||||
reactions_[ei].Te(Tei);
|
||||
reactions_[ei].En(Eni);
|
||||
}
|
||||
|
||||
scalarField c(nSpecie_, 0.0);
|
||||
for (label i=0; i<nSpecie_; i++)
|
||||
{
|
||||
if (Y_[i].name() == "E-")
|
||||
{
|
||||
c[i] = nei / thermoType::NA;
|
||||
}
|
||||
else
|
||||
{
|
||||
const scalar Yi = Y_[i][celli];
|
||||
c[i] = rhoi*Yi/specieThermo_[i].W();
|
||||
}
|
||||
}
|
||||
|
||||
const scalarField dcdt(omega(c, Ti, pi));
|
||||
|
||||
for (label i=0; i<nSpecie_; i++)
|
||||
{
|
||||
if (Y_[i].name() == "E-")
|
||||
{
|
||||
RR_[i][celli] = dcdt[i]*thermoType::NA;
|
||||
}
|
||||
else
|
||||
{
|
||||
RR_[i][celli] = dcdt[i]*specieThermo_[i].W();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -829,6 +901,7 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
|
|||
}
|
||||
else
|
||||
{
|
||||
const scalarField& En = this->mesh().template lookupObject<volScalarField>("En").internalField();
|
||||
const scalarField& Te = this->mesh().template lookupObject<volScalarField>("Te").internalField();
|
||||
const scalarField& ne = this->mesh().template lookupObject<volScalarField>("ne").internalField();
|
||||
|
||||
|
|
@ -839,13 +912,11 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
|
|||
{
|
||||
if (reactions_[i].species().contains("E-"))
|
||||
{
|
||||
// Info << "With E- " << reactions_[i] << endl;
|
||||
eRxnLabels.append(i);
|
||||
neReactions_++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Info << "Without E- " << reactions_[i] << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -856,15 +927,14 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
|
|||
scalar Ti = T[celli];
|
||||
scalar nei = ne[celli];
|
||||
scalar Tei = Te[celli];
|
||||
scalar Eni = En[celli];
|
||||
|
||||
// nei = Tei;
|
||||
// Tei = nei;
|
||||
|
||||
for (label i=0; i<neReactions_; i++)
|
||||
{
|
||||
label ei = eRxnLabels[i];
|
||||
Info << reactions_[ei] << endl;
|
||||
reactions_[ei].Te(Tei);
|
||||
reactions_[ei].En(Eni);
|
||||
}
|
||||
|
||||
for (label i=0; i<nSpecie_; i++)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue