mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
reactingEulerFoam: Removed continuity error from species equations
This fixes a consistency issue in the interface-composition method, and also seems to improve stability/convergence of the pimple iteration in the presence of significant mass transfer.
This commit is contained in:
@ -167,6 +167,10 @@ addMassTransferMomentumTransfer(phaseSystem::momentumTransferTable& eqns) const
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note that the phase UEqn contains a continuity error term, which
|
||||||
|
// implicitly adds a mass transfer term of fvm::Sp(dmdt, U). These
|
||||||
|
// additions do not include this term.
|
||||||
|
|
||||||
const volScalarField dmdt(this->dmdt(pair));
|
const volScalarField dmdt(this->dmdt(pair));
|
||||||
|
|
||||||
if (!pair.phase1().stationary())
|
if (!pair.phase1().stationary())
|
||||||
|
|||||||
@ -129,6 +129,10 @@ heatTransfer() const
|
|||||||
const volScalarField K1(phase1.K());
|
const volScalarField K1(phase1.K());
|
||||||
const volScalarField K2(phase2.K());
|
const volScalarField K2(phase2.K());
|
||||||
|
|
||||||
|
// Note that the phase heEqn contains a continuity error term, which
|
||||||
|
// implicitly adds a mass transfer term of fvm::Sp(dmdt, he). These
|
||||||
|
// additions do not include this term.
|
||||||
|
|
||||||
const volScalarField dmdt(this->dmdt(pair));
|
const volScalarField dmdt(this->dmdt(pair));
|
||||||
const volScalarField dmdt21(posPart(dmdt));
|
const volScalarField dmdt21(posPart(dmdt));
|
||||||
const volScalarField dmdt12(negPart(dmdt));
|
const volScalarField dmdt12(negPart(dmdt));
|
||||||
|
|||||||
@ -161,6 +161,9 @@ Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::massTransfer() const
|
|||||||
const phaseModel& phase = pair.phase1();
|
const phaseModel& phase = pair.phase1();
|
||||||
const phaseModel& otherPhase = pair.phase2();
|
const phaseModel& otherPhase = pair.phase2();
|
||||||
|
|
||||||
|
// Note that the phase YiEqn does not contain a continuity error term,
|
||||||
|
// so these additions represent the entire mass transfer
|
||||||
|
|
||||||
const volScalarField dmdt(this->rDmdt(pair));
|
const volScalarField dmdt(this->rDmdt(pair));
|
||||||
const volScalarField dmdt12(negPart(dmdt));
|
const volScalarField dmdt12(negPart(dmdt));
|
||||||
const volScalarField dmdt21(posPart(dmdt));
|
const volScalarField dmdt21(posPart(dmdt));
|
||||||
@ -181,11 +184,11 @@ Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::massTransfer() const
|
|||||||
|
|
||||||
*eqns[name] +=
|
*eqns[name] +=
|
||||||
dmdt21*eqns[otherName]->psi()
|
dmdt21*eqns[otherName]->psi()
|
||||||
- fvm::Sp(dmdt21, eqns[name]->psi());
|
+ fvm::Sp(dmdt12, eqns[name]->psi());
|
||||||
|
|
||||||
*eqns[otherName] -=
|
*eqns[otherName] -=
|
||||||
dmdt12*eqns[name]->psi()
|
dmdt12*eqns[name]->psi()
|
||||||
- fvm::Sp(dmdt12, eqns[otherName]->psi());
|
+ fvm::Sp(dmdt21, eqns[otherName]->psi());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -192,6 +192,9 @@ Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::massTransfer() const
|
|||||||
const phaseModel& phase = pair.phase1();
|
const phaseModel& phase = pair.phase1();
|
||||||
const phaseModel& otherPhase = pair.phase2();
|
const phaseModel& otherPhase = pair.phase2();
|
||||||
|
|
||||||
|
// Note that the phase YiEqn does not contain a continuity error term,
|
||||||
|
// so these additions represent the entire mass transfer
|
||||||
|
|
||||||
const volScalarField dmdt(this->pDmdt(pair));
|
const volScalarField dmdt(this->pDmdt(pair));
|
||||||
const volScalarField dmdt12(negPart(dmdt));
|
const volScalarField dmdt12(negPart(dmdt));
|
||||||
const volScalarField dmdt21(posPart(dmdt));
|
const volScalarField dmdt21(posPart(dmdt));
|
||||||
@ -212,11 +215,11 @@ Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::massTransfer() const
|
|||||||
|
|
||||||
*eqns[name] +=
|
*eqns[name] +=
|
||||||
dmdt21*eqns[otherName]->psi()
|
dmdt21*eqns[otherName]->psi()
|
||||||
- fvm::Sp(dmdt21, eqns[name]->psi());
|
+ fvm::Sp(dmdt12, eqns[name]->psi());
|
||||||
|
|
||||||
*eqns[otherName] -=
|
*eqns[otherName] -=
|
||||||
dmdt12*eqns[name]->psi()
|
dmdt12*eqns[name]->psi()
|
||||||
- fvm::Sp(dmdt12, eqns[otherName]->psi());
|
+ fvm::Sp(dmdt21, eqns[otherName]->psi());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -283,6 +283,11 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const
|
|||||||
|
|
||||||
forAll(Yi, i)
|
forAll(Yi, i)
|
||||||
{
|
{
|
||||||
|
if (Yi[i].member() != volatile_)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const word name
|
const word name
|
||||||
(
|
(
|
||||||
IOobject::groupName(volatile_, phase.name())
|
IOobject::groupName(volatile_, phase.name())
|
||||||
@ -293,16 +298,13 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const
|
|||||||
IOobject::groupName(volatile_, otherPhase.name())
|
IOobject::groupName(volatile_, otherPhase.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Note that the phase YiEqn does not contain a continuity error
|
||||||
|
// term, so these additions represent the entire mass transfer
|
||||||
|
|
||||||
const volScalarField dmdt(this->iDmdt(pair) + this->wDmdt(pair));
|
const volScalarField dmdt(this->iDmdt(pair) + this->wDmdt(pair));
|
||||||
|
|
||||||
*eqns[name] -= fvm::Sp(dmdt, eqns[name]->psi());
|
*eqns[name] += dmdt;
|
||||||
*eqns[otherName] += fvm::Sp(dmdt, eqns[otherName]->psi());
|
*eqns[otherName] -= dmdt;
|
||||||
|
|
||||||
if (Yi[i].member() == volatile_)
|
|
||||||
{
|
|
||||||
*eqns[name] += dmdt;
|
|
||||||
*eqns[otherName] -= dmdt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -155,7 +155,6 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::YiEqn(volScalarField& Yi)
|
|||||||
(
|
(
|
||||||
fvm::ddt(alpha, rho, Yi)
|
fvm::ddt(alpha, rho, Yi)
|
||||||
+ fvm::div(alphaRhoPhi, Yi, "div(" + alphaRhoPhi.name() + ",Yi)")
|
+ fvm::div(alphaRhoPhi, Yi, "div(" + alphaRhoPhi.name() + ",Yi)")
|
||||||
- fvm::Sp(this->continuityError(), Yi)
|
|
||||||
|
|
||||||
- fvm::laplacian
|
- fvm::laplacian
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user