# how to compute the gradient of a function

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

 January 5, 2001, 10:19 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?

 January 5, 2001, 13:02 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.

 January 10, 2001, 09:11 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.

 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 tom FLUENT 2 September 7, 2016 03:48 Chris Lucas OpenFOAM Programming & Development 4 August 27, 2012 03:11 skabilan OpenFOAM Installation 3 July 28, 2009 00:35 ben akih CFX 3 October 10, 2006 21:47 Paul Hsieh Main CFD Forum 3 November 11, 2003 05:52

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