ODESolver.C: Corrected the estimated step-size returned to the calling code
Correction provided by David Gaden.
This commit is contained in:
@ -153,6 +153,67 @@ public:
|
||||
blendingFactor*tScheme1_().interpolate(vf)
|
||||
+ (scalar(1) - blendingFactor)*tScheme2_().interpolate(vf);
|
||||
}
|
||||
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
{
|
||||
return tScheme1_().corrected() || tScheme2_().corrected();
|
||||
}
|
||||
|
||||
|
||||
//- Return the explicit correction to the face-interpolate
|
||||
// for the given field
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
correction
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
const surfaceScalarField& blendingFactor =
|
||||
this->mesh().objectRegistry::
|
||||
lookupObject<const surfaceScalarField>
|
||||
(
|
||||
word(vf.name() + "BlendingFactor")
|
||||
);
|
||||
|
||||
if (tScheme1_().corrected())
|
||||
{
|
||||
if (tScheme2_().corrected())
|
||||
{
|
||||
return
|
||||
(
|
||||
blendingFactor
|
||||
* tScheme1_().correction(vf)
|
||||
+ (scalar(1.0) - blendingFactor)
|
||||
* tScheme2_().correction(vf)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return
|
||||
(
|
||||
blendingFactor
|
||||
* tScheme1_().correction(vf)
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (tScheme2_().corrected())
|
||||
{
|
||||
return
|
||||
(
|
||||
(scalar(1.0) - blendingFactor)
|
||||
* tScheme2_().correction(vf)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
(
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user