mirror of
https://git.gfz-potsdam.de/naaice/tug.git
synced 2025-12-13 17:38:23 +01:00
Update documentation of implicit BTCS
This commit is contained in:
parent
0f646d478c
commit
d54fe25cac
@ -195,23 +195,36 @@ A similar treatment can be applied to the BTCS implicit scheme.
|
|||||||
|
|
||||||
*** implicit BTCS
|
*** implicit BTCS
|
||||||
|
|
||||||
\begin{equation}\displaystyle
|
First, we define the Backward time difference:
|
||||||
\frac{C_i^{j+1} -C_i^{j}}{\Delta t} = \alpha\frac{\frac{C^{j+1}_{i+1}-C^{j+1}_{i}}{\Delta x}-\frac{C^{j+1}_{i}-C^{j+1}_{i-1}}{\Delta x}}{\Delta x}
|
|
||||||
|
\begin{equation}
|
||||||
|
\frac{\partial C }{\partial t} = \frac{C^j_i - C^{j-1}_i}{\Delta t}
|
||||||
\end{equation}
|
\end{equation}
|
||||||
|
|
||||||
In practice, we evaluate the first derivatives of $C$ w.r.t. $x$ on
|
Second the spatial derivative approximation:
|
||||||
the boundaries of each cell (i.e., $(C_{i+1}-C_i)/\Delta x$ on the
|
|
||||||
right boundary of the i-th cell and $(C_{i}-C_{i-1})/\Delta x$ on its
|
|
||||||
left cell boundary) and then repeat the differentiation to get the
|
|
||||||
second derivative of $C$ on the the cell centre $i$.
|
|
||||||
|
|
||||||
This discretization works for all internal cells, but not for the
|
\begin{equation}
|
||||||
boundaries. To properly treat them, we need to account for the
|
\frac{\partial^2 C }{\partial t} = \frac{\frac{C^{j}_{i+1}-C^{j}_{i}}{\Delta x}-\frac{C^{j}_{i}-C^{j}_{i-1}}{\Delta x}}{\Delta x}
|
||||||
discrepancy in the discretization.
|
\end{equation}
|
||||||
|
|
||||||
For the first (left) cell, whose center is at $x=dx/2$, we can
|
Taking the 1D diffusion equation from [[eqn:1]] and substituting each term by the
|
||||||
evaluate the left gradient with the left boundary using such distance,
|
equations given above leads to the following equation:
|
||||||
calling $l$ the numerical value of a constant boundary condition:
|
|
||||||
|
\begin{equation}\displaystyle
|
||||||
|
\frac{C_i^{j} -C_i^{j-1}}{\Delta t} = \alpha\frac{\frac{C^{j}_{i+1}-C^{j}_{i}}{\Delta x}-\frac{C^{j}_{i}-C^{j}_{i-1}}{\Delta x}}{\Delta x}
|
||||||
|
\end{equation}
|
||||||
|
|
||||||
|
Since we are not able to solve this system w.r.t unknown values in $C^{j-1}$ we
|
||||||
|
are shifting each j by 1 to $j \to (j+1)$ and $(j-1) \to j$ which leads to:
|
||||||
|
|
||||||
|
\begin{align}\displaystyle
|
||||||
|
\frac{C_i^{j+1} - C_i^{j}}{\Delta t} & = \alpha\frac{\frac{C^{j+1}_{i+1}-C^{j+1}_{i}}{\Delta x}-\frac{C^{j+1}_{i}-C^{j+1}_{i-1}}{\Delta x}}{\Delta x} \nonumber \\
|
||||||
|
& = \alpha\frac{C^{j+1}_{i-1} - 2C^{j+1}_{i} + C^{j+1}_{i+1}}{\Delta x^2}
|
||||||
|
\end{align}
|
||||||
|
|
||||||
|
This only applies to inlet cells with no ghost node as neighbor. For the left
|
||||||
|
cell with its center at $\frac{dx}{2}$ and the constant concentration on the
|
||||||
|
left ghost node called $l$ the equation goes as followed:
|
||||||
|
|
||||||
\begin{equation}\displaystyle
|
\begin{equation}\displaystyle
|
||||||
\frac{C_0^{j+1} -C_0^{j}}{\Delta t} = \alpha\frac{\frac{C^{j+1}_{1}-C^{j+1}_{0}}{\Delta x}-
|
\frac{C_0^{j+1} -C_0^{j}}{\Delta t} = \alpha\frac{\frac{C^{j+1}_{1}-C^{j+1}_{0}}{\Delta x}-
|
||||||
@ -225,7 +238,7 @@ C_0^{j+1} & = C_0^{j} + \frac{\alpha \cdot \Delta t}{\Delta x^2} \cdot \left( C
|
|||||||
& = C_0^{j} + \frac{\alpha \cdot \Delta t}{\Delta x^2} \cdot \left( C^{j+1}_{1}- 3 C^{j+1}_{0} +2l \right)
|
& = C_0^{j} + \frac{\alpha \cdot \Delta t}{\Delta x^2} \cdot \left( C^{j+1}_{1}- 3 C^{j+1}_{0} +2l \right)
|
||||||
\end{align}
|
\end{align}
|
||||||
|
|
||||||
Now we define variable $s_x$ as following:
|
Now we define variable $s_x$ as followed:
|
||||||
|
|
||||||
\begin{equation}
|
\begin{equation}
|
||||||
s_x = \frac{\alpha \cdot \Delta t}{\Delta x^2}
|
s_x = \frac{\alpha \cdot \Delta t}{\Delta x^2}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user