mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
memory leak
This commit is contained in:
@ -81,17 +81,20 @@ Foam::phaseModel::phaseModel
|
|||||||
{
|
{
|
||||||
Info<< "Reading face flux field " << phiName << endl;
|
Info<< "Reading face flux field " << phiName << endl;
|
||||||
|
|
||||||
phiPtr_ = new surfaceScalarField
|
phiPtr_.reset
|
||||||
(
|
(
|
||||||
IOobject
|
new surfaceScalarField
|
||||||
(
|
(
|
||||||
phiName,
|
IOobject
|
||||||
mesh.time().timeName(),
|
(
|
||||||
mesh,
|
phiName,
|
||||||
IOobject::MUST_READ,
|
mesh.time().timeName(),
|
||||||
IOobject::AUTO_WRITE
|
mesh,
|
||||||
),
|
IOobject::MUST_READ,
|
||||||
mesh
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -112,18 +115,21 @@ Foam::phaseModel::phaseModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
phiPtr_ = new surfaceScalarField
|
phiPtr_.reset
|
||||||
(
|
(
|
||||||
IOobject
|
new surfaceScalarField
|
||||||
(
|
(
|
||||||
phiName,
|
IOobject
|
||||||
mesh.time().timeName(),
|
(
|
||||||
mesh,
|
phiName,
|
||||||
IOobject::NO_READ,
|
mesh.time().timeName(),
|
||||||
IOobject::AUTO_WRITE
|
mesh,
|
||||||
),
|
IOobject::NO_READ,
|
||||||
fvc::interpolate(U_) & mesh.Sf(),
|
IOobject::AUTO_WRITE
|
||||||
phiTypes
|
),
|
||||||
|
fvc::interpolate(U_) & mesh.Sf(),
|
||||||
|
phiTypes
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,7 +69,7 @@ class phaseModel
|
|||||||
volVectorField U_;
|
volVectorField U_;
|
||||||
|
|
||||||
//- Fluxes
|
//- Fluxes
|
||||||
surfaceScalarField* phiPtr_;
|
autoPtr<surfaceScalarField> phiPtr_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -133,12 +133,12 @@ public:
|
|||||||
|
|
||||||
const surfaceScalarField& phi() const
|
const surfaceScalarField& phi() const
|
||||||
{
|
{
|
||||||
return *phiPtr_;
|
return phiPtr_();
|
||||||
}
|
}
|
||||||
|
|
||||||
surfaceScalarField& phi()
|
surfaceScalarField& phi()
|
||||||
{
|
{
|
||||||
return *phiPtr_;
|
return phiPtr_();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user