# Numerical algorithm to compute second order solution of non-linear advection with source

I would like to solve the following equation, $$\frac{\partial f}{\partial t}+\frac{\partial}{\partial x}\left({\mathcal A}f\right)=S(x,t)$$ where $$f$$ is a function of $$x$$ and $$t$$, $${\mathcal A}$$ is a function of $$f$$ and $$S$$ is a source independent of $$f$$ but depends on $$x$$ and $$t$$. My problem is I can find second order solution in $$x$$ of only advection equation using flux limiter but such solutions are not second order in time $$t$$. Moreover, with source such equation introduces stiffness and often give negative solutions. Is there any algorithm which can take care of these issues and provide second order in time and $$x$$. Any help would be highly appreciated.

• Is the first term on LHS meant to be $\partial_t f$ by any chance? May 15, 2023 at 19:27
• After spatial discretization, you are left with an ODE system. Have you tried using a higher-order time integrator? You only say "I can find [...] but such solutions are not second order in time t", but you don't say what you have already tried. May 15, 2023 at 22:15
• @MaximUmansky yes it should be $t$. Thank you for pointing it out. Now it is corrected. May 16, 2023 at 1:07
• @WolfgangBangerth whatever algorithm I could find they all are second order in space but time is integrated through forward Euler. Could you please comment on how to solve the space discretized ODE system for advection equation ? May 16, 2023 at 1:13
• You could just use a method that isn't forward Euler and make sure that the time step is small enough to satisfy the CFL condition. You could write your own or use an ODE solver in your software environment of choice. The stiffness and large imaginary eigenvalues of this system often necessitate robust time integrators. May 16, 2023 at 2:07