Toro2 Setup along X for 2D Euler equations

Like the Toro1 setup, this configuration simulates a one dimensional Riemann problem. Here we make use of the Godunov flux with an exact Riemann solver for the numerical fluxes. The polynomial degree is reduced to 0, resulting in a Finite Volume discretization with constant states in elements. The domain is constructed by a line of elements along the x-axis defined by the internal mesh definition line_bounded. This domain has two boundary conditions, one at the western end and on at the eastern end. All other directions are periodic.

The complete configuration is provided in ateles.lua:

-- Toro2 setup solving a Riemann problem in the Euler 2D equations.
-- This setup uses a Finite Volume discretization (polynomial degree=0) and the
-- Godunov numerical flux.
-- For the timeintegration the two-stage, strong stability preserving
-- Runge-Kutta scheme is used.
--
-- The Riemann problem prescribed here makes use of velocities with opposite
-- signs, while all other quantities remain the same.

-- global simulation options
simulation_name = 'toro2_euler_modg_2d'
sim_control = {
  time_control = {
    min = 0,
    max = 0.0015
  }
}

-- Mesh definitions --
channel_length = 1.0
epsx = channel_length*1.0e-6
mesh = {
  predefined = 'line_bounded',
  origin = {0, 0, 0},
  length = channel_length,
  element_count = 1000
}

-- Equation definitions --
equation = {
  name   = 'euler_2d',
  isen_coef = 1.4,
  r      = 296.0,
  numflux = 'godunov',
  material = {
    characteristic = 0,
    relax_velocity = {0, 0},
    relax_temperature = 0
  }
}
-- (cv) heat capacity and (r) ideal gas constant
equation["cv"] = equation["r"] / (equation["isen_coef"] - 1.0)


-- The initial conditions for the Riemann problem
-- ... left state
rho_l = 1.0
u_l = -2.0
p_l = 0.4
-- ... right state
rho_r = 1.0
u_r = 2.0
p_r = 0.4

function rho(x,y,z)
  if ( x < channel_length/2.0 ) then
    return rho_l
  else
    return rho_r
  end
end

function p(x,y,z)
  if ( x < channel_length/2.0 ) then
    return p_l
  else
    return p_r
  end
end

function u(x,y,z)
  if ( x < channel_length/2.0 ) then
    return u_l
  else
    return u_r
  end
end

projection = {
  kind = 'l2p',
  factor = 1.0
}

initial_condition = {
  density = rho,
  pressure = p,
  velocityX = u,
  velocityY = 0
}

-- Scheme definitions --
scheme = {
  -- the spatial discretization scheme
  spatial = {
    name = 'modg_2d',
    m = 0
  },
  -- the temporal discretization scheme
  temporal = {
    name = 'explicitSSPRungeKutta',
    steps = 2,
    control = {
      name = 'cfl',
      cfl  = 0.6
    }
  }
}

-- Boundary conditions
boundary_condition = {
  {
     label = 'west',
     kind = 'inflow_normal',
     density = rho_l,
     v_norm = u_l,
     v_tan = 0.0
  },
  {
     label = 'east',
     kind = 'outflow',
     pressure = p_r
  }
}

-- Tracking
tracking = {
  label = 'probe_density_Q1_toro',
  folder = '',
  variable = {'density'},
  shape = {
    kind = 'canoND',
    object= {
      origin = {
        (channel_length/2.0) + epsx,
        epsx,
        epsx
      }
    }
  },
  time_control = {
    min = 0,
    max = sim_control.time_control.max,
    interval = sim_control.time_control.max/20.0
  },
  output = { format = 'ascii', ndofs = 1 }
}

Features used

  1. Projection: l2p

  2. Polynomial representation: Q

  3. Filtering: --

  4. Timestepping: explicitSSPRungeKutta, 2 steps

  5. Boundary conditions: inflow_normal, outflow