Time Step

incflo has the option to treat advection using either the Method of Lines (MOL) or a Godunov approach. Here we discuss the basic workflow involved in a time step for each of these approaches. For details on how the convective terms are constructed, see the AMReX-Hydro documentation on Advection schemes. For details on the projections, see the AMReX-Hydro documentation on Projection Methods.

The updates below are written for the conservative form of the momentum equation, which is used with incflo.advect_momentum = true. By default, incflo updates the velocity instead: the advective term is \(U^{MAC} \cdot \nabla U\), and the pressure gradient, viscous and forcing terms are divided by the density. \({\bf H}_U^{n+1/2}\) is the forcing term evaluated with \(\rho^{n+1/2}\), and the density in the projections is \(\rho^{n+1/2}\).

MOL

MOL requires predictor-corrector methodology to achieve second order accuracy. In the predictor

  • Define \(U^{MAC,n}\), the face-centered (staggered) MAC velocity which is used for advection, using \(U^n\)

  • Define an approximation to the new-time state, \((\rho U)^{\ast}\) by setting

\[\begin{split}(\rho U)^{\ast} =& (\rho U)^n - \Delta t \left( \nabla \cdot (\rho U^{MAC} U)^n + \nabla {p}^{n-1/2} \right) \\ &+ \Delta t \left( \nabla \cdot \tau^\ast + {\bf H}_U^{n+1/2} \right)\end{split}\]

for implicit diffusion, which is the default. For Crank-Nicolson diffusion (incflo.diffusion_type = 1), \(\Delta t \; \nabla \cdot \tau^\ast\) is replaced by \(\frac{\Delta t}{2} ( \nabla \cdot \tau^n + \nabla \cdot \tau^\ast )\), and for explicit diffusion (incflo.diffusion_type = 0) by \(\Delta t \; \nabla \cdot \tau^n\).

  • Project \(U^{\ast}\) by solving

\[\nabla \cdot \frac{1}{\rho} \nabla \phi = \nabla \cdot \left( \frac{1}{\Delta t} U^{\ast}+ \frac{1}{\rho} \nabla {p}^{n-1/2} \right)\]

then defining

\[U^{\ast \ast} = U^{\ast} + \frac{\Delta t}{\rho} \left( \nabla {p}^{n-1/2} - \nabla \phi \right)\]

and

\[{p}^{n+1/2, \ast} = \phi\]

In the corrector

  • Define \(U^{MAC,\ast \ast}\) at the “new” time using \(U^{\ast \ast}\)

  • Define a new approximation to the new-time state, \((\rho U)^{\ast \ast \ast}\) by setting

\[\begin{split}(\rho U)^{\ast \ast \ast} =& (\rho U)^n - \frac{\Delta t}{2} \left( \nabla \cdot (\rho U^{MAC} U)^n + \nabla \cdot (\rho U^{MAC} U)^{\ast \ast}\right) \\ &+ \Delta t \; \nabla \cdot \tau^{\ast \ast \ast} + \Delta t \left( - \nabla {p}^{n+1/2,\ast} + {\bf H}_U^{n+1/2} \right)\end{split}\]

for implicit diffusion. For Crank-Nicolson diffusion, \(\Delta t \; \nabla \cdot \tau^{\ast \ast \ast}\) is replaced by \(\frac{\Delta t}{2} ( \nabla \cdot \tau^n + \nabla \cdot \tau^{\ast \ast \ast} )\), and for explicit diffusion by \(\frac{\Delta t}{2} ( \nabla \cdot \tau^n + \nabla \cdot \tau^{\ast \ast} )\).

  • Project \(U^{\ast \ast \ast}\) by solving

\[\nabla \cdot \frac{1}{\rho} \nabla \phi = \nabla \cdot \left( \frac{1}{\Delta t} U^{\ast \ast \ast} + \frac{1}{\rho} \nabla {p}^{n+1/2,\ast} \right)\]

then defining

\[U^{n+1} = U^{\ast \ast \ast} + \frac{\Delta t}{\rho} \left( \nabla {p}^{n+1/2,\ast} - \nabla \phi \right)\]

and

\[{p}^{n+1/2} = \phi\]

Godunov Methods

When we use a time-centered Godunov approach (i.e. the Godunov or BDS options), we no longer need the predictor and corrector steps.

  • Define the time-centered face-centered (staggered) MAC velocity which is used for advection: \(U^{MAC,n+1/2}\)

  • Define the new-time density, \(\rho^{n+1} = \rho^n - \Delta t \nabla \cdot (\rho^{n+1/2,pred} U^{MAC,n+1/2})\)

  • Define an approximation to the new-time state, \((\rho U)^{\ast}\) by setting

    \[\begin{split}(\rho^{n+1} U^{\ast}) &= (\rho^n U^n) - \Delta t \left( \nabla \cdot (\rho U^{MAC} U)^{n+1/2} + \nabla {p}^{n-1/2} \right) \\ &+ \Delta t \; \nabla \cdot \tau^\ast + \Delta t \; {\bf H}_U^{n+1/2}\end{split}\]

    for implicit diffusion, which is the current default. For Crank-Nicolson diffusion (incflo.diffusion_type = 1), \(\Delta t \; \nabla \cdot \tau^\ast\) is replaced by \(\frac{\Delta t}{2} ( \nabla \cdot \tau^n + \nabla \cdot \tau^\ast )\), and for explicit diffusion (incflo.diffusion_type = 0) by \(\Delta t \; \nabla \cdot \tau^n\).

  • Project \(U^{\ast}\) by solving

\[\nabla \cdot \frac{1}{\rho} \nabla \phi = \nabla \cdot \left( \frac{1}{\Delta t} U^{\ast}+ \frac{1}{\rho} \nabla {p}^{n-1/2} \right)\]

then defining

\[U^{n+1} = U^{\ast} + \frac{\Delta t}{\rho} \left( \nabla {p}^{n-1/2} - \nabla \phi \right)\]

and

\[{p}^{n+1/2} = \phi\]

With incflo.use_divu_source = 1, the MAC projection enforces \(\nabla \cdot U^{MAC,n+1/2} = S^{n+1/2}\), and \(S^{n+1} / \Delta t\) is subtracted from the right-hand side of the nodal projection, so that \(\nabla \cdot U^{n+1} = S^{n+1}\).