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

diffusion problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2014, 09:54
Default diffusion problem
  #1
New Member
 
Rahul Singh
Join Date: Aug 2014
Posts: 16
Rep Power: 11
rst1993 is on a distinguished road
while solving a diffusion problem using second order accurate finite difference scheme in computational domain, error from using first order accurate Neumann boundary condition is less than from second order accurate newmann boundary condition. is this possible or am i doing it wrong?
rst1993 is offline   Reply With Quote

Old   September 14, 2014, 11:05
Default
  #2
Member
 
Virendrasingh Pawar
Join Date: Jun 2013
Posts: 47
Rep Power: 12
virendra_p is on a distinguished road
Can you describe your problem in detail?
virendra_p is offline   Reply With Quote

Old   September 14, 2014, 13:06
Default
  #3
New Member
 
Rahul Singh
Join Date: Aug 2014
Posts: 16
Rep Power: 11
rst1993 is on a distinguished road
d^2u/dx^2=-10 sin(pi*x/50)
with one side dirchelet and another side neumann bc
rst1993 is offline   Reply With Quote

Old   September 14, 2014, 15:05
Default
  #4
Member
 
Virendrasingh Pawar
Join Date: Jun 2013
Posts: 47
Rep Power: 12
virendra_p is on a distinguished road
Here's something that might help .. http://www.scientificpython.net/pybl...different-ways ..meanwhile i'll try solving it just to recheck...good luck!
virendra_p is offline   Reply With Quote

Old   September 14, 2014, 16:03
Default
  #5
Senior Member
 
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17
adrin is on a distinguished road
Incidentally, if one uses a finite volume formulation, instead of finite difference, one will _automatically_ end up with method 3 described in the link

Adrin
adrin is offline   Reply With Quote

Old   September 14, 2014, 18:32
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by rst1993 View Post
while solving a diffusion problem using second order accurate finite difference scheme in computational domain, error from using first order accurate Neumann boundary condition is less than from second order accurate newmann boundary condition. is this possible or am i doing it wrong?
how do you discretize the Neumann bc ?
FMDenaro is offline   Reply With Quote

Old   September 14, 2014, 18:53
Default
  #7
New Member
 
Rahul Singh
Join Date: Aug 2014
Posts: 16
Rep Power: 11
rst1993 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
how do you discretize the Neumann bc ?
first i used a first order accurate finite difference and in another case using 2nd order accurate finite difference scheme.
rst1993 is offline   Reply With Quote

Old   September 15, 2014, 04:10
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by rst1993 View Post
first i used a first order accurate finite difference and in another case using 2nd order accurate finite difference scheme.

I mean how do you implement both formula on the boundry
FMDenaro is offline   Reply With Quote

Old   September 15, 2014, 04:28
Default
  #9
Member
 
Virendrasingh Pawar
Join Date: Jun 2013
Posts: 47
Rep Power: 12
virendra_p is on a distinguished road
Backward diff. for 1st order and central diff. for second order...
virendra_p is offline   Reply With Quote

Old   September 15, 2014, 04:43
Default
  #10
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
ok, suppose to work in the 1D problem f'' = q. I think you have some like a Neumann + Dirchlet BC.s, for example f'(x0)=p, f(L)=fL.

Consider i=1 the node at x0. Therefore,

(f(1)-2f(2)+f(3))/h^2 = q(2)

is the FD equation that requires Neumann BC.

1) first order

(f(2)-f(1))/h=p(1) -> f(1)=f(2)- h* p(1) .... OK!

2) second order central

(f(2)-f(0))/2*h = p(1)

and you see that the node 1 is not expressed and you have no way to substitute into the equation.

Please clarify your procedure ....
FMDenaro is offline   Reply With Quote

Old   September 15, 2014, 05:18
Default
  #11
Member
 
Virendrasingh Pawar
Join Date: Jun 2013
Posts: 47
Rep Power: 12
virendra_p is on a distinguished road
Second order discretization will require additional condition to eliminate the unknown...check: http://www.scientificpython.net/pybl...different-ways
virendra_p is offline   Reply With Quote

Old   September 15, 2014, 05:22
Default
  #12
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by virendra_p View Post
Second order discretization will require additional condition to eliminate the unknown...check: http://www.scientificpython.net/pybl...different-ways

For that, I strongly suggest to use a second order backward discretization that automatically provides the value at node 1 expressed in terms of node 2,3 and value of the derivative at 1. It is simple and more accurate than other
FMDenaro is offline   Reply With Quote

Old   September 15, 2014, 08:39
Default
  #13
New Member
 
Rahul Singh
Join Date: Aug 2014
Posts: 16
Rep Power: 11
rst1993 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
ok, suppose to work in the 1D problem f'' = q. I think you have some like a Neumann + Dirchlet BC.s, for example f'(x0)=p, f(L)=fL.

Consider i=1 the node at x0. Therefore,

(f(1)-2f(2)+f(3))/h^2 = q(2)

is the FD equation that requires Neumann BC.

1) first order

(f(2)-f(1))/h=p(1) -> f(1)=f(2)- h* p(1) .... OK!

2) second order central

(f(2)-f(0))/2*h = p(1)

and you see that the node 1 is not expressed and you have no way to substitute into the equation.

Please clarify your procedure ....
for 1st order accurate at boundary i used a backward difference (u(i)-u(i-1))/dx and for 2nd order accurate i used a backward biased finite difference (3u(i)-4u(i-1)+u(i-2))/2dxfor neumann bc.
in the main computational domain i used a central difference scheme.
rst1993 is offline   Reply With Quote

Old   September 15, 2014, 11:18
Default
  #14
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by rst1993 View Post
for 1st order accurate at boundary i used a backward difference (u(i)-u(i-1))/dx and for 2nd order accurate i used a backward biased finite difference (3u(i)-4u(i-1)+u(i-2))/2dxfor neumann bc.
in the main computational domain i used a central difference scheme.
ok, that's must definitely work fine ...could you show the convergence curves for both shcemes?
FMDenaro is offline   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
False Diffusion?? patovalades Main CFD Forum 3 July 20, 2014 13:16
Diffusion prince_pahariaa FLUENT 1 September 30, 2013 13:19
Jet diffusion flame problem skarnani Phoenics 0 April 30, 2010 18:32
Periodic flow boundary condition problem sudha FLUENT 3 April 28, 2004 08:40
Diffusion problem ravi varma FLUENT 6 December 8, 2002 23:10


All times are GMT -4. The time now is 02:12.