From 6701c09d21519704d3e0dd57b6a00d2118216a89 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 25 May 2018 14:02:12 +0100 Subject: [PATCH] InterfaceCompositionPhaseChangePhaseSystem: Fixes to species transfer The handling of species transfer within the interface-composition phase change system has been sigificantly altered. The explicit-implicit caching of the mass transfer has been removed and been replaced with storage of an Su-Sp coefficient pair. The mass transfer is now generated on the fly from these coefficients. These fixes resolve a number of issues involving multiple species for which the pimple loop did not converge to a conservative solution. It also removes the requirement for a second evaluation of the mass transfer after solution of the species fraction equations. This work was supported by Zhen Li, at Evonik --- ...terfaceCompositionPhaseChangePhaseSystem.C | 387 ++++++++++-------- ...terfaceCompositionPhaseChangePhaseSystem.H | 21 +- .../MultiComponentPhaseModel.C | 8 + .../MultiComponentPhaseModel.H | 29 +- .../PurePhaseModel/PurePhaseModel.C | 12 + .../PurePhaseModel/PurePhaseModel.H | 3 + .../phaseModel/phaseModel/phaseModel.H | 3 + .../reactingMultiphaseEulerFoam/YEqns.H | 2 - .../reactingTwoPhaseEulerFoam/YEqns.H | 2 - 9 files changed, 272 insertions(+), 195 deletions(-) diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C index 6cae9d962..b7076d34d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C @@ -37,14 +37,50 @@ Foam::InterfaceCompositionPhaseChangePhaseSystem::iDmdt const phasePairKey& key ) const { - if (!iDmdt_.found(key)) + tmp tIDmdt = phaseSystem::dmdt(key); + + const phasePair unorderedPair + ( + this->phases()[key.first()], + this->phases()[key.second()] + ); + + forAllConstIter(phasePair, unorderedPair, iter) { - return phaseSystem::dmdt(key); + const phaseModel& phase = iter(); + const phaseModel& otherPhase = iter.otherPhase(); + const phasePair pair(phase, otherPhase, true); + + if (interfaceCompositionModels_.found(pair)) + { + const scalar iDmdtSign = Pair::compare(pair, key); + + forAllConstIter + ( + hashedWordList, + interfaceCompositionModels_[pair]->species(), + memberIter + ) + { + const word& member = *memberIter; + + const word name(IOobject::groupName(member, phase.name())); + const word otherName + ( + IOobject::groupName(member, otherPhase.name()) + ); + + tIDmdt.ref() += + iDmdtSign + *( + *(*iDmdtSu_[pair])[member] + + *(*iDmdtSp_[pair])[member]*phase.Y(member) + ); + } + } } - const scalar dmdtSign(Pair::compare(iDmdt_.find(key).key(), key)); - - return dmdtSign**iDmdt_[key]; + return tIDmdt; } @@ -58,7 +94,11 @@ InterfaceCompositionPhaseChangePhaseSystem const fvMesh& mesh ) : - BasePhaseSystem(mesh) + BasePhaseSystem(mesh), + nInterfaceCorrectors_ + ( + this->template lookupOrDefault