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

Upwind Vs Central Difference

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2014, 16:06
Default Upwind Vs Central Difference
  #1
New Member
 
KUMAR SAURABH
Join Date: Sep 2014
Posts: 6
Rep Power: 12
saurabh007 is on a distinguished road
I discretized an unsteady state convection diffusion equation and solved it with both CDS and upwind scheme and Crank Nicholson time step. But the solution of CDS and upwind are same till certain time interval (exactly speaking till 60 iterations) but after that upwind tends to give wrong solution. Is there something wrong with my code or is it because of less accurate upwind scheme.

Please help.
Thanks in advance.
saurabh007 is offline   Reply With Quote

Old   September 23, 2014, 05:06
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by saurabh007 View Post
I discretized an unsteady state convection diffusion equation and solved it with both CDS and upwind scheme and Crank Nicholson time step. But the solution of CDS and upwind are same till certain time interval (exactly speaking till 60 iterations) but after that upwind tends to give wrong solution. Is there something wrong with my code or is it because of less accurate upwind scheme.

Please help.
Thanks in advance.
your question is too general... you used first order upwind? what about your problem (initial and boundary condition). What about your CFL and diffusivity parameters? What about your cell Peclet?
Provide also a graph of the solution
FMDenaro is offline   Reply With Quote

Old   September 24, 2014, 21:16
Default
  #3
Senior Member
 
Martin Hegedus
Join Date: Feb 2011
Posts: 500
Rep Power: 19
Martin Hegedus is on a distinguished road
Unless artificial dissipation has been added, the central difference method will be unstable.
Martin Hegedus is offline   Reply With Quote

Old   September 25, 2014, 04:57
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Martin Hegedus View Post
Unless artificial dissipation has been added, the central difference method will be unstable.
Actually he wrote that the problem is convection- diffusion, thus even for central difference exists a finite stability region in the (Peh, cfl) plane.
FMDenaro is offline   Reply With Quote

Old   September 25, 2014, 06:39
Default
  #5
New Member
 
KUMAR SAURABH
Join Date: Sep 2014
Posts: 6
Rep Power: 12
saurabh007 is on a distinguished road
The problem is as follows:
  • Given a squre block of side length 1m
  • Make 101*101 partition

[(∂∅)/∂t+ u (∂∅)/∂x+ v (∂∅)/∂y=D((∂^2∅)/(∂x^2 )+ (∂^2∅)/(∂y^2 ))
u = cos((pi*(x - 0.5))*sin(pi*(y - 0.5))
v = -sin(pi*(x - 0.5))*cos(pi*(y - 0.5))
D=1

Boundary condition: phi = 0 at boundaries.

Initial Condition: phi = cos(pi*(x - 0.5))*cos(pi*(y - 0.5))

I am not able to attach the results because of size constraint but what happens is that after 67 time iterations the result in case of upwind begins to diverge from the exact solution. But in CDS, it is exactly the same.
saurabh007 is offline   Reply With Quote

Old   September 25, 2014, 07:27
Default
  #6
Senior Member
 
Martin Hegedus
Join Date: Feb 2011
Posts: 500
Rep Power: 19
Martin Hegedus is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Actually he wrote that the problem is convection- diffusion, thus even for central difference exists a finite stability region in the (Peh, cfl) plane.
I could be wrong on all of it. All I can say for sure is that if I don't use enough of it in my 2nd order central difference N.S. code, it blows up and it is independent of the CFL number.
Martin Hegedus is offline   Reply With Quote

Old   September 25, 2014, 09:27
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Martin Hegedus View Post
I could be wrong on all of it. All I can say for sure is that if I don't use enough of it in my 2nd order central difference N.S. code, it blows up and it is independent of the CFL number.
the stability region depends on both CFL and Reh, if you use a small cfl and a small Reh ( about 2-3). You can see an example in the Hirsch book (Green book) for the convection-diffusion problem.

I worked using CN+AB time integration and second order central discretization and obtained a stability region (see attachment).

When you add artificial dissipation you are just working at small Reh, the same effect should be obtained by increasing the mesh resolution
Attached Files
File Type: doc abcn_stability.doc (88.0 KB, 11 views)
FMDenaro is offline   Reply With Quote

Old   September 25, 2014, 10:37
Default
  #8
New Member
 
KUMAR SAURABH
Join Date: Sep 2014
Posts: 6
Rep Power: 12
saurabh007 is on a distinguished road
Once the steady state is reached, does the upwind scheme has the problem ov overestimation or something like that if we continue for more period of time.
saurabh007 is offline   Reply With Quote

Old   September 25, 2014, 10:55
Default
  #9
New Member
 
KUMAR SAURABH
Join Date: Sep 2014
Posts: 6
Rep Power: 12
saurabh007 is on a distinguished road
I have attached an image where clearly some perturbation is seen when the upwind is run for more time.
Attached Images
File Type: png jds.png (3.9 KB, 17 views)
saurabh007 is offline   Reply With Quote

Old   September 25, 2014, 12:10
Default
  #10
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by saurabh007 View Post
I have attached an image where clearly some perturbation is seen when the upwind is run for more time.

your solution is of order 10^-9, practically you have a vanished solution, the oscillation you see are simply due to the fact that you are approaching the limit of the threshold for the convergence...
You have no numerical instability
FMDenaro is offline   Reply With Quote

Old   September 25, 2014, 15:24
Default
  #11
Senior Member
 
Martin Hegedus
Join Date: Feb 2011
Posts: 500
Rep Power: 19
Martin Hegedus is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
the stability region depends on both CFL and Reh, if you use a small cfl and a small Reh ( about 2-3). You can see an example in the Hirsch book (Green book) for the convection-diffusion problem.

I worked using CN+AB time integration and second order central discretization and obtained a stability region (see attachment).

When you add artificial dissipation you are just working at small Reh, the same effect should be obtained by increasing the mesh resolution
Can't say I'm well versed in the ins and outs of this, but I'm surmising that this depends on what is being diffused by the equation set. For example, I believe the low Mach number (incompressible) N.S. equations diffuse vorticity but not pressure. So some sort of dissipation must be numerically added.

Regardless, the original posters equation set seems to be manufactured so I guess it's set up to work correctly.
Martin Hegedus 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
Implementation of 2nd order upwind scheme jaason OpenFOAM Running, Solving & CFD 4 February 6, 2015 18:40
Upwind Vs Central Difference saurabh007 Main CFD Forum 1 September 26, 2014 08:26
Periodic Boundary Condition for upwind difference yohey44 Main CFD Forum 0 October 27, 2010 14:10
the effect of upwind difference hades Main CFD Forum 8 March 15, 2009 00:43
Central Difference vs Upwind Defference S. Balasubramanyam Main CFD Forum 5 January 16, 2002 02:58


All times are GMT -4. The time now is 08:57.