Bugfix: mesh flux using backward scheme with variable time step

The coefficients in backwardDdtScheme::meshPhi did not correctly take into
account the possibility of having variable time steps.

Reported by Sopheak Seng, Bureau Veritas.
This commit is contained in:
Vuko Vukcevic 2018-09-07 14:56:55 +02:00
parent bb6facbfbf
commit d5b37a2d37

View file

@ -801,16 +801,15 @@ tmp<surfaceScalarField> backwardDdtScheme<Type>::meshPhi
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) )
{ {
scalar deltaT = deltaT_(); const scalar deltaT = deltaT_();
scalar deltaT0 = deltaT0_(vf); const scalar deltaT0 = deltaT0_(vf);
// Coefficient for t-3/2 (between times 0 and 00) // Bugfix: missing possibility of having the variable time step
scalar coefft0_00 = deltaT/(deltaT + deltaT0); // Reported by Sopheak Seng, Bureau Veritas, 6/Sep/2018.
const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
// Coefficient for t-1/2 (between times n and 0) return coefft*mesh().phi() - coefft00*mesh().phi().oldTime();
scalar coefftn_0 = 1 + coefft0_00;
return coefftn_0*mesh().phi() - coefft0_00*mesh().phi().oldTime();
} }