#Numerical Analysis (CFD)

3 messages · Page 1 of 1 (latest)

woven mortar
#

am solving the 1-D advection-diffusion equation, but I am stuck on how to implement the formula into my code. I understand how to the the next time step when the advection term and diffusion term are separate, but I am stuck now when they are both together. I am using Crank-Nicolson for the Advection term and RK4 for the diffusion term. I am Able to get this far but i realize that RK4 is a multi-step method with 4 steps. What I have solved by mistake is RK2. How do I advance further than this? What i am trying to find the the next timestep U^n+1. In this image D1 is a derivative matrix for the 1st derivative and D2 is one for the 2nd derivative. (error i spotted in my writing its supposed to be dt/2 not dt/4)

south yarrowBOT
woven mortar
#

i tried using finite volume methods to solve this, but we are specifically asked to finite difference methods