Sorry for my typing mistake in writing equations (1) & (2). Thanks for the correction. Also, I tried to write equation in Latex with single $..$ instead of writing with double $. For that reason it didn't work. Thanks for adding the delimiters. I have deleted '\right' from the last equation that...
I have used the following central difference formula for the spatial derivatives: (written in Latex)
$$\frac{\partial^2 c}{\partial z^2} = \frac{c_{\rm i+1,j}^{k}-2 c_{\rm i,j}^{k}+c_{\rm i-1,j}^{k}}{(\Delta z)^2}+O[(\Delta z)^2]$$
$$\frac{\partial c}{\partial r} = \frac{c_{\rm...
Many thanks for your response. I have imposed symmetry condition, cnew(i,1)=cnew(i,2) at r=0 (since I am calculating concentration within a straight tube). Also, I have used no-flux condition, cnew(i, rsteps+1)=cnew(i, rsteps) at r=r_max (i.e., on the tube surface), and periodic condition...
Hi,
I have written some codes for the finite difference solution of diffusion equation (\frac{\partial c}{\partial t}= D {\nabla^2 c}, where c is the species concentration and D is the diffusion coefficient) as follows:
DO k= 1, tsteps+1
DO i = 2, zsteps
DO j = 2, rsteps...
Thanks for your response. I am not sure how to calculate the stability condition. I have used the the formula \Delta t<=((\Delta x)^2+(\Delta y)^2)/(8*D) to make my program stable. But if there is no diffusion term,only convection term, how will I calculate the stability condition?
Thanks
Hi,
I know, there is a stability condition for solving the Convection-Diffusion equation by Finite Difference explicit/implicit technique, which is \Delta t<=(\Delta x)^2/(2*D) for one-dimensional or \Delta t<=((\Delta x)^2+(\Delta y)^2)/(8*D) for two-dimensional problem, where D is the...
Hi,
I have some points say, 100 points which come from a periodic tube profile, i.e., (z,r), where z and r are the axial and radial coordinates, respectively.
Now, I need to calculate the first derivative at each point.
Could you please help me in this regard?
Cheers