# Implementing initial conditions into the solution domain of a 1-D advection-diffusion equation

I have the following PDE.

$\frac{\partial c}{\partial t} + v\frac{\partial c}{\partial x} - D\frac{\partial^2 c}{\partial x^2} = 0 \\$.

I have discretized it such that i now have $\frac{dC}{dt} = aC_{i+1} +bC_{i} +cC_{i-1} \\$ (1)

I have been given the following initial conditions:

$\\C=C_0\quad\forall \ 0<t<\tau\\$

$\\C=0\quad\forall \ t>\tau\\$

i have been asked how i would go about: ' describe how to implement the initial conditions in terms of the solution domain and in terms of any extra vectors'.

This question is from a degree course and is about injecting a trace of dye.

I have discretised the convective component using simple upwind and the diffusive component using central differences. I'm struggling to understand what the question is asking me.

I understand that evaluation at i=1 poses a problem in that it requires C at $\ C_0\\$. This is outside of the solution domain and would require a ghost node, but this is outside the solution domain.

What are peoples thoughts?

For the 1st initial condition i was thinking of ignoring the diffusive component and for the 2nd initial condition ignoring both the diffusive and convective terms since there is no dye left. Then i would have two equations that describe the initial conditions.

• Initial condition should be applied to $C$ at $t=0$ for $x_i \in [a,b]$, i.e. you should define the values of $C_{i,0} =C(x_i, 0)$ for $i = \overline{1,N}$, here denoted $N$ is the number of spatial grid points (suppose you are working with the finite difference method). While from what you wrote the condition seem be a boundary condition. – tqviet Nov 13 '16 at 4:05
• this is my question - i don't know why it won't let me edit it but basically the question outlines those conditions as the initial conditions and gives a boundary condition at the outlet of the system. – Trying2think Nov 13 '16 at 19:33
• As I think @tqviet suggested, I suspect a slight confusion of notation, where $C_0$ represents $C(x,t)$ for $t=0$ as opposed to $C_i = C(x_i,t)$ with $i=0$. I would say your problem needs the spatial domain specified, and boundary conditions, as this will give you your discretisation at $x_1$ and $x_N$. – Steve Nov 14 '16 at 11:42