---
# System prepended metadata

title: '***Computational Hydraulics***'
tags: [HW5.2]

---

---
tags: HW5.2
---
# ***Computational Hydraulics***
## **Group 01:** N88071053 洪豪男 N88091011 黃彥鈞
## **HW5.2:** Please prove the above formulation


---

$u^{n+1}_j = 
\lambda a^n_{j-1/2}w^{n+1}_{j-1/2} 
+\Bigl[1 - \lambda\left(a^n_{j-1/2}+a^n_{j+1/2}\right)\Bigr]w^{n+1}_j
\\ \quad\quad\quad+\lambda a^n_{j+1/2}w^{n+1}_{j+1/2}+
\dfrac{\Delta x}{2}\Bigl[(\lambda a^n_{j-1/2})^2(u_x)^{n+1}_{j-1/2}-(\lambda a^n_{j+1/2})^2(u_x)^{n+1}_{j+1/2}\Bigr]$

$\dfrac{u^{n+1}_j - u^n_j}{\Delta t}=\dfrac{1}{\Delta x} a^n_{j-1/2}w^{n+1}_{j-1/2} 
+\Bigl[\dfrac{1}{\Delta t} - \dfrac{(a^n_{j-1/2}+a^n_{j+1/2})}{\Delta x}\Bigr]w^{n+1}_j
\\ \quad\quad\quad\quad\quad+\dfrac{1}{\Delta x} a^n_{j+1/2}w^{n+1}_{j+1/2}-
\dfrac{1}{\Delta t}u_j^n+{\cal O}(\lambda)$

---
$\begin{array}{rl}w_{j-1/2}^{n+1}=&\dfrac{u_j^n+u_{j-1}^n}{2}+
 \dfrac{\Delta x - a^{n}_{j-1/2}\Delta t}{4}\Bigl[(u_x)^{n}_{j-1}-(u_x)^{n}_{j}\Bigr]\\ &-\dfrac{1}{2a_{j-1/2}^{n}}\Bigl[f\bigl(u^{n+1/2}_{j-1/2,r}\bigr)- f\bigl(u^{n+1/2}_{j-1/2,l}\bigr)\Bigr]
 \end{array}$

$\dfrac{1}{\Delta x} a^n_{j-1/2}w^{n+1}_{j-1/2}
\\=\dfrac{a^n_{j-1/2}}{2 \Delta x}(u_j^n+u_{j-1}^n)+
 \dfrac{a^{n}_{j-1/2}}{4}\Bigl[(u_x)^{n}_{j-1}-(u_x)^{n}_{j}\Bigr]-\dfrac{\lambda (a^{n}_{j-1/2})^2}{4}\Bigl[(u_x)^{n}_{j-1}-(u_x)^{n}_{j}\Bigr] \\\quad-\dfrac{1}{2 \Delta x}\Bigl[f\bigl(u^{n+1/2}_{j-1/2,r}\bigr)- f\bigl(u^{n+1/2}_{j-1/2,l}\bigr)\Bigr]$
 
---
$w_{j}^{n+1}=u^n_j+\dfrac{\Delta t}{2}(a^n_{j-1/2}-a^n_{j+1/2})(u_x)^{n}_{j}
\\\quad\quad-\dfrac{\lambda}{1 -\lambda(a^n_{j+1/2}+a^n_{j-1/2})}[f\bigl(u^{n+1/2}_{j+1/2,l}\bigr) - f\bigl(u^{n+1/2}_{j-1/2,r}\bigr)\Bigr]$

$\Bigl[\dfrac{1}{\Delta t} - \dfrac{(a^n_{j-1/2}+a^n_{j+1/2})}{\Delta x}\Bigr]w^{n+1}_j
\\=\dfrac{1}{\Delta t}u^n_j-\dfrac{(a^n_{j-1/2}+a^n_{j+1/2})}{\Delta x}u^n_j+\dfrac{1}{2}(a^n_{j-1/2}-a^n_{j+1/2})(u_x)^{n}_{j}
\\\quad-\dfrac{\lambda}{2}(a^n_{j-1/2}-a^n_{j+1/2})(a^n_{j-1/2}+a^n_{j+1/2})(u_x)^{n}_{j}-\dfrac{1}{\Delta x}[f\bigl(u^{n+1/2}_{j+1/2,l}\bigr) - f\bigl(u^{n+1/2}_{j-1/2,r}\bigr)\Bigr]$

---

$\begin{array}{rl}w_{j+1/2}^{n+1}=&\dfrac{u_j^n+u_{j+1}^n}{2}+
 \dfrac{\Delta x - a^{n}_{j+1/2}\Delta t}{4}\Bigl[(u_x)^{n}_{j}-(u_x)^{n}_{j+1}\Bigr]\\ &-\dfrac{1}{2a_{j+1/2}^{n}}\Bigl[f\bigl(u^{n+1/2}_{j+1/2,r}\bigr)- f\bigl(u^{n+1/2}_{j+1/2,l}\bigr)\Bigr]
 \end{array}$
 

 
$\dfrac{1}{\Delta x} a^n_{j+1/2}w^{n+1}_{j+1/2}
\\=\d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\Delta t}u^n_j-\dfrac{1}{\Delta t}u^n_j\Biggr\}
\\\quad-\Biggl\{\dfrac{\lambda}{2}(a^n_{j-1/2}-a^n_{j+1/2})(a^n_{j-1/2}+a^n_{j+1/2})(u_x)^{n}_{j}+{\cal O}(\lambda)\Biggr\}
\\=\dfrac{1}{2\Delta x}\Biggl\{-\Bigl[\left(f\left(u^{n+1/2}_{j+1/2,r}\right)+f\left(u^{n+1/2}_{j+1/2,l}\right)\right)-\left(f\left(u^{n+1/2}_{j-1/2,r}\right)+f\left(u^{n+1/2}_{j-1/2,l}\right)\right)\Bigr]\Biggr.\\
\quad \left.+a^n_{j+1/2}\left[\left(u^n_{j+1}-\dfrac{\Delta x}{2}(u_x)^n_{j+1}\right)-\left(u^n_{j}+\dfrac{\Delta x}{2}(u_x)^n_j\right)\right]\right.\\
\quad \Biggl.-a^n_{j-1/2}\left[\left(u^n_{j}-\dfrac{\Delta x}{2}(u_x)^n_{j}\right)-\left(u^n_{j-1}+\dfrac{\Delta x}{2}(u_x)^n_{j-1}\right)\right]\Biggr\}+{\cal O}(\lambda)$
