Solvers¶
The algorithm choices for the simulation environment are set using the
chidg%set
method with a selection parameter and a string option:
call chidg%set('Time Integrator', String)
call chidg%set('Nonlinear Solver',String)
call chidg%set('Linear Solver', String)
call chidg%set('Preconditioner', String)
Time Integrators¶
Algorithm | String Selector |
---|---|
Steady | Steady |
Backward Euler | Backward Euler |
Diagonally-Implicit Runge-Kutta | DIRK |
Harmonic Balance | Harmonic Balance |
Forward Euler | Forward Euler |
Explicit Runge Kutta | Runge-Kutta Method |
ChiDG Representation¶
Integration of the temporal derivative term
in
is handled by the time_integrator_t
class.
type, abstract, public :: time_integrator_t
contains
procedure(data_interface), deferred :: step ! Must define this procedure in the extended type
end type time_integrator_t
Note that in the terminology used in this section, \(M\) is the Mass Matrix
and \(R(Q)\) is the right-hand-side vector of spatial operators
Implicit integrators¶
Steady¶
Nonlinear problem:
Newton Linearization:
Backward Euler¶
Solution advancement via first-order backward difference of the time derivative:
Nonlinear problem:
Newton Linearization:
where, \(\delta Q^{m} = \Delta Q^{m + 1} -\Delta Q^{m}\) for the \(m^{th}\) Newton iteration.
Note
- The ChiDG nonlinear solver requires the assembly of the linearized system outlined above
- The nonlinear solver computes \(\hat{Q}^{m}\) instead of \(\Delta \hat{Q}^{m}\)
- For the assembly of the rhs of the linearized system, \(\Delta \hat{Q}^{m} = \hat{Q}^{m} - \hat{Q}^{n}\)
Diagonally-Implicit Runge-Kutta¶
With the coefficient arrays associated with the diagonally implicit Runge-Kutta method:
where \(\gamma\) is the root of \(x^{3} - 3x^{2} + \frac{3}{2}x - \frac{1}{6} = 0 \in \left(\frac{1}{6},\frac{1}{2}\right)\) and
The solution is advanced in time as:
Implicit system:
Newton linearization:
with
Note
- The ChiDG nonlinear solver requires the assembly of the stagewise linearized systems
- The nonlinear solver computes \(\hat{Q}^{m}_{i}\) instead of \(\Delta \hat{Q}^{m}_{i}\)
- For the assembly of the rhs of the linearized system, \(\Delta \hat{Q}^{m}_{i} = (\hat{Q}^{m}_{i} - \hat{Q}^{n} - \sum_{j = 1}^{i - 1}A_{ij}\Delta \hat{Q}_{i})/\gamma\)
Harmonic Balance¶
Consider a set of \(N\) independent equations:
where
In the harmonic balance method, a conservative solution vector at any instant of time is represented as a Fourier series in time as:
with \(K\) frequencies, \(\boldsymbol{\omega} = [\omega_{1}, \omega_{2}, \cdots, \omega_{K}]\) and the instant of time \(t_{n}\) belongs to the set of time levels, \(\boldsymbol{t} = [t_{1}, t_{2}, \cdots, t_{N}]\) with \(N = 2K + 1\). Thus, the series of conservative solution vectors can be related to the Fourier coefficients vectors, \(\hat{\boldsymbol{Q}}_{F}\) as:
Defining the pseudo spectral operator as,
which couples \(\hat{\boldsymbol{Q}}^{*}\) such that the conservative solutions satisfy time-varying sinusoidal functions according to their Fourier representation, the governing equation can be rewritten as the Harmonic Balance equation:
Multiplying with a column of test functions, \(\psi\) and applying Gauss’ divergence theorem provides the working form of the Harmonic Balance equation:
Newton Linearization:
Consider,
\[\begin{split}\mathscr{R}^{*} & = \int_{\Gamma_{e}}\boldsymbol{F}^{*} \cdot \vec{n}d\Gamma - \int_{\Omega_{e}}\nabla \psi \cdot \boldsymbol{F}^{*}d\Omega + \int_{\Omega_{e}}\psi \boldsymbol{S}^{*}d\Omega\\ \mathscr{D}^{*} & = \int_{\Omega_{e}}\psi D\hat{\boldsymbol{Q}}^{*}d\Omega\end{split}\]
Then, Newton linearization of the Harmonic Balance system of equations is:
Explicit integrators¶
Forward Euler¶
Solution advancement via a first-order forward difference of the time derivative:
Algebraic problem:
Solution iterated in time as:
Explicit Runge Kutta¶
For a general explicit runge Kutta method with \(s\) stages:
where
Algebraic problem:
Solution iterated in time as:
Nonlinear solvers¶
Algorithm | String Selector |
---|---|
Newton | Newton |
Quasi-Newton | Quasi-Newton |
ChiDG Representation¶
ChiDG includes nonlinear solvers for solving the nonlinear sets of partial differential equations. In general, the implicit problem statement here is:
- Find \(Q\), such that \(\mathcal{R}(Q) = 0\)
type, abstract, public :: nonlinear_solver_t
contains
procedure(data_interface), deferred :: solve ! Must define this procedure in the extended type
end type nonlinear_solver_t
Newton¶
The Full-Newton solver solves the equation
where \(\mathcal{R}(Q)\) is some potentially nonlinear function of the solution. This depends on the discretization, the equation set, the solution order, and the time-integration scheme. The Newton solver linearizes the problem and computes an update of the solution by solving
So, at each Newton step, a linear system of equations is being solved for \(\Delta Q\). Once the update is solved for, the solution vector is updated as
Considerations:¶
One item to consider when using the Full-Newton solver is that the Newton linearization(direction) is dependent on the current solution. Without a reasonable initial guess, Newton’s method can diverge by sending the solution too far in the wrong direction.
Quasi-Newton¶
The Quasi-Newton solver solves a modified set of equations
Note the addition of a pseudo-time term to the nonlinear system of equations. This is an effort increase robustness of the nonlinear solver by limiting the size of the solution update in a single Newton step. This is accomplished by adding the time-scaling to the diagonal of the Jacobian matrix, increasing the diagonal dominance of the matrix, and limiting the size of the soltion update. As the solution progresses, the pseudo-timestep is increased the pseudo-time derivative goes to zero and the original system of equations is recovered.
The Quasi-Newton solver linearizes the problem including the pseudo-time scaling of the solution update to the system of equations as
So, at each Quasi-Newton step, a linear system of equations is being solved for \(\Delta Q\). Once the update is solved for, the solution vector is updated as
At each Quasi-Newton step, the pseudo-time step is updated as
where \(h_e = \sqrt[3]{\Omega_e}\) and \(\bar{\lambda_e} = |\bar{V_e}| + \bar{c}\) is a mean characteristic speed. The CFL term is computed from the ratio of the initial and current residual norms as
Linear Solvers¶
Algorithm | String Selector |
---|---|
Flexible Generalized Minimum Residual | FGMRES |
ChiDG Representation¶
Flexible Generalized Minimum Residual¶
A flexible version of the Generalized Minimum Residual(FGMRES) algorithm, which is an iterative method for solving linear systems of equations. The FGMRES algorithm allows the GMRES algorithm to be preconditioned in a flexible way such that the solution can be easily reconstructed.
Preconditioners¶
Algorithm | String Selector |
---|---|
block-Jacobi | Jacobi |
block-ILU0 | ILU0 |
Restricted Additive Schwarz + block-ILU0 | RAS+ILU0 |