50 scalar tol = absTol_[i] + relTol_[i]*
max(
mag(y0[i]),
mag(y[i]));
51 maxErr =
max(maxErr,
mag(err[i])/tol);
65 absTol_(n_, dict.lookupOrDefault<scalar>(
"absTol", small)),
66 relTol_(n_, dict.lookupOrDefault<scalar>(
"relTol", 1
e-4)),
67 maxSteps_(dict.lookupOrDefault<scalar>(
"maxSteps", 10000))
96 <<
"Specified number of equations " <<
odes_.
nEqns()
97 <<
" greater than maximum " <<
maxN_ 155 scalar dxTry0 = step.
dxTry;
160 if ((x + step.
dxTry - xEnd)*(x + step.
dxTry - xStart) > 0)
170 if ((x - xEnd)*(xEnd - xStart) >= 0)
172 if (nStep > 0 && step.
last)
192 <<
"Integration steps greater than maximum " << maxSteps_ <<
nl 193 <<
" xStart = " << xStart <<
", xEnd = " << xEnd
194 <<
", x = " << x <<
", dxDid = " << step.
dxDid <<
nl virtual void solve(scalar &x, scalarField &y, scalar &dxTry) const
Solve the ODE system as far as possible up to dxTry.
ODESolver(const ODESystem &ode, const dictionary &dict)
Construct for given ODESystem.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Abstract base class for the systems of ordinary differential equations.
virtual bool resize()=0
Resize the ODE solver.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const ODESystem & odes_
Reference to ODESystem.
label maxSteps_
The maximum number of sub-steps allowed for the integration step.
errorManip< error > abort(error &err)
const label maxN_
Maximum size of the ODESystem.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
scalarField relTol_
Relative convergence tolerance per step.
scalar normalizeError(const scalarField &y0, const scalarField &y, const scalarField &err) const
Return the nomalized scalar error.
scalarField absTol_
Absolute convergence tolerance per step.
dimensioned< scalar > mag(const dimensioned< Type > &)
static void resizeField(UList< Type > &f, const label n)
const doubleScalar e
Elementary charge.
virtual label nEqns() const =0
Return the number of equations in the system.
label n_
Size of the ODESystem (adjustable)