CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

how to compute the gradient of a function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 5, 2001, 10:19
Default how to compute the gradient of a function
  #1
zhanglei
Guest
 
Posts: n/a
the value of the function f is known on each grid point, to approximate the gradient of the function f, i.e. (df/dx, df/dy) which is the good choice, central difference? or one-sided difference? or some more complicate form?
  Reply With Quote

Old   January 5, 2001, 13:02
Default Re: how to compute the gradient of a function
  #2
John C. Chien
Guest
 
Posts: n/a
(1). It depends on the nature of this function. (2). In principle, the central difference is more accurate than the one-sided difference, based on the Taylor series expansion. (2). Most numerical analysis books have a chapter on the numerical interpolation. And if you are dealing with test data, with some random distributions, then you will have to create a new approxmate smooth function first, in order to derive the general trend or gradient.
  Reply With Quote

Old   January 10, 2001, 09:11
Default Re: how to compute the gradient of a function
  #3
peter.zhao
Guest
 
Posts: n/a
For finite differnece method,the central difference is usually used to calculate the gradient on account of the accuracy.Meanwhile,for finite volume method,it is better to use Gauss integral theorem over a control unit to calculate the gradient than central differnce.For example,when you calculate the derivative of velocity on the cell interface for viscous term in the N-S equations,the central differnce only takes account of one direction,i.e.you deal with the thin layer N-S eq or PNS,but the Gauss integral considers all direction,i.e.you deal with the full N-S eq.
  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
surface tension as function of normal gradient tom FLUENT 2 September 7, 2016 04:48
get velocity gradient with a boundary function Chris Lucas OpenFOAM Programming & Development 4 August 27, 2012 04:11
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 01:35
User defined function for density gradient ben akih CFX 3 October 10, 2006 22:47
How to compute gradient for non-orthogonal grids? Paul Hsieh Main CFD Forum 3 November 11, 2003 05:52


All times are GMT -4. The time now is 15:42.