# discontinuous second derivative

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 27, 2012, 22:24 discontinuous second derivative #1 Member   Peter Join Date: Oct 2011 Posts: 52 Rep Power: 7 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: 2,694
Rep Power: 33
Quote:
 Originally Posted by new_at_this 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?
could you post the plot of the original function?

 April 28, 2012, 10:44 #3 Member   Peter Join Date: Oct 2011 Posts: 52 Rep Power: 7 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: 388 Rep Power: 8 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: 7 I am using the following formulas for the boundary point and the first interior point. I have also calculated the 2nd derivative with the 3point central scheme and my main problem is that it is showing an inflection point near the boundary of the flow but I do not expect that to be there.

 April 28, 2012, 12:54 #6 Member   Peter Join Date: Oct 2011 Posts: 52 Rep Power: 7 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: 2,694
Rep Power: 33
Quote:
 Originally Posted by new_at_this 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?
First, if this is the solution in a laminar channel flow, it is not correct, you shoudl have a parabolic velocity profile and a linear first derivative. Furthermore, the second derivative along y is balanced by the pressure derivative along x which is constant

 April 28, 2012, 13:50 #8 Member   Peter Join Date: Oct 2011 Posts: 52 Rep Power: 7 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: 7 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     Paolo Lampitella Join Date: Mar 2009 Location: Italy Posts: 613 Blog Entries: 17 Rep Power: 20 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 Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post jollage Main CFD Forum 0 September 21, 2011 18:16 ruirui389 Fluent UDF and Scheme Programming 4 April 8, 2011 04:12 sucker Main CFD Forum 1 April 15, 2008 13:28 KRK FLUENT 0 January 10, 2007 13:35 Alessandro CFX 10 April 21, 2006 10:31

All times are GMT -4. The time now is 04:58.

 Contact Us - CFD Online - Top