# Dirac delta in boundary conditions for MethodOfLines.jl

**URL:** <https://discourse.julialang.org/t/dirac-delta-in-boundary-conditions-for-methodoflines-jl/80567>\
**Category:** Modelling & Simulations\
**Created:** [May 5, 2022, 8:11pm UTC](https://discourse.julialang.org/t/dirac-delta-in-boundary-conditions-for-methodoflines-jl/80567 "2022-05-05T20:11:04Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![xtalax](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xtalax/32/35293_2.png) [@xtalax](https://discourse.julialang.org/u/xtalax)\
**Post date:** [May 17, 2022, 2:43pm UTC](https://discourse.julialang.org/t/dirac-delta-in-boundary-conditions-for-methodoflines-jl/80567/5 "2022-05-17T14:43:42Z")

</div>

Yeah the source relies heavily on Symbolics.jl and SymbolicUtils.jl, not so easy to understand if you don’t have experience with it. To see where terms are recognised and schemes applied see [this](https://github.com/SciML/MethodOfLines.jl/blob/e24d5b904a5c1049933e69f7eefa75226c9bccf4/src/discretization/generate_finite_difference_rules.jl#L158) file, also useful to understand this is the [documentation on `@rule`](https://symbolicutils.juliasymbolics.org/rewrite/). Short answer, yes advection terms are automatically intercepted and the correct upwind scheme applied :). Any more questions on functionality welcome!

`upwind_order` is the aproximation order of the upwind scheme, note that this appears to lead to instability when it is above 1, which is its default, which I suspect is due to offside stencils near the boundaries.

Current work is on implementing flux limiters to ensure stability and higher order accuracy for advection terms in a wider set of circumstances.

---

_[View the full topic](https://discourse.julialang.org/t/dirac-delta-in-boundary-conditions-for-methodoflines-jl/80567)._
