CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

how to calculate derivatives

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2002, 22:31
Default how to calculate derivatives
  #1
Senthil
Guest
 
Posts: n/a
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
  Reply With Quote

Old   March 22, 2002, 06:27
Default 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
  Reply With Quote

Old   March 22, 2002, 22:44
Default 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
  Reply With Quote

Old   March 22, 2002, 23:32
Default 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
  Reply With Quote

Old   March 25, 2002, 10:53
Default 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
  Reply With Quote

Old   March 26, 2002, 20:41
Default 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
  Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDM derivatives for - for EHD flow Sandilya Garimella FLUENT 7 September 9, 2013 03:17
Stability Derivatives embolado FLUENT 0 December 27, 2010 01:12
How to calculate second order derivatives using udf? legendyxg Fluent UDF and Scheme Programming 0 October 6, 2009 22:05
How to calculate Torque for francis turbine manish CFX 4 March 15, 2007 02:57
Getting derivatives at the face Ajay Rao FLUENT 2 November 18, 2003 09:24


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