From 3d14a632a5950fe45a31effe3347ce8552837986 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 5 Oct 2015 17:43:33 +0100 Subject: [PATCH] reactingMultiphaseEulerFoam, multiphaseEulerFoam: Correct flux averaging for sub-cycling --- .../multiphaseSystem/multiphaseSystem.C | 8 ++++---- .../multiphaseSystem/multiphaseSystem.C | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 2203d6e14..767600e39 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -888,7 +888,7 @@ void Foam::multiphaseSystem::solve() dimensionedScalar totalDeltaT = runTime.deltaT(); PtrList alpha0s(phases_.size()); - PtrList phiSums(phases_.size()); + PtrList alphaPhiSums(phases_.size()); int phasei = 0; forAllIter(PtrDictionary, phases_, iter) @@ -902,7 +902,7 @@ void Foam::multiphaseSystem::solve() new volScalarField(alpha.oldTime()) ); - phiSums.set + alphaPhiSums.set ( phasei, new surfaceScalarField @@ -936,7 +936,7 @@ void Foam::multiphaseSystem::solve() int phasei = 0; forAllIter(PtrDictionary, phases_, iter) { - phiSums[phasei] += (runTime.deltaT()/totalDeltaT)*iter().phi(); + alphaPhiSums[phasei] += iter().alphaPhi()/nAlphaSubCycles; phasei++; } } @@ -947,7 +947,7 @@ void Foam::multiphaseSystem::solve() phaseModel& phase = iter(); volScalarField& alpha = phase; - phase.phi() = phiSums[phasei]; + phase.alphaPhi() = alphaPhiSums[phasei]; // Correct the time index of the field // to correspond to the global time diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 5512fd655..d92368a88 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -157,7 +157,7 @@ void Foam::multiphaseSystem::solveAlphas() MULES::limit ( - 1.0/mesh_.time().deltaT().value(), + 1.0/mesh_.time().deltaT().value(), // ***HGW add support for LTS geometricOneField(), phase, phi_, @@ -620,7 +620,7 @@ void Foam::multiphaseSystem::solve() dimensionedScalar totalDeltaT = runTime.deltaT(); PtrList alpha0s(phases().size()); - PtrList phiSums(phases().size()); + PtrList alphaPhiSums(phases().size()); forAll(phases(), phasei) { @@ -633,7 +633,7 @@ void Foam::multiphaseSystem::solve() new volScalarField(alpha.oldTime()) ); - phiSums.set + alphaPhiSums.set ( phasei, new surfaceScalarField @@ -664,7 +664,7 @@ void Foam::multiphaseSystem::solve() forAll(phases(), phasei) { - phiSums[phasei] += phases()[phasei].phi(); + alphaPhiSums[phasei] += phases()[phasei].alphaPhi(); } } @@ -673,7 +673,7 @@ void Foam::multiphaseSystem::solve() phaseModel& phase = phases()[phasei]; volScalarField& alpha = phase; - phase.phi() = phiSums[phasei]/nAlphaSubCycles; + phase.alphaPhi() = alphaPhiSums[phasei]/nAlphaSubCycles; // Correct the time index of the field // to correspond to the global time