Time-Marching Schemes¶
Problem Setup¶
We focus on integrating several partial differential equations involving both temporal and spatial derivatives in this project. When focusing only on the temporal derivatives, all equations can be written as
Note
We assume the right-hand-side term \(g\) is not a function of time explicitly, i.e., the following discussion is limited for autonomous systems. This applies to all equations discussed in this project.
This is equivalent to
or
where we introduce
and
To obtain \(\newvar{f}\) from \(\oldvar{f}\), we need to evaluate the right-hand-side integral. In this page, we aim at approximating the right-hand-side term using the Taylor-series expansion around \(\oldvar{t}\):
Zeroth-Order Scheme¶
The simplest but useless way to approximate the above Taylor series expansion is
where we only pick-up the first term. The leading-order error (local truncation error) is
which indicates the first-order accuracy. Since our objective is integrate the equation for a long time, we should consider the global truncation error, giving a reduced order of accuracy: \(\oerror{0}\). This indicates that the error never shrinks even with a smaller \(\Delta t\), which is useless.
Note
Hereafter we only focus on the global truncation errors.
Euler-Forward Scheme¶
We obtain a simple but (to some extent) practical scheme by extracting the first two terms:
or equivalently
which is known as the Euler-forward (or Euler-explicit) scheme.
Since the deviation from the series expansion is \(\oerror{2}\) (locally), this scheme has the first-order accuracy (globally).
Although it is very simple and easy to use, two clear issues exist:
It only has the first-order accuracy in time,
All terms are treated explicitly.
Fully-Explicit Runge-Kutta Scheme¶
To achieve a higher-order accuracy, we need to extract more than two terms from the series expansion above. In this project, we adopt the explicit Runge-Kutta scheme. Since the system is autonomous, we use a three-step and low-storage scheme to achieve the second-order accuracy in time:
Although the coefficients \(\alpha^k,\beta^k\) have several possibilities, we adopt
and
following e.g., Rai and Moin, J. Comput. Phys. (96), 1991, Verzicco and Orlandi, J. Comput. Phys. (123), 1996, Costa, Comput. Math Appl. (76), 2018.
For later convenience, we also introduce
or explicitly
Note that, since we have
the above three-step Runge-Kutta scheme is essentially a combination of three Euler-forward scheme with \(\gamma^k \Delta t\) as time-step sizes.
6static const double a0 = + 32. / 60., b0 = 0. / 60.;
7static const double a1 = + 25. / 60., b1 = - 17. / 60.;
8static const double a2 = + 45. / 60., b2 = - 25. / 60.;
9const rkcoef_t rkcoefs[RKSTEPMAX] = {
10 {.alpha = a0, .beta = b0, .gamma = a0 + b0},
11 {.alpha = a1, .beta = b1, .gamma = a1 + b1},
12 {.alpha = a2, .beta = b2, .gamma = a2 + b2},
13};
Proof of the second-order accuracy
Because of
we find
We use this relation repeatedly. For \(k = 1\), we have
whose derivation leads to
Note that \(k = 0\) corresponds to \(n\) (old information). For \(k = 2\), we have
whose derivation leads to
For \(k = 3\), we have
Since \(k = 3\) corresponds to \(n + 1\) (new information), we find
indicating that this scheme has the third-order accuracy (locally) and the second-order accuracy (globally).
Implicit Treatment¶
As justified later, we treat some terms implicitly in time; among others we adopt Crank-Nicolson scheme:
which has the second-order accuracy in time as well.
Proof of the second-order accuracy
Because of
we find
indicating that this scheme has the third-order accuracy (locally) and the second-order accuracy (globally).
Combined scheme¶
We embed the implicit treatment (Crank-Nicolson scheme) into the Runge-Kutta iterations:
where \(g\) and \(h\) are terms treated explicitly and implicitly in time, respectively.