4.3. Artificial Viscosity

mirgecom.artificial_viscosity Artificial viscosity for hyperbolic systems.

Consider the following system of conservation laws of the form:

\[\partial_t \mathbf{Q} + \nabla\cdot\mathbf{F} = 0,\]

where \(\mathbf{Q}\) is the state vector and \(\mathbf{F}\) is the vector of fluxes. This module applies an artificial viscosity term by augmenting the governing equations in the following way:

\[\partial_t \mathbf{Q} + \nabla\cdot\mathbf{F} = \nabla\cdot{\varepsilon\nabla\mathbf{Q}},\]

where \(\varepsilon\) is the artificial viscosity coefficient. To evalutate the second order derivative numerically, the problem is recast as a set of first order problems:

\[\begin{split}\partial_t{\mathbf{Q}} + \nabla\cdot\mathbf{F} &= \nabla\cdot\mathbf{R} \\ \mathbf{R} &= \varepsilon\nabla\mathbf{Q}\end{split}\]

where \(\mathbf{R}\) is an auxiliary variable, and the artificial viscosity coefficient, \(\varepsilon\), is spatially dependent and calculated using the smoothness indicator of [Persson_2012]:

\[S_e = \frac{\langle u_{N_p} - u_{N_{p-1}}, u_{N_p} - u_{N_{p-1}}\rangle_e}{\langle u_{N_p}, u_{N_p} \rangle_e}\]

where:

  • \(S_e\) is the smoothness indicator

  • \(u_{N_p}\) is the solution in modal basis at the current polynomial order

  • \(u_{N_{p-1}}\) is the truncated modal represention to the polynomial order \(p-1\)

  • The \(L_2\) inner product on an element is denoted \(\langle \cdot,\cdot \rangle_e\)

The elementwise viscosity is then calculated:

\[\begin{split}\varepsilon_e = \begin{cases} 0, & s_e < s_0 - \kappa \\ \frac{1}{2}\left( 1 + \sin \frac{\pi(s_e - s_0)}{2 \kappa} \right ), & s_0-\kappa \le s_e \le s_0+\kappa \\ 1, & s_e > s_0+\kappa \end{cases}\end{split}\]

where:

  • \(\varepsilon_e\) is the element viscosity

  • \(s_e = \log_{10}{S_e} \sim 1/p^4\) is the smoothness indicator

  • \(s_0\) is a reference smoothness value

  • \(\kappa\) controls the width of the transition between 0 to 1

4.3.1. Boundary Conditions

The artificial viscosity operator as currently implemented re-uses the fluid solution gradient \(\nabla{\mathbf{Q}}\) for the auxiliary equation:

\[\mathbf{R} = \varepsilon\nabla\mathbf{Q}_\text{fluid}\]

As such, the fluid-system imposes the appropriate boundary solution \(\mathbf{Q}^+\) for the comptuation of \(\nabla{\mathbf{Q}}\). This approach leaves the boundary condition on \(\mathbf{R}\) to be imposed by boundary treatment for the operator when computing the divergence for the RHS, \(\nabla \cdot \mathbf{R}\).

Similar to the fluid boundary treatments; when no boundary conditions are imposed on \(\mathbf{R}\), the interior solution is simply extrapolated to the boundary, (i.e., \(\mathbf{R}^+ = \mathbf{R}^-\)). If such a boundary condition is imposed, usually for selected components of \(\mathbf{R}\), then such boundary conditions are used directly: \(\mathbf{R}^+ = \mathbf{R}_\text{bc}\).

A central numerical flux is then employed to transmit the boundary condition to the domain for the divergence operator:

\[\mathbf{R} \cdot \hat{mathbf{n}} = \frac{1}{2}\left(\mathbf{R}^- + \mathbf{R}^+\right) \cdot \hat{\mathbf{n}}\]

4.3.2. Smoothness Indicator Evaluation

mirgecom.artificial_viscosity.smoothness_indicator(dcoll, u, kappa=1.0, s0=-6.0, dd=DOFDesc(domain_tag=VolumeDomainTag(tag=<class 'grudge.dof_desc.VTAG_ALL'>), discretization_tag=<class 'grudge.dof_desc.DISCR_TAG_BASE'>))[source]

Calculate the smoothness indicator.

Parameters:
  • u (meshmode.dof_array.DOFArray) – The field that is used to calculate the smoothness indicator.

  • kappa – An optional argument that controls the width of the transition from 0 to 1.

  • s0 – An optional argument that sets the smoothness level to limit on. Values in the range \((-\infty,0]\) are allowed, where \(-\infty\) results in all cells being tagged and 0 results in none.

Returns:

The elementwise constant values between 0 and 1 which indicate the smoothness of a given element.

Return type:

meshmode.dof_array.DOFArray

4.3.3. AV RHS Evaluation

mirgecom.artificial_viscosity.av_laplacian_operator(dcoll, boundaries, fluid_state, alpha, gas_model=None, kappa=1.0, s0=-6.0, time=0, quadrature_tag=<class 'grudge.dof_desc.DISCR_TAG_BASE'>, dd=DOFDesc(domain_tag=VolumeDomainTag(tag=<class 'grudge.dof_desc.VTAG_ALL'>), discretization_tag=<class 'grudge.dof_desc.DISCR_TAG_BASE'>), boundary_kwargs=None, indicator=None, divergence_numerical_flux=<function num_flux_central>, comm_tag=None, operator_states_quad=None, grad_cv=None, **kwargs)[source]

Compute the artificial viscosity right-hand-side.

Computes the the right-hand-side term for artificial viscosity.

\[\mbox{RHS}_{\mbox{av}} = \nabla\cdot{\varepsilon\nabla\mathbf{Q}}\]
Parameters:
  • fluid_state (mirgecom.gas_model.FluidState) – Fluid state object with the conserved and thermal state.

  • boundaries (dict) – Dictionary of boundary functions, one for each valid boundary tag

  • alpha (float) – The maximum artificial viscosity coefficient to be applied

  • indicator (DOFArray) – The indicator field used for locating where AV should be applied. If not supplied by the user, then smoothness_indicator() will be used with fluid mass density as the indicator field.

  • kappa – An optional argument that controls the width of the transition from 0 to 1, \(\kappa\). This parameter defaults to \(\kappa=1\).

  • s0 – An optional argument that sets the smoothness level to limit on, \(s_0\). Values in the range \((-\infty,0]\) are allowed, where \(-\infty\) results in all cells being tagged and 0 results in none. This parameter defaults to \(s_0=-6\).

  • quadrature_tag – An optional identifier denoting a particular quadrature discretization to use during operator evaluations.

  • dd (grudge.dof_desc.DOFDesc) – the DOF descriptor of the discretization on which fluid_state lives. Must be a volume on the base discretization.

  • comm_tag (Hashable) – Tag for distributed communication

Returns:

The artificial viscosity operator applied to q.

Return type:

mirgecom.fluid.ConservedVars