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

discretization of variable parameters

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2011, 18:42
Default discretization of variable parameters
  #1
New Member
 
Join Date: May 2009
Posts: 6
Rep Power: 17
mauz is on a distinguished road
Dear all,

in a porous layer I have a certain liquid s(x) distribution. The relative permeability is function of it: k(x) = s(x)^3. I need to determine the derivative of k, dk/dx. Should I discretize k:

dk/dx|i = (k(i+1) - k(i-1))/(2h)

or reduce the derivative as follow:

dk/dx|i = 3*s(i)^2 * ds/dx|i = 3*s(i)^2*((s(i+1) - s(i-1))/(2h)) ?

They lead to different results, and can not find a valid reason to choose one of them.

thanks and regards

Mauri
mauz is offline   Reply With Quote

Old   June 25, 2011, 17:44
Default
  #2
Senior Member
 
ztdep's Avatar
 
p ding
Join Date: Mar 2009
Posts: 427
Rep Power: 19
ztdep is on a distinguished road
Send a message via Yahoo to ztdep Send a message via Skype™ to ztdep
Dear friends:
The difference come from the discretisation error.for example,
if we set s(x)=x;
x|i=0.1;
then
dk/dx|i=(x+h)^3-(x-h)^3/(2*h);

using the reduced form we have

dk/dx|i=3*x^2*ds/dx=3*x^2;

if we set h=0.1, the first one gives a value of 0.40 while the second one gives 0.030.
if we reduce the h to 0.01, then the first one gives a avalue of 0.0301;
ztdep is offline   Reply With Quote

Reply

Tags
derivatives, discretization, parameter

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 05:35
Env variable not set gruber2 OpenFOAM Installation 5 December 30, 2005 05:27
Expert Parameters: Can you use a variable? Paul CFX 1 July 6, 2005 16:21
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 13:50.