pimpleDyMFoam: Store Uf as an autoPtr for better error handling

This commit is contained in:
Henry Weller
2017-11-20 22:46:47 +00:00
parent 852461e87d
commit 182a54f54c
7 changed files with 12 additions and 14 deletions

View File

@ -212,12 +212,12 @@ ddtCorr
fvsPatchField,
surfaceMesh
>& phi,
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
const autoPtr<GeometricField<Type, fvsPatchField, surfaceMesh>>& Uf
)
{
if (U.mesh().changing())
{
return ddtCorr(U, Uf);
return ddtCorr(U, Uf());
}
else
{

View File

@ -173,7 +173,7 @@ namespace fvc
fvsPatchField,
surfaceMesh
>& phi,
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
const autoPtr<GeometricField<Type, fvsPatchField, surfaceMesh>>& Uf
);
template<class Type>

View File

@ -221,7 +221,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute
void Foam::fvc::correctUf
(
surfaceVectorField& Uf,
autoPtr<surfaceVectorField>& Uf,
const volVectorField& U,
const surfaceScalarField& phi
)
@ -230,9 +230,9 @@ void Foam::fvc::correctUf
if (phi.mesh().changing())
{
Uf = fvc::interpolate(U);
Uf() = fvc::interpolate(U);
surfaceVectorField n(mesh.Sf()/mesh.magSf());
Uf += n*(phi/mesh.magSf() - (n & Uf));
Uf() += n*(phi/mesh.magSf() - (n & Uf()));
}
}

View File

@ -150,7 +150,7 @@ namespace fvc
void correctUf
(
surfaceVectorField& Uf,
autoPtr<surfaceVectorField>& Uf,
const volVectorField& U,
const surfaceScalarField& phi
);