localBlended: Added support for "corrected" schemes

Resolves bug report: http://www.openfoam.com/mantisbt/view.php?id=30
This commit is contained in:
Henry
2010-09-17 15:10:28 +01:00
parent 4e7fa4989b
commit 1cac1aaecc

View File

@ -60,6 +60,8 @@ void Foam::ODESolver::solve
scalar x = xStart;
scalar h = hEst;
scalar hNext = 0;
scalar hPrev = 0;
for (label nStep=0; nStep<MAXSTP; nStep++)
{
@ -73,14 +75,24 @@ void Foam::ODESolver::solve
if ((x + h - xEnd)*(x + h - xStart) > 0.0)
{
h = xEnd - x;
hPrev = hNext;
}
scalar hNext, hDid;
hNext = 0;
scalar hDid;
solve(ode, x, y, dydx_, eps, yScale_, h, hDid, hNext);
if ((x - xEnd)*(xEnd - xStart) >= 0.0)
{
hEst = hNext;
if (hPrev != 0)
{
hEst = hPrev;
}
else
{
hEst = hNext;
}
return;
}