Modal estimate for adaptive timesteps in 2D

This setup illustrates the use of modal estimation for the adaptive timestep according to the CFL condition in the 2D Euler equations. The adaptive timestep requires the computation of maximal velocities in the domain and involves an expensive modal to nodal transformation. With the modal estimation shown in this example it is possible to avoid this transformation. However, the estimation is not very accurate and the resulting time step may become very small with this approach.

It simulates the evolution of a pressure pulse in a fluid initially at rest.

The complete configuration is provided in ateles.lua:

-- --------------- General options --------------- --
simulation_name = 'modalest_2d'
sim_control = {
  time_control = {
    min = 0,
    max = {iter=20},
    interval = {iter=1}
  }
}
p_ref   = 101325 -- Reference pressure in Pascal
T_ref   = 288.15 -- Reference temperature in Kelvin
rho_ref = 1.225  -- Reference density in kg/m^3
c_ref   = 340    -- Reference speed of sound
-- --------------- General options --------------- --
-- ----------------------------------------------- --


-- ------------------- --
-- ------ Mesh ------- --
mesh = {
  predefined = 'slice',
  origin = { 0, 0, -0.125 },
  length = 1,
  refinementLevel = 2
}
-- ------ Mesh ------- --
-- ------------------- --


-- --------------------------------------------------------- --
-- ----------------------- Equation ------------------------ --
equation = {
  name = 'euler_2d',
  therm_cond = 24.35e-3, -- mW/(K*m)
  isen_coef = c_ref^2*rho_ref/p_ref,
  r = p_ref/(rho_ref*T_ref),
  material = {
    characteristic = 0,
    relax_velocity = {0, 0},
    relax_temperature = 1
  }
}
-- (cv) heat capacity and (r) ideal gas constant
equation["cv"] = equation["r"] / (equation["isen_coef"] - 1.0)
-- ----------------------- Equation ------------------------ --
-- --------------------------------------------------------- --


-- ----------------------- Scheme -------------------------- --
scheme = {
  -- the spatial discretization scheme
  spatial =  {
    name = 'modg_2d',
    m = 31
  },
  -- the temporal discretization scheme
  temporal = {
    name = 'explicitRungeKutta',
    steps = 4,
    -- how to control the timestep
    control = {
      name = 'cfl',
      use_modal_estimate = true,
      cfl  = 0.9
    }
  }
}

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


-- ------ Initial conditions ------- --
initial_condition = {
  density = {
    predefined = 'gausspulse',
    center = { 0.5, 0.5, 0 },
    halfwidth = 0.1,
    amplitude = 0.1,
    background = 1
  },
  pressure = {
    predefined = 'gausspulse',
    center = { 0.5, 0.5, 0 },
    halfwidth = 0.1,
    amplitude = 0.1,
    background = 1
  },
  velocityX = 0.0,
  velocityY = 0.0,
  velocityZ = 0.0
}
-- ------ Initial conditions ------- --
-- --------------------------------- --


-- -------------------- Tracking ---------------------- --
tracking = {
  label = 'point_series',
  folder = './',
  variable = { 'density', 'momentum', 'energy' },
  shape = {
    kind = 'canoND',
    object= { origin = { 0.7, 0.7, 0} }
  },
  time_control = {
    min = 0,
    max = sim_control.time_control.max,
    interval = {iter=1}
  },
  output = { format = 'ascii', ndofs = 1 }
}
-- ---------------------------------------------------- --
  1. Projection: l2p

  2. Polynomial representation: Q

  3. Filtering: -

  4. Timestepping: explicitRungeKutta, 4 steps

  5. Boundary conditions: -

  6. Others: use_modal_estimate