diff --git a/Snakefile b/Snakefile index ff61b177679c26885ac388aa241343d93dc072a3..98234a3756a3c7277ccc39eb59ec2f6cc3eb2d8f 100644 --- a/Snakefile +++ b/Snakefile @@ -22,19 +22,23 @@ TODO: Contemplate using lambdify for basis TODO: Contemplate allowing vector input for ICs TODO: Discuss how wavelet details should be plotted -TODO: Ask whether we are dealing with inviscid Burgers only -TODO: Ask why we limit the initial time step -TODO: Ask whether cfl number should be absolute value -TODO: Ask why cells 1 and -2 are adjusted for Dirichlet boundary +TODO: Ask whether we are dealing with inviscid Burgers only -> Done (yes) +TODO: Ask why we limit the initial time step -> Done (to prevent + irregularities related to instability in later steps) +TODO: Ask whether cfl number should be absolute value -> Done (by definition) +TODO: Ask why cells 1 and -2 are adjusted for Dirichlet boundary -> Done ( + not sure, try with ghost cells only for now) TODO: Ask why height adjustment and stretch factor are considered outside of - implicit solver function + implicit solver function -> Done (can be in solver) TODO: Ask about workings of implicit solver for Burgers -TODO: Ask whether Burgers has compatible ICs other than Sine and - DiscontinuousConstant + -> Done (look into file burgex.f) +TODO: Ask whether Burgers has compatible ICs other than Sine (shock case) and + DiscontinuousConstant (rarefaction) -> Done (yes, but irrelevant for now) +TODO: Ask about fluxes other than Lax Friedrich -> Done (not needed now) Urgent: TODO: Add Burgers class completely -TODO: Enabale choice of equation +TODO: Enable choice of equation TODO: Add subclasses of Burgers TODO: Ignore ghost domains by flagging all cells with it for extreme outlier TODO: Add functions to create each object from dict diff --git a/scripts/tcd/Equation.py b/scripts/tcd/Equation.py index c91f798a586d9df71e5f5365f3462b63ed4da7f1..9f97e144dded70da4a06254daa231bafa679fb26 100644 --- a/scripts/tcd/Equation.py +++ b/scripts/tcd/Equation.py @@ -522,6 +522,7 @@ class Burgers(Equation): Code adapted from DG code by Hesthaven. """ + # Shock speed = 1/2*(left+right values) sspeed = self._init_cond._height_adjustment uexact = np.zeros(np.size(grid_values)) @@ -529,10 +530,15 @@ class Burgers(Equation): xx = np.linspace(0, 1, 200) uu = np.sin(self._init_cond._factor * np.pi * xx) + # Scale time for domain te = self._final_time * (2 / mesh.interval_len) + + # Initial characteristic guess (where is the solution) xt0 = (2 / mesh.interval_len) * ( grid_values-sspeed * self._final_time).reshape( np.size(grid_values)) + + # Check whether in interval for ix in range(len(xt0)): if xt0[ix] > 1: xt0[ix] -= 2 * np.floor(0.5 * (xt0[ix]+1))