You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/theory/cs_equation_iterative_solve.tex
+28-32Lines changed: 28 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -178,16 +178,12 @@ \section*{Implementation}
178
178
- determination of the properties of the $\tens{EM}_{n}$ matrix (symmetric
179
179
if there is no convection, asymmetric otherwise)\\
180
180
- automatic selection of the solution method for its inversion if the user has not already
181
-
specified one for the variable being treated. The Jacobi method is used by default for every convected scalar variable $a$. The methods available are the conjugate gradient method, Jacobi's and the
182
-
bi-conjugate gradient stabilised method ($BICGStab$) for asymmetric matrices. Diagonal pre-conditioning can be implemented and is used by default for all of these solvers except for Jacobi.\\
183
-
- consideration of the periodicity (translation or rotation of a scalar, vector or tensor),\\
184
-
- construction of the $\tens{EM}_{n}$ matrix corresponding to the linear operator $\mathcal{EM}_{n}$ through a call to the subroutine
185
-
\fort{matrix}\footnote{ Remember that in \fort{matrix}, regardless of the user's choice, a first-order in space upwind scheme is always used to treat the convection and there is no reconstruction for
181
+
specified one for the variable being treated. By default, a hybrid Gauss-Seidel or Jacobi method is used by default for every convected scalar variable $a$, as these methods are usually the fastest when diagonal dominance is high (which is the case when the time step is small).\\
182
+
- construction of the $\tens{EM}_{n}$ matrix corresponding to the linear operator $\mathcal{EM}_{n}$ through a call to the
183
+
\fort{cs\_matrix\_compute\_coeffs} function\footnote{Remember that in \fort{cs\_matrix\_compute\_coeffs}, regardless of the user's choice, a first-order in space upwind scheme is always used to treat the convection and there is no reconstruction for
186
184
the diffusive flux. The user's choice of numerical scheme for the convection is only applied for the integration
187
185
of the convection terms of $\mathcal{E}_{n}$, on the right-hand side of
188
-
(\ref{Base_Codits_Eq_Codits}), which computed in the subroutine \fort{cs\_balance}.}. The implicit terms corresponding to the diagonal part of the matrix and hence to the zeroth-order linear differential contributions in $a^{n+1}$,({\it i.e.} $f_s^{imp}$), are stored in the array \var{ROVSDT} (realized before the subroutine calls \fort{cs\_equation\_iterative\_solve}).\\
189
-
- creation of the grid hierarchy if the multigrid algorithm is used
190
-
($\var{IMGRP}\,>0$).\\
186
+
(\ref{Base_Codits_Eq_Codits}), which are computed in the \fort{cs\_balance} functions.}. The implicit terms corresponding to the diagonal part of the matrix and hence to the zeroth-order linear differential contributions in $a^{n+1}$,({\it i.e.} $f_s^{imp}$), are stored in the array \var{ROVSDT} (realized before the subroutine calls \fort{cs\_equation\_iterative\_solve}).\\
191
187
- call to \fort{cs\_balance} to take the explicit convection-diffusion into account should
192
188
$\theta\ne0$.\\
193
189
- loop over the number of iterations from 1 to $\var{NSWRSM}$ (which is called $\var{NSWRSP}$ in \fort{cs\_equation\_iterative\_solve}).
@@ -207,40 +203,40 @@ \section*{Implementation}
207
203
The loop in $k$ is then the following:
208
204
\begin{itemize}
209
205
\item Computation of the right-hand side of the equation, without the contribution of
210
-
the explicit convection-diffusion terms $\var{SMBINI}$; as for the whole right-hand side corresponding
211
-
to $\mathcal{E}_{n}(a^{n+1,\,k-1})$, it is stored in the array $\var{SMBRP}$,
212
-
initialised by $\var{SMBINI}$ and completed with the reconstructed
206
+
the explicit convection-diffusion terms $\var{RHSINI}$; as for the whole right-hand side corresponding
207
+
to $\mathcal{E}_{n}(a^{n+1,\,k-1})$, it is stored in the array $\var{RHS}$,
208
+
initialised by $\var{RHSINI}$ and completed with the reconstructed
213
209
convection-diffusion terms by a call to the subroutine \fort{cs\_balance}.\\
214
-
At iteration $k$, $\var{SMBINI}$ noted $\var{SMBINI}^{\,k}$ is equal to:\\
210
+
At iteration $k$, $\var{RHSINI}$ noted $\var{RHSINI}^{\,k}$ is equal to:\\
$\bullet$ Before starting the loop over $k$, a first call to the subroutine \fort{cs\_balance} with $\var{THETAP}=1-\theta$ serves to take the explicit part (from the time advancement scheme) of the convection-diffusion terms into account.
Similarly, before looping on $k$, the right-hand side $\var{SMBRP}^{\,0}$ is stored in the array $\var{SMBINI}^{\,0}$ and serves to initialize the computation.
220
+
Similarly, before looping on $k$, the right-hand side $\var{RHS}^{\,0}$ is stored in the array $\var{RHSINI}^{\,0}$ and serves to initialize the computation.
and $\var{SMBRP}^{\,1}$ is completed by a second call to the subroutine \fort{cs\_balance} with $\var{THETAP}=\theta$, so that the implicit part of the convection-diffusion computation is added to the right-hand side.
236
+
and $\var{RHS}^{\,1}$ is completed by a second call to the subroutine \fort{cs\_balance} with $\var{THETAP}=\theta$, so that the implicit part of the convection-diffusion computation is added to the right-hand side.
Then follows the computation and the addition of the reconstructed convection-diffusion terms of
@@ -283,10 +279,10 @@ \section*{Implementation}
283
279
(first-order accurate in space upwind scheme, centred scheme with second-order spatial discretisation, second-order
284
280
linear upwind "SOLU" scheme or a weighted average (blending) of one of the second-order schemes (either centred or SOLU) and the first-order upwind scheme, with potential use of a slope test).\\
285
281
This contribution (convection-diffusion) is then added in to the right side of the
286
-
equation $\var{SMBRP}^{\,k+1}$ (initialised by $\var{SMBINI}^{\,k+1}$).
282
+
equation $\var{RHS}^{\,k+1}$ (initialised by $\var{RHSINI}^{\,k+1}$).
\item Treatment of parallelism and of the periodicity.
307
303
\item Test of convergence:\\
308
-
The test involves the quantity $||\var{SMBRP}^{\,k+1}|| < \varepsilon
309
-
||\tens{EM}_{n}(a^{n}) + \var{SMBRP}^{\,1}|| $, where $||\,.\,||$ denotes the
304
+
The test involves the quantity $||\var{RHS}^{\,k+1}|| < \varepsilon
305
+
||\tens{EM}_{n}(a^{n}) + \var{RHS}^{\,1}|| $, where $||\,.\,||$ denotes the
310
306
Euclidean norm. The solution sought is $a^{\,n+1} = a^{n+1,\,k+1}$. If the test is satisfied, then convergence has been reached and we exit the iteration loop. \\
311
307
If not, we continue to iterate until the upper limit of iterations imposed by $\var{NSWRSM}$ in \fort{usini1} is reached.\\
312
308
The condition for convergence is also written, in continuous form, as:
As a consequence, on orthogonal mesh with an upwind convection scheme and in the absence of source terms, the sequence converges in theory in a single iteration because, by construction:
0 commit comments