diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C index 1ae08f3362..9c02c9f385 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C @@ -123,6 +123,8 @@ InterfaceCompositionPhaseChangePhaseSystem { const phasePair& pair = this->phasePairs_[interfaceCompositionModelIter.key()]; + const phaseModel& phase = pair.phase1(); + const phaseModel& otherPhase = pair.phase2(); if (!pair.ordered()) { @@ -136,14 +138,27 @@ InterfaceCompositionPhaseChangePhaseSystem << exit(FatalError); } - const phasePairKey key(pair.phase1().name(), pair.phase2().name()); - if (!massTransferModels_[key][pair.index(pair.phase1())].valid()) + const phasePairKey key(phase.name(), otherPhase.name()); + + if (!this->phasePairs_.found(key)) + { + FatalErrorInFunction + << "A mass transfer model the " << key << " pair is not " + << "specified. This is required by the corresponding interface " + << "composition model." + << exit(FatalError); + } + + const phasePair& uoPair = this->phasePairs_[key]; + + if (!massTransferModels_[uoPair][uoPair.index(phase)].valid()) { FatalErrorInFunction << "A mass transfer model for the " << pair.phase1().name() - << " side of the " << key << " pair is not specified. This is " - << "required by the corresponding interface composition model." + << " side of the " << uoPair << " pair is not " + << "specified. This is required by the corresponding interface " + << "composition model." << exit(FatalError); } } @@ -180,7 +195,6 @@ InterfaceCompositionPhaseChangePhaseSystem const phasePair& pair = this->phasePairs_[interfaceCompositionModelIter.key()]; - const phasePair unorderedPair(pair.phase1(), pair.phase2()); iDmdtSu_.insert(pair, new HashPtrTable()); iDmdtSp_.insert(pair, new HashPtrTable()); @@ -317,13 +331,14 @@ massTransfer() const this->phasePairs_[interfaceCompositionModelIter.key()]; const phaseModel& phase = pair.phase1(); const phaseModel& otherPhase = pair.phase2(); - const phasePair unorderedPair(phase, otherPhase); + const phasePair& unorderedPair = + this->phasePairs_[phasePair(phase, otherPhase)]; const volScalarField& Tf(*this->Tf_[unorderedPair]); const volScalarField K ( - massTransferModels_[unorderedPair][pair.index(phase)]->K() + massTransferModels_[unorderedPair][unorderedPair.index(phase)]->K() ); forAllConstIter(hashedWordList, compositionModel.species(), memberIter)