Seems to result in a delay differential equation (DDE), for which there is support in DifferentialEquations.jl but I think at the moment not in MTK. However you can discretize the advection equation via a method of lines approach and solve the resulting ODE. This can be done in MTK.
using ModelingToolkit, DifferentialEquations
function advection(;name, c=1, L=10, N=10, x0=0.0, xL=1)
@parameters t
sts = @variables x[1:N](t) = fill(x0, N)
Δz = L / N
Dt = Differential(t)
eqs = [
Dt(x[1]) ~ -c * (-xL + x[1]) / Δz
[Dt(x[i]) ~ -c * (-x[i-1] + x[i]) / Δz for i in 2:N]...
]
return ODESystem(eqs, t, vcat(sts...), []; name)
end
@named model = advection(N=10)
sys = structural_simplify(model)
prob = ODAEProblem(sys, Pair[], (0.0, 50.0))
sol = solve(prob, Rodas5())
However, you will get numerical diffusion and for changing velocities you have to use an upwind scheme. There are more sophisticated discretization approaches as well.