From 87c507d8c84a9ff7d237fc9c84292b9b6b8bd6ac Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 1 Jan 2018 16:58:42 +0000 Subject: [PATCH] reactingMultiphaseEulerFoam: Updated using new pair "loop" structure --- .../reactingMultiphaseEulerFoam/pUf/UEqns.H | 22 +++++------- .../reactingMultiphaseEulerFoam/pUf/pEqn.H | 36 ++++++------------- 2 files changed, 18 insertions(+), 40 deletions(-) diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/UEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/UEqns.H index c513c2426..6e8558683 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/UEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/UEqns.H @@ -60,22 +60,16 @@ PtrList UEqns(phases.size()); const phasePair& pair(fluid.phasePairs()[VmIter.key()]); - const phaseModel* phase1 = &pair.phase1(); - const phaseModel* phase2 = &pair.phase2(); - - forAllConstIter(phasePair, pair, iter) + if (pair.contains(phase)) { - if (phase1 == &phase) - { - UEqns[phasei] += - Vm - *( - UgradUs[phasei] - - (UgradUs[phase2->index()] & phase2->U()) - ); - } + const phaseModel& otherPhase = pair.other(phase); - Swap(phase1, phase2); + UEqns[phasei] += + Vm + *( + UgradUs[phasei] + - (UgradUs[otherPhase.index()] & otherPhase.U()) + ); } } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/pEqn.H index e920119b9..b211c71f0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/pEqn.H @@ -194,18 +194,10 @@ while (pimple.correct()) const phasePair& pair(fluid.phasePairs()[KdfIter.key()]); - const phaseModel* phase1 = &pair.phase1(); - const phaseModel* phase2 = &pair.phase2(); - - forAllConstIter(phasePair, pair, iter) + if (pair.contains(phase)) { - if (phase1 == &phase) - { - phiHbyAs[phasei] += - rAUfs[phasei]*Kf*MRF.absolute(phase2->phi()); - } - - Swap(phase1, phase2); + phiHbyAs[phasei] += + rAUfs[phasei]*Kf*MRF.absolute(pair.other(phase).phi()); } } @@ -221,22 +213,14 @@ while (pimple.correct()) const phasePair& pair(fluid.phasePairs()[VmfIter.key()]); - const phaseModel* phase1 = &pair.phase1(); - const phaseModel* phase2 = &pair.phase2(); - - forAllConstIter(phasePair, pair, iter) + if (pair.contains(phase)) { - if (phase1 == &phase) - { - phiHbyAs[phasei] += - rAUfs[phasei] - *( - Vmf*byDt(MRF.absolute(phase1->phi()().oldTime())) - + Vmf*ddtPhis[phase2->index()] - ); - } - - Swap(phase1, phase2); + phiHbyAs[phasei] += + rAUfs[phasei] + *( + Vmf*byDt(MRF.absolute(phase.phi().oldTime())) + + Vmf*ddtPhis[pair.other(phase).index()] + ); } }