discontinuous second derivative
I am calculating the first and second derivative of a velocity profile. I am using a 3 point centered for the 1st derivative and 5 point central stencil for the 2nd derivative.
For some reason I am getting a discontinuous 2nd derivative but I have a smooth 1st derivative. Could some one explain what is going on? 
Quote:

here is the original velocity profile that was calculated from my cfd code. I am trying to find the inflection points in the profile
http://i1118.photobucket.com/albums/...g/velocity.jpg 1st derivative http://i1118.photobucket.com/albums/...zhang/1der.jpg 2nd derivative http://i1118.photobucket.com/albums/...ang/2deriv.jpg 
What are you doing near the boundary for the 5 point stencil?


The velocity profile was generated using a 2D navier stokes code on a staggered grid with dirichlet boundary conditions. I have run the code using parameters where I do not expect to see any inflection points but they still appear near the boundary. This makes me think that it is a consequence of the method I am using and not a physical property of the flow. Is this possible?

Quote:

This is not channel flow. It is a lid driven cavity problem with both the upper and lower walls moving at RE ~ 500. Also could you elaborate on how the second derivative along y being balanced by the pressure derivative along x affects my problem?

So if I run a lid driven cavity flow for a square domain and a Re of 100 and take the velocity at x = 0.5, I find that there is an inflection point near the upper moving wall using a 3 point and a 5 point difference scheme for the second derivative. Conceptually I don't expect this to be there. Is there anyone that can explain what I am seeing?

I suggest you to check your derivative (1st and 2nd) function toward some simple case (say a sin function) and perform a grid refinement study to see that everything is fine.
My visual impression is that you kinda used a wrong sign near the boundaries (or for interior points). Also, the first formula you posted (the one for the first interior point) clearly has an error (i'm saying it just because if it is not a typo and you copied it from the code it could help you in find out where the problem is). According to your second derivative plot, the first derivative one has a first derivative (sorry about this sentence) which is always negative but, according to the image, this does not seem to be the case. 
All times are GMT 4. The time now is 12:29. 