# Implementing boundary condition

I'm studying the transport of species A in the blood vessels,

$$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2}-v\frac{\partial C}{\partial x}$$

At x=0, I want to use the Neumann boundary condition

$$\frac{\partial C}{\partial x} =$$ constant

From the literature, I have the average concentration of the species A in blood. But, I am not sure what would be a reasonable value of the constant.

I would like to ask for suggestions on how to define the concentration gradient at the inlet.

• Your boundary need to be physically sound, so usually you require some sort of inward flux of material which is related to the gradient at the outlet. Perhaps Danckwert's boundary conditions are interesting in your case. – nluigi Dec 29 '18 at 5:25
• @nluigi Could you please explain "related to the gradient at the outlet"? I looked up for the definition of Danckwert's boundary condition in * Elements of Chemical Reaction Engineering by Fogler* I'm not really clear about how it has to be implemented in code. If node 0 is the first node in the simulation domain and $0^-$ is the ghost node $C(0^-) = C(0^+) - \frac{D}{v}\frac{dC}{dx}$ Should the gradient at the inlet be discretized as $\frac{C(0) - C(0^-)}{\Delta x}$ – Natasha Dec 29 '18 at 13:08
• @nluigi Would it be right to understand that Danckwert's boundary condition is similar to Robin Boundary Condition which is a mix of Neumann and Dirichlet boundary conditions. – Natasha Dec 29 '18 at 13:41
• woops sorry to confuse you, i meant to say '... is related to the gradient at the inlet'. I cant remember exactly but perhaps a good reference for this is 'numerical methods for chemical engineers' by Beers – nluigi Dec 29 '18 at 15:06