Skip to content
KristianHolmePublic

About

Simulator for a 1D model of a rotating detonation engine

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

231 Commits

Folders and files

Repository files navigation

RDE.jl

Build Status Aqua JET DOI

Overview

RDE.jl provides a solver for the rotating detonation engine (RDE) model equations presented in Koch et al. (2020):

$$u_{t}+ uu_{x} = (1-\lambda)\omega(u)q_0 + \nu_1 u_{xx} + \epsilon \xi (u, u_0)$$ $$\lambda_t = (1-\lambda)\omega(u) - \beta (u, u_p, s)\lambda + \nu_{2}\lambda_{xx}$$

Installation

The package is registered in a custom package registry, KristianHolmeRegistry. To install the package through the registry, first add the registry. From the Julia REPL, type ] to enter the Pkg REPL mode and run:

pkg> registry add https://github.com/KristianHolme/KristianHolmeRegistry

and then install with

pkg> add RDE

If you don't want to add the custom registry, you can install RDE.jl directly from github.

pkg> add https://github.com/KristianHolme/RDE.jl

Examples

Basic Usage

using RDE
using GLMakie

# Create and solve a basic RDE problem
params = RDEParam()
rde_prob = RDEProblem(params)
solve_pde!(rde_prob)
plot_solution(rde_prob)

Solver options

The solver defaults to a conservative finite-volume discretization with an explicit SSPRK integrator and CFL-based steps. You can override the integrator and time stepping options:

using OrdinaryDiffEqSSPRK
solve_pde!(rde_prob; alg = SSPRK33(), adaptive = false)

Injection profiles

Injection u_p(x, t) and s(x, t) live on RDEProblem as prob.injection. The RHS samples them each step with update_injection!. Construction without an injection argument builds a uniform C∞ multi-step hold at params.u_p / params.s. Reset then fills that same constant hold, so time-dependent control is installed afterwards with commit_schedule!.

params = RDEParam(; tmax = 10)
prob = RDEProblem(params)  # UniformMultiStepPressureProfile at params.u_p
commit_schedule!(prob.injection, 0.0f0, 2.0f0, 0.8f0)  # live value at t=0 → 0.8 at t=2
solve_pde!(prob)

A vector of knots is a multi-step schedule. The default smoother is CinftySmoother(τ) (τ_smooth = 1): C∞ step-then-hold on each segment. Construct the profile with LinearSmoother() for linear interpolation between knots.

commit_schedule!(prob.injection, 0.0f0, [2.0f0, 5.0f0], [0.8f0, 0.3f0])

Pass spatial_kernel_width > 0 for a spatial profile. New knots are smoothed at commit time only; the previous live field is not re-smoothed.

params = RDEParam(; N = 64)
prob = RDEProblem(params; spatial_kernel_width = 9)
target = fill(0.8f0, params.N)
target[1:(params.N ÷ 2)] .= 0.3f0
commit_schedule!(prob.injection, 0.0f0, 1.0f0, target)

control_shift_strategy wraps the inner profile in a moving frame (MovingFrameInjectionProfile). You can also pass a prebuilt injection.

prob = RDEProblem(params; control_shift_strategy = LinearControlShift(1.0f0))
prob = RDEProblem(params; injection = ConstantInjectionProfile(0.5f0, 3.5f0))

Custom Initial Conditions

params = RDEParam()  # or RDEParam(; N = 32, tmax = 0.01) for a quick run
prob = RDEProblem(params; reset_strategy = NShock(2))  # Initialize with 2 shocks
solve_pde!(prob)

# Or use random shock initialization (1-4 shocks)
reset_strategy = RandomShock()
params = RDEParam()
prob = RDEProblem(params; reset_strategy)

# or use a custom function for the u-variable (x is the spatial grid vector)
reset_strategy = CustomPressureReset() do x
  T = eltype(x)
  return abs.(x) ./ T(π)
end
prob = RDEProblem(params; reset_strategy)
solve_pde!(prob)
plot_solution(prob)

Artifacts

Some reset strategies and predictors rely on artifact data (shock profiles and speed model). These are initialized at package load time; if the artifacts are missing, the package will warn and the related features will throw a clear error when used.

References

@article{PhysRevE.101.013106,
  title = {Mode-locked rotating detonation waves: Experiments and a model equation},
  author = {Koch, James and Kurosaka, Mitsuru and Knowlen, Carl and Kutz, J. Nathan},
  journal = {Phys. Rev. E},
  volume = {101},
  issue = {1},
  pages = {013106},
  numpages = {11},
  year = {2020},
  month = {Jan},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevE.101.013106},
  url = {https://link.aps.org/doi/10.1103/PhysRevE.101.013106}
}

@article{Koch_2021,
   title={Multiscale physics of rotating detonation waves: Autosolitons and modulational instabilities},
   volume={104},
   ISSN={2470-0053},
   url={http://dx.doi.org/10.1103/PhysRevE.104.024210},
   DOI={10.1103/physreve.104.024210},
   number={2},
   journal={Physical Review E},
   publisher={American Physical Society (APS)},
   author={Koch, James and Kurosaka, Mitsuru and Knowlen, Carl and Kutz, J. Nathan},
   year={2021},
   month=aug }

About

Simulator for a 1D model of a rotating detonation engine

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages