Posts for the month of June 2011

Roe Convection Term

As a relatively painless entry to the implementation of higher order Riemann solvers in FiPy, I'm planning on implementing a basic Roe solver. Given a basic vector advection equation,

$  \partial_t \phi^i + \partial_j \left( u^{ji}_{k} \phi^k \right) = 0$

flux updates for a Roe solver can be written,

$  F^i = \frac{1}{2} \left[ n_j u^{ji-}_k \phi^{k-} + n_j u^{ji+}_k \phi^{k+} \right] - \frac{1}{2} n_j |\hat{A}^{ji}_k| \left( \phi^{k+} - \phi^{k-} \right) $

where the flux is across a face between cell $C^-$ and cell $C^+$ and the normal $n_j$ points from $C^-$ to $C^+$. The question when implementing Roe solvers is how to approximate $\hat{A}^{ji}_k$ from the local Riemann problem

$ \partial_t \phi^i + A^{ji}_{k} \partial_j \phi^k = 0 $

where

$ A^{ji}_{k} = \frac{ \partial \left( u^{ji}_l \phi^l \right) }{ \partial \phi_k } $

It is generally impossible to obtain an exact calculation for $A_{jik}$ at the face. Strictly speaking, a Roe solver involves quite a complicated method to obtain an approximation for $A_{jik}$, $\hat{A}_{jik}$. For the time being, in order to test the constant coefficient problems we will use a simple calculation for $\hat{A}_{jik}$, namely,

$ \hat{A}^{ji}_k = \frac{ u^{ji+}_l \phi^{l+} - u^{ji-}_l \phi^{l-} }{ \phi_{k}^+ - \phi_{k}^- } $

From $ \hat{A}^{ji}_k $, we can obtain

$ |\hat{A}^{ji}_k| = R^{ji}_l |\Gamma^{jl}_m| \left( R^{-1} \right)^{jm}_k $

where $R^{ji}_{l}$ is the matrix of right eigenvectors and $|\Gamma^{jl}_m|$ is the matrix of the absolute values of the eigenvalues along the diagonal.

I can pretty much see how to implement this algorithm in fipy without too many issues. I can see that getting $|\hat{A}^{ji}_k|$ from $\hat{A}^{ji}_k$ is not going to be easy, since an eigenvector/eigenvalue calculation is required for every face. At the moment the only way I see to do this is actually calculating $R$ and $\Gamma$ and reconstructing. Maybe there is a clever way to do this???

Higher Order Correction

Here we make the scheme second order on a regular grid. The correccted flux is given by,

$  F_{O\left(2\right)}^i = F^i + \bar{F}^i $

where

$ \bar{F}^i = n_j \left[ \left( M\left(\theta^{ji} \right) B^{ji}_l \right) \left( R^{-1} \right)^{jl}_k \right]  \left(\phi^{k+} - \phi^{k-} \right)$

$M$ is given by

$ M\left( \theta \right) = \max \left(0, \min \left( \left( 1 + \theta \right) / 2, 2, 2 \theta \right) \right) $

and $B$ is given by

$ B^{ji}_l = \frac{1}{2} |\Gamma^{ji}_l| \left(1 - \frac{\delta t}{\Delta x S} |\Gamma^{il}_l| \right) $

where $\Delta x$ is the cell to cell distance and $S$ is the face area. $\theta$ is given by,

$ \theta^{ji} = \frac{\alpha^{ji+-}}{\alpha^{ji}} $

where

$ \alpha^{ji+-} =  \left[\Gamma^{ji}_k > 0 \right] \left(\alpha^{jk-} - \alpha^{jk+} \right) + \alpha^{ji+} $

The $\alpha$'s are given by,

$\alpha^{ji} = \left( R^{-1} \right)^{ji}_k \left(\phi^{k+} - \phi^{k-} \right) $

$\alpha^{ji+} = \left( R^{-1} \right)^{ji}_k \left(\phi^{k++} - \phi^{k+} \right) $

$\alpha^{ji-} = \left( R^{-1} \right)^{ji}_k \left(\phi^{k-} - \phi^{k--} \right) $

  • Posted: 2011-06-27 17:34 (Updated: 2012-03-08 15:09)
  • Author: wd15
  • Categories: (none)
  • Comments (0)