4.3. Artificial Viscosity¶
mirgecom.artificial_viscosity
Artificial viscosity for hyperbolic systems.
Consider the following system of conservation laws of the form:
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:
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:
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]:
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:
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:
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:
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:
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, thensmoothness_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: