# how to calculate derivatives

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 21, 2002, 23:31 how to calculate derivatives #1 Senthil Guest   Posts: n/a Sponsored Links Hi, I need to get second derivative and fourth derivative of velocity and temperature. Are these quantities available directly from fluent macros. If not, then I have to use finite difference formula to calculate these derivatives. My problem is that I dont know in which order the cell variables are stored. How do I calculate these derivatives then?. Thank you, Senthil

 March 22, 2002, 07:27 Re: how to calculate derivatives #2 Greg Perkins Guest   Posts: n/a You'll probably have to write udfs for this... First derivatives are available as macros, eg. C_U_G(c,t)[d] gives the derivative of the U velocity in the dth co-ordinate direction. You can apply these successively to obtain higher derivatives....by copying into a UDS. However, I've never been too clear on exactly how these are calculated. In fact I found that when I wanted to calculate the face flux for diffusion, ie q = kdthi/dx using the above macros gave incorrect results and I ended up re-applying an upwind scheme to calculate the correct flux. I think they are defined at the centre of the cell, which might be ok for your application, but you might need to be careful if accuracy is required... Greg

 March 22, 2002, 23:44 Re: how to calculate derivatives #3 Senthil Guest   Posts: n/a Hi Greg, Thanks.. I assume UDS mean, user defined scalar. When I went through the fluent manual, I found out that if I define a UDS, it always try to solve a transport equation for that scalar. How can I make it calculate derivative. Could you tell me how you calculated dthi/dx. May be I could write udf by the same algorithm to calcualte higher derivatives. Thank you Senthil

 March 23, 2002, 00:32 Re: how to calculate derivatives #4 Greg Perkins Guest   Posts: n/a You can switch off solving a UDS in the solve/control panel. I used a simple scheme (first-order) based on neighbouring cell data. You will need to loop over cell faces to get the neighbouring cells to calculate the derivative in this manner... Greg

 March 25, 2002, 11:53 Re: how to calculate derivatives #5 keith Guest   Posts: n/a Greg, I was wondering if you've calculated higher order derivatives (2nd and above) in the manner you describe. I used a similar approach to calculate 2nd derivatives of the velocity field, but I found the result to be very "noisy", especially on unstructured grids. With smoothing, I can get something usable, but still not great. Have you run into this and do you have any suggestions for improving it? Regards, Keith

 March 26, 2002, 21:41 Re: how to calculate derivatives #6 Greg Perkins Guest   Posts: n/a I found even the C_UDSI_G etc derivatives weren't very good when compared to derivatives calculated at the faces using the approrpiate discretization scheme. I think this is partly because I'm not completely sure how these macros are defined. That's why I wasn't too keen on using them. The udf manual doesn't mention the definition, does it? I haven't tried high-order schemes. I think increasing noise is common when taking derivatives - but I'm not up with what additional smoothing, adjustments etc are best to make. There's probably some literature on this, or see if Fluent can help.... Greg

 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 Sandilya Garimella FLUENT 7 September 9, 2013 03:17 embolado FLUENT 0 December 27, 2010 02:12 legendyxg Fluent UDF and Scheme Programming 0 October 6, 2009 22:05 manish CFX 4 March 15, 2007 03:57 Ajay Rao FLUENT 2 November 18, 2003 10:24

All times are GMT -4. The time now is 09:17.