Skip to content
Snippets Groups Projects
  1. Jun 21, 2024
    • Florian Atteneder's avatar
      rm whitespace · 4a7d0769
      Florian Atteneder authored
      Verified
      4a7d0769
    • Florian Atteneder's avatar
      add reftest advection_sine_weno · 96751fc6
      Florian Atteneder authored
      Verified
      96751fc6
    • Florian Atteneder's avatar
      make WENO reconstruction work again · 3dbf2ab8
      Florian Atteneder authored
      Verified
      3dbf2ab8
    • Florian Atteneder's avatar
      GRHD: more specific boundry conditions [only incorporated for... · 2e105ecc
      Florian Atteneder authored
      GRHD: more specific boundry conditions [only incorporated for FV+slope_limiter] (!179)
      
      This adds new options under `GRHD.bc`:
      - `tov_reflective_origin`: impose reflection symmetry at coordinate origin, impose vacuum values at outer bdry
      - `tov_symmetric_domain`: impose vacuum values at both domain boundary ends
      
      Also streamlined the setup of the bdry values for FV.
      While doing so I realized that the inflow bdry in the Bondi test was wrongly treated.
      There we cannot extrapolate interior data, nor just copy what we have in the interior, unless we are very far out (which in my test we aren't).
      Instead, what we do now there is use the initial data, which is the analytical solution and extrapolate that.
      This improves the behavior of the solution to no longer drift after the first time step. Nice.
      2e105ecc
    • Florian Atteneder's avatar
      TCI: Fix `minmod` (!178) · ac9e42ed
      Florian Atteneder authored
      The formulae isn't complicated, but I still messed up doing so.
      
      Fixing it makes TOV evolutions in symmetric domains now remain symmetric, kind of.
      
      Because `minmod` is used with almost all slope limiters, I had to update quite a few reftest too, although they overall quality of the results did not change much.
      
      I wondering whether this fix makes now the WENO version of DG also work, will check in a separate PR.
      ac9e42ed
  2. Jun 20, 2024
    • Florian Atteneder's avatar
      GRHD: fix implementation of `atm_evolve`... · 76e08108
      Florian Atteneder authored
      GRHD: fix implementation of `atm_evolve` (!177)
      
      Follow up to !176
      76e08108
    • Florian Atteneder's avatar
      GRHD: Add `atm_evolve` parameter (!176) · 8c039e55
      Florian Atteneder authored
      Adds the following new parameter:
      - `GRHD.atm_evolve`: If `false` then the RHSs of all state variables are set to zero at any grid point where we identified the data to describe atmosphere.
      
      This is parameter is implemented to work with all formulations and schemes, hopefully.
      8c039e55
    • Florian Atteneder's avatar
      GHRD: Add Marquina's numerical flux for FV+slope limiter and doublecartoon... · e99fb11f
      Florian Atteneder authored
      GHRD: Add Marquina's numerical flux for FV+slope limiter and doublecartoon (!175)
      
      Adds the following new parameters
      - `GRHD.fv_numerical_flux = "marquina"`: Numerical flux implementation following Font et al 2000, PRD 61 044011; see Font et al 2002, PRD 65 084024 for TOV tests.
      
      We also update the TOV initial data module to include a function with which one should be able to generate all the configurations that we use in the ref tests.
      e99fb11f
  3. Jun 19, 2024
    • Florian Atteneder's avatar
      GRHD: Implement FV+slope limiters for doublecartoon version... · 8f563748
      Florian Atteneder authored
      GRHD: Implement FV+slope limiters for doublecartoon version (!174)
      
      Implements the FV+slope limiter machinery for the doublecartoon formulation.
      
      While testing I noticed that the boundary conditions for a reflection boundary were implemented incorrectly.
      To this end I quickly drafted a `BdryBufferedData` type with which one can abstract the buffer zones away.
      This solution is not optimal performance wise, because it incurs quite some allocations (although I think it should be stack-allocateable...).
      
      ~~I have not bothered to update the spherical1d formulation, but instead inserted a `TODO`. So this needs to be updated in a separate PR.~~
      Nevermind, I already fixed the todos, in order to make the reftests work.
      
      Fixing the bdry conditions helped to improve the quality of the results, however, we are not even close yet to results from the literature.
      Because of that I also now implemented the Roe method instead of the LLF method to compute the numerical fluxes, because that method
      was also used in the paper Font et al 2000 PRD 61 044011.
      This improves things too, but we are still worse than those results.
      In particular, we use more resources and work in lower dimensions than that paper and yet we have larger errors ...
      So this requires further investigations.
      
      ---
      
      Also adds the following new parameters:
      - `fv_numerical_flux`: the double cartoon version now implements the LLF and Roe flux.
      - new option for `slope_limiter_method`: `MC`, this limiter is taken from Font et al 2002, PRD 65 084024.
      8f563748
  4. Jun 12, 2024
    • Florian Atteneder's avatar
      SRHD: Fix FV slope limiter method to use up-to-date primitives in evolution... · 1d53da4a
      Florian Atteneder authored
      SRHD: Fix FV slope limiter method to use up-to-date primitives in evolution (!173)
      
      Due to the `cons2prim` methods being tied to `D, S, tau` registered as `dynamic_variables`, we need some juggling to get the primitives of the current step.
      
      This inconvenience is due to
      1. not (yet) separating the time stepping from the flux computation for the FV methods,
      2. and the 'hard coding' of the primitives to the `cons2prim` methods.
      
      Side note: We face the same issue with the `GRHD` version.
      
      ---
      
      This PR also adds some more reftests to cover the `blastwave1` exercise.
      To this end we also updated the FV solver to work with non-periodic bdry conditions with bdry values taken from initial data.
      1d53da4a
  5. Jun 11, 2024
    • Florian Atteneder's avatar
      GRHD: Random improvements to TOV star test... · 54f20acd
      Florian Atteneder authored
      GRHD: Random improvements to TOV star test (!172)
      
      - Implement AV treatment for `doublecartoon` formulation
      - Implement Reconstruction treatment for `doublecartoon` formulation
      - clean up logic in `callbacks.jl`
      - Implement `fv_central` for `doublecartoon` formulation.
      
      Also adds new parameters to `GRHD` section:
      - `c2p_enforce_atm`: If true then atmosphere is enforced, regardless if its causal or not.
      - `freeze_vars`: A list of variables for which `rhs` should be set to zero. Atm only supported by the doublecartoon formulation.
      
      New parameter for the `TCI` section:
      - `threshold_inv`: Invert the threshold check.
      54f20acd
  6. Jun 07, 2024
  7. Jun 03, 2024
    • Florian Atteneder's avatar
      GRHD: Add initial data for Bondi accretion with infalling matter... · 39229906
      Florian Atteneder authored
      GRHD: Add initial data for Bondi accretion with infalling matter (!169)
      
      This adds the following parameters to the `GRHD` section
      - `id`: new option `bondi_accretion_infall`
      - `id_bondi_accretion_infall_rs`: Radius below which the low-density fluid is initially set.
      - `id_bondi_accretion_infall_ρl`: The density of the low-density fluid.
      - `analyze_error_reference_solution`: the name of a reference solution that is to be used for the error estimation
      
      ---
      
      This test is taken from Bugner's thesis 2017, and a paper by Radice, Rezolla 2011.
      
      ---
      
      This PR also disables the questionable rescaling of the viscosity that was added for the TOV tests.
      If needed it can be restored, but should be hidden behind a proper parameter.
      39229906
    • Florian Atteneder's avatar
      CI: Add another CI target that runs the integration tests with 8 threads... · 70f98c1a
      Florian Atteneder authored
      CI: Add another CI target that runs the integration tests with 8 threads (!170)
      70f98c1a
    • Florian Atteneder's avatar
      @with_signature: Add `batch` option which enables multithreading of for loops... · 115dee42
      Florian Atteneder authored
      @with_signature: Add `batch` option which enables multithreading of for loops using `Polyester.jl` (!168)
      
      Usage:
      ```julia
      @with_signature [batch=true] myfunction(eq::SomeEquation)
         @accepts ...
         # compute goes here
         @returns ...
      end
      ```
      
      I did some minimal profiling. There is a noticeable speed-up, but I did not measure how effective it is.
      For the time being, I am happy when it just runs a little faster.
      115dee42
    • Florian Atteneder's avatar
      Evolve: use inline if in ode_step! for LSERK4... · 0461341d
      Florian Atteneder authored
      Evolve: use inline if in ode_step! for LSERK4 (!167)
      
      This helps the profile outputs to associate the measurements to the same line.
      0461341d
  8. May 30, 2024
    • Florian Atteneder's avatar
      GRHD: Improve Bondi accretion test (!165) · a205e41b
      Florian Atteneder authored
      - Don't impose initial data values at interior boundary. This is an inflow boundary, but we cheat around that and just use the interior flux there.
      - Add a higher resolved version of the Bondi accretion data. This is necessary to get acceptable results in a convergence study.
      a205e41b
    • Florian Atteneder's avatar
      SRHD: perform c2p when wrapping data in callback... · 8113e0c9
      Florian Atteneder authored
      SRHD: perform c2p when wrapping data in callback (!164)
      
      TBH this is a bandaid to ensure that primitives are up-to-date before outputting.
      
      In the future there should be a proper mechanism to ensure that.
      8113e0c9
    • Florian Atteneder's avatar
      GRHD: Use WeakBoundaries() for CubicSplineInterpolation... · e377fe10
      Florian Atteneder authored
      GRHD: Use WeakBoundaries() for CubicSplineInterpolation (!163)
      
      Sometimes our grid bounds don't align exactly with the bounds from the data. This boundary treatment is more forgiving in that sense.
      e377fe10
    • Florian Atteneder's avatar
      GRHD: Implement error analysis output (!162) · 89aacba5
      Florian Atteneder authored
      Adds two new parameters:
      - `variables0d_analysis_error`: A list of variable names for which the error wrt the initial data values and computed as the L2 norm shall be computed. For each enqueued variable name a `Output.variables0d` entry is added which consists of the variable name and a `_err_norm` postfix. E.g. `rho` adds a 0d output `rho_err_norm`.
      - `variables1d_analysis_error`: Similar to `variables0d_analysis_error`, but instead of computing the L2 norm, the difference over the mesh is provided as an `Output.variables1d` entry with name equal to variable name plus `_err` postfix.
      
      ---
      
      This is a rushed implementation, because I need that output now.
      
      But this mechanism should be 1) partly factored out into the `dg1d` project, and 2) we should not need extra parameters.
      About 2): It should be enough to ask for `rho_err` or `rho_err_norm` in 1d or 0d output fields. Doing so would require us to reserve names ending with `_err` and `_err_norm`, but that should be fine.
      
      Furthermore, we should rename the postfixes to something like `_id_err` and `_id_err_l2`, to make their nature more clear.
      89aacba5
  9. May 27, 2024
    • Florian Atteneder's avatar
      EulerEq: Allow use of more than one AV indicator... · 9cbd54ef
      Florian Atteneder authored
      EulerEq: Allow use of more than one AV indicator (!161)
      
      This adds two new options
      - `av_indicator_variables`: a list of variables to which the AV indicator
        should be applied to. This generates one viscosity per variable.
      - `av_combine_operator`: an operater with which multiple viscosities
        are reduced to a single one.
      
      We also re-activated the `euler_sod_shock_tube_entropyav` reftest, which now seems to give acceptable results.
      Also updated the `euler2d_kelvin_helmholtz_entropyav` reftest, although that should not have been necessary.
      However, 2d experiments are not declared stable anyways, so will need to check those later again regardless.
      9cbd54ef
  10. May 23, 2024
  11. Apr 29, 2024
  12. Apr 25, 2024
    • Florian Atteneder's avatar
      EulerEq: Follow up for !155 (!156) · 990b90a2
      Florian Atteneder authored
      990b90a2
    • Florian Atteneder's avatar
      EulerEq: Rework Navier-Stokes regularization... · db6a9434
      Florian Atteneder authored
      EulerEq: Rework Navier-Stokes regularization (!155)
      
      The goal is to reproduce plots for the shock tube tests from the Zingan+ 2013 paper.
      
      We rework the Navier-Stokes regularization to work more like in the Zingan+ 2013 paper. Before we tried to mimic a Guermond+ 2014 paper, but they did not provide any shock tube tests.
      
      This PR adds new parameters to the `EulerEq` section:
      - `av_navierstoke_prho, av_navierstoke_pt`: these are effective Prandtl numbers that can be used to control how much of the viscosity coefficient for the momentum regularization should be added to the density and energy regularization.
      - `id_smooth`: If true smooth initial data profile with a Bernstein filter
      - `av_drag`: Dragging factor to throttle AV evolution
      - `av_recompute_substeps`: If true AV computation is scheduled to run on each substep.
      
      We also fixed a sever issue in one of the formulae.
      In the computation of `maxspeed` we accidentally compute `q/p` instead of `q/rho` as one part of the wave speed.
      Fixing this seems to have a positive influence.
      I am curious how this will effect the ref tests.
      Answer: I had to update all associated reftests, but all changes were minor.
      db6a9434
  13. Apr 24, 2024
  14. Apr 22, 2024
    • Florian Atteneder's avatar
      c2p: Add option `c2p_set_atmosphere_on_failure`... · c63c4a07
      Florian Atteneder authored
      c2p: Add option `c2p_set_atmosphere_on_failure` (!153)
      
      Adds a new option `c2p_set_atmosphere_on_failure` to the `GRHD` and `SRHD` sections.
      If `true` and the c2p solver fails to invert the master function, we reset all variables to atmosphere.
      
      We also fixed that the running with `verbose` in `c2p` no longer resest to atmosphere.
      c63c4a07
    • Florian Atteneder's avatar
      Fix type instability in c2p (!152) · 4ad53e2a
      Florian Atteneder authored
      4ad53e2a
    • Florian Atteneder's avatar
      fix invocation of substep callbacks for explicit schemes... · 2aaafd14
      Florian Atteneder authored
      fix invocation of substep callbacks for explicit schemes (!151)
      2aaafd14
    • Florian Atteneder's avatar
      GRHD: Refactor c2p (!150) · 6f4332b5
      Florian Atteneder authored
      - Mainly refactors `c2p` in order to allow to ignore the total energy density in the recovery procedure.
      This is possible for cold equations of state, where we don't need to evolve tau.
      
      - The `c2p` now also incorporates a conservative fixing that we adapted from from arXiv:1306.4953, Appendix.
      
      - We had to update reftest data for the SRHD simple wave and GRHD bondi tests.
      Especially the GRHD bondi tests improved from not using tau in the reconstruction.
      
      - We also updated the default value `atm_treshold_factor` so that it is now slightly large than one.
      This fixes some errors where we misidentified atmosphere states as being below atmosphere, before the c2p procedure started.
      
      - Because this PR was cherry-picked from the fa/doublecartoon+av branch, we also brought over the changes in the naming of variables of the doublecartoon formulation (which should have went into another PR, but I was too lazy to entangle those changes first).
      
      ----
      
      I noticed that the number of allocs in `rhs` sections are now quite increased.
      This is particularly bad for the SRHD tests. My guess is this is due to this refactor now passing on both EoSs as parameters to the c2p routine.
      6f4332b5
  15. Apr 21, 2024
    • Florian Atteneder's avatar
      SRHD: Update cons2prim (!149) · 3cb4bbbc
      Florian Atteneder authored
      This PR replaces the SRHD's own c2p with that of GRHD.
      
      The following parameters are added to the SRHD section:
      - `id_smooth = false`: If `true` initial data is smoothed with a Bernstein filter.
      - `av_regularization = "none"`: Controls which AV regularization is to be used.
      - `c2p_cold_eos_parameters = [ 100.0, 2.0 ]`: Parameters of cold polytropic EoS for c2p, analogous to GRHD.
      - `av_drag = 0.0`: AV dragging factor to control how rapid AV can change, analogous to GRHD and EulerEq.
      - `av_recompute_substeps = false`: If `true` AV recomputation is triggered on every substep in the evolution.
      3cb4bbbc
  16. Apr 19, 2024
  17. Apr 18, 2024
    • Florian Atteneder's avatar
      GRHD: Use a dedicated cold EoS as a fallback in c2p... · 55e179d3
      Florian Atteneder authored
      GRHD: Use a dedicated cold EoS as a fallback in c2p (!147)
      
      This adds new parameters to the `GRHD` section:
      - `c2p_cold_eos_parameters`: Contains parameters for the `Polytrope` EoS that is used as a fallback in c2p.
      
      This kind of 'abstraction' is needed so that we can re-purpose this c2p for the SRHD project.
      55e179d3
    • Florian Atteneder's avatar
      EulerEq: Fix 2d equations and timestep scaling... · bb7c86c1
      Florian Atteneder authored
      EulerEq: Fix 2d equations and timestep scaling (!146)
      
      - The 2d version did compute the flux incorrectly.
      - We used too strong of a scaling for the time step, e.g. N^-3 instead of N^-2. This is fixed for 1d and 2d case.
      - Updated `euler2d_isentropic_flow` ref test to no longer run into a shock, because that example doesn't use any HRSC.
      - Updated `euler_sod_shock_tube` test to run with low resolution. Also shorten `tend` so that data does not reach boundary.
      bb7c86c1
    • Florian Atteneder's avatar
      GRHD: Fixes to c2p (!145) · 624c158b
      Florian Atteneder authored
      This addresses two issues:
      - Utilize cold EoS when we limit velocity. This should avoid artificial spikes in epsilon (internal energy density) due to the limiting, because the derived relations used in the Kastaun paper no longer hold.
      - Make `atm_threshold_factor = 1.0` the default. In some tests I noticed that having this greater than 1.0 an artificial plateau in the evolved density appears, which I did not like. This seems to fix that.
      624c158b
  18. Apr 16, 2024
Loading