
[Sponsors] 
April 27, 2012, 22:24 
discontinuous second derivative

#1 
Member
Peter
Join Date: Oct 2011
Posts: 52
Rep Power: 5 
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? 

April 28, 2012, 05:50 

#2  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 1,651
Rep Power: 23 
Quote:


April 28, 2012, 10:44 

#3 
Member
Peter
Join Date: Oct 2011
Posts: 52
Rep Power: 5 
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 

April 28, 2012, 12:29 

#4 
Senior Member
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 387
Rep Power: 6 
What are you doing near the boundary for the 5 point stencil?


April 28, 2012, 12:39 

#5 
Member
Peter
Join Date: Oct 2011
Posts: 52
Rep Power: 5 

April 28, 2012, 12:54 

#6 
Member
Peter
Join Date: Oct 2011
Posts: 52
Rep Power: 5 
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?


April 28, 2012, 13:12 

#7  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 1,651
Rep Power: 23 
Quote:


April 28, 2012, 13:50 

#8 
Member
Peter
Join Date: Oct 2011
Posts: 52
Rep Power: 5 
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?


April 28, 2012, 14:59 

#9 
Member
Peter
Join Date: Oct 2011
Posts: 52
Rep Power: 5 
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?


April 28, 2012, 16:55 

#10 
Senior Member

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. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Derivative matrix  jollage  Main CFD Forum  0  September 21, 2011 18:16 
can i get pressure derivative in UDF?  ruirui389  Fluent UDF and Scheme Programming  4  April 8, 2011 04:12 
scalar and its derivative  sucker  Main CFD Forum  1  April 15, 2008 13:28 
Obtaining substantial or partial derivative of vel  KRK  FLUENT  0  January 10, 2007 13:35 
Second derivative with cfx 5.7.1  Alessandro  CFX  10  April 21, 2006 10:31 