parameters: (dofs, dUdx, params, sc_params)
return_statement: return G
docstring: Calculate the diffusive flux matrix with a physics-based shock
      capturing contribution. See:
  
      2018. Fernandez, Nguyen and Peraire
      A physics-based shock capturing methods for large-eddy simulation..
docstring_summary: Calculate the diffusive flux matrix with a physics-based shock
      capturing contribution. See:
docstring_tokens: Calculate the diffusive flux matrix with a physics - based shock capturing contribution . See :
function: def ComputeDiffusiveFluxWithShockCapturing(dofs, dUdx, params, sc_params):
      """
      Calculate the diffusive flux matrix with a physics-based shock
      capturing contribution. See:
  
      2018. Fernandez, Nguyen and Peraire
      A physics-based shock capturing methods for large-eddy simulation..
  
      """
  
      # Auxiliary variables
      dim = params.dim
      rho = dofs[0]
      mom = []
      vel = []
      for i in range(dim):
          mom.append(dofs[i + 1])
          vel.append(dofs[i + 1] / rho)
      e_tot = dofs[dim + 1]
  
      # Calculate the density flux
      mass_flux = CalculuateMassFluxVector(sc_params.alpha, dUdx)
  
      # Calculate the viscous stress tensor
      mu = params.mu          # Dynamic viscosity
      mu += sc_params.mu      # Artificial dynamic viscosity
      beta = 0.0              # Null physical bulk viscosity (Stoke's assumption)
      beta += sc_params.beta  # Artificial bulk viscosity
      tau_stress = CalculateViscousStressTensor(mu, beta, rho, mom, dim, dUdx)
  
      # Calculate the heat flux vector
      c_v = params.c_v        # Specific heat at constant volume
      lamb = params.lamb      # Thermal conductivity
      lamb += sc_params.lamb  # Artificial thermal conductivity for shock capturing
      heat_flux = CalculateHeatFluxVector(c_v, lamb, rho, mom, e_tot, dim, dUdx)
  
      # Define and fill the isotropic shock capturing diffusive flux matrix
      G = defs.Matrix('G', dim + 2, dim, real=True)
      G[0, :] = mass_flux
      for j in range(dim):
          G[dim + 1, j] = heat_flux[j]
          for i in range(dim):
              G[i + 1, j] = -tau_stress[j,i]
              G[dim + 1, j] -= vel[i] * tau_stress[i,j]
  
      return G
function_tokens: def ComputeDiffusiveFluxWithShockCapturing ( dofs , dUdx , params , sc_params ) : # Auxiliary variables dim = params . dim rho = dofs [ 0 ] mom = [ ] vel = [ ] for i in range ( dim ) : mom . append ( dofs [ i + 1 ] ) vel . append ( dofs [ i + 1 ] / rho ) e_tot = dofs [ dim + 1 ] # Calculate the density flux mass_flux = CalculuateMassFluxVector ( sc_params . alpha , dUdx ) # Calculate the viscous stress tensor mu = params . mu # Dynamic viscosity mu += sc_params . mu # Artificial dynamic viscosity beta = 0.0 # Null physical bulk viscosity (Stoke's assumption) beta += sc_params . beta # Artificial bulk viscosity tau_stress = CalculateViscousStressTensor ( mu , beta , rho , mom , dim , dUdx ) # Calculate the heat flux vector c_v = params . c_v # Specific heat at constant volume lamb = params . lamb # Thermal conductivity lamb += sc_params . lamb # Artificial thermal conductivity for shock capturing heat_flux = CalculateHeatFluxVector ( c_v , lamb , rho , mom , e_tot , dim , dUdx ) # Define and fill the isotropic shock capturing diffusive flux matrix G = defs . Matrix ( 'G' , dim + 2 , dim , real = True ) G [ 0 , : ] = mass_flux for j in range ( dim ) : G [ dim + 1 , j ] = heat_flux [ j ] for i in range ( dim ) : G [ i + 1 , j ] = - tau_stress [ j , i ] G [ dim + 1 , j ] -= vel [ i ] * tau_stress [ i , j ] return G