mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
reactingEulerFoam: Fixed memory error introduced by commit efad85b0
This commit is contained in:
@ -239,10 +239,10 @@ Foam::tmp<Foam::volScalarField> Foam::phaseSystem::rho() const
|
|||||||
{
|
{
|
||||||
const label nMovingPhases = movingPhaseModels_.size();
|
const label nMovingPhases = movingPhaseModels_.size();
|
||||||
|
|
||||||
volScalarField rho(movingPhaseModels_[0]*movingPhaseModels_[0].rho());
|
tmp<volScalarField> rho(movingPhaseModels_[0]*movingPhaseModels_[0].rho());
|
||||||
for (label movingPhasei = 1; movingPhasei < nMovingPhases; ++ movingPhasei)
|
for (label movingPhasei = 1; movingPhasei < nMovingPhases; ++ movingPhasei)
|
||||||
{
|
{
|
||||||
rho +=
|
rho.ref() +=
|
||||||
movingPhaseModels_[movingPhasei]
|
movingPhaseModels_[movingPhasei]
|
||||||
*movingPhaseModels_[movingPhasei].rho();
|
*movingPhaseModels_[movingPhasei].rho();
|
||||||
}
|
}
|
||||||
@ -266,10 +266,10 @@ Foam::tmp<Foam::volVectorField> Foam::phaseSystem::U() const
|
|||||||
{
|
{
|
||||||
const label nMovingPhases = movingPhaseModels_.size();
|
const label nMovingPhases = movingPhaseModels_.size();
|
||||||
|
|
||||||
volVectorField U(movingPhaseModels_[0]*movingPhaseModels_[0].U());
|
tmp<volVectorField> U(movingPhaseModels_[0]*movingPhaseModels_[0].U());
|
||||||
for (label movingPhasei = 1; movingPhasei < nMovingPhases; ++ movingPhasei)
|
for (label movingPhasei = 1; movingPhasei < nMovingPhases; ++ movingPhasei)
|
||||||
{
|
{
|
||||||
U +=
|
U.ref() +=
|
||||||
movingPhaseModels_[movingPhasei]
|
movingPhaseModels_[movingPhasei]
|
||||||
*movingPhaseModels_[movingPhasei].U();
|
*movingPhaseModels_[movingPhasei].U();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user