From cd4445270f1152a54821dc6802d7988da00472f8 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 12 Apr 2018 11:19:19 +0100 Subject: [PATCH] reactingEulerFoam: Fixed memory error introduced by commit efad85b0 --- .../phaseSystems/phaseSystem/phaseSystem.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C index 46eb6988e..2ad76d7bb 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C @@ -239,10 +239,10 @@ Foam::tmp Foam::phaseSystem::rho() const { const label nMovingPhases = movingPhaseModels_.size(); - volScalarField rho(movingPhaseModels_[0]*movingPhaseModels_[0].rho()); + tmp rho(movingPhaseModels_[0]*movingPhaseModels_[0].rho()); for (label movingPhasei = 1; movingPhasei < nMovingPhases; ++ movingPhasei) { - rho += + rho.ref() += movingPhaseModels_[movingPhasei] *movingPhaseModels_[movingPhasei].rho(); } @@ -266,10 +266,10 @@ Foam::tmp Foam::phaseSystem::U() const { const label nMovingPhases = movingPhaseModels_.size(); - volVectorField U(movingPhaseModels_[0]*movingPhaseModels_[0].U()); + tmp U(movingPhaseModels_[0]*movingPhaseModels_[0].U()); for (label movingPhasei = 1; movingPhasei < nMovingPhases; ++ movingPhasei) { - U += + U.ref() += movingPhaseModels_[movingPhasei] *movingPhaseModels_[movingPhasei].U(); }