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

Advection-Diffusion equation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By mprinkey

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 29, 2015, 06:15
Question Advection-Diffusion equation
  #1
New Member
 
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
prak_1989 is on a distinguished road
Hi there,
I am solving a linear convection diffusion equation using different orders up to 8th order. But as I increase the order the numerical solution is moving away from the analytical solution. With the given scheme, L2-norm curve for different grid points doesn't refect the order of the scheme. Can someone please tell what could be the problem?

Initial condition: u(x,0) = 0,

Boundary condition: u(0, t) = sin (omega*t)
u(1, t) = sin (2*omega*t)

omega = 2* PI * frequency
prak_1989 is offline   Reply With Quote

Old   January 29, 2015, 12:53
Default
  #2
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
What time integration scheme are you using? If you don't scale the accuracy of the time scheme (either by increasing the order or significantly reducing the time step) with that of the spatial scheme, the time errors will dominate the result.

You don't mention how you are reaching 8th-order. I am assuming this is via finite differences (standard or compact). What are you doing at the boundaries where you don't have enough points to fill the normal stencil? Do you have lopsided stencils that retain the higher-order accuracy. If not, error from the lower order treatments near the boundaries can pollute the overall result.

How are you generating your convective fluxes? 8th-order upwinding? If you are using central differencing for convective terms, you really need to know what you are doing.

Lastly, you need to consider finite precision issues. Using dx=0.01 leads to 8th-order errors that are at the limit of double precision accuracy. So, be mindful of that. Just using finite differences to evaluate simple derivatives can illustrate the problem as shown in Figure 1 of this note:

http://math.mit.edu/~stevenj/18.303/...nce-approx.pdf

Note the erratic error behavior for 2nd order central difference as the dx gets small:
FMDenaro and prak_1989 like this.
mprinkey is offline   Reply With Quote

Old   January 29, 2015, 13:00
Default
  #3
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I agree, the time step should be the lowest possible to examine the spatial error.
Furthermore, what about the Reh? you get into stability requirement involving both CFL and diffusive parameter, how do you face that?
FMDenaro is offline   Reply With Quote

Old   February 4, 2015, 06:37
Default
  #4
New Member
 
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
prak_1989 is on a distinguished road
@mprinkey and @FMDenaro: Thanks for the reply, The time stepping del_t = 10E-9.
I am using non-uniform grids, x = XLower + (XUpper - XLower)*0.5*(1.0 - asin(alpha_r*cos(PI/N))/asin(alpha_r)) with the stretching parameter alpha_r = 0.95, XLower = 0.0 and XUpper = 1.0.
Standard finite difference scheme is used and I am using central difference scheme for treating the convection term.
I am simulating low Reynold's number flow.
prak_1989 is offline   Reply With Quote

Old   February 4, 2015, 10:28
Default
  #5
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
delta t of 1e-9 is good if your time scheme is second order. I will go out on a limb here and say that in double precision, there is no time step small enough to use with a 1st-order time scheme and 8-th order spatial scheme.

How are you applying central differences to the stretched grid? Are you doing a coordinate transformation on the transport equation to move from the stretched to uniform grid and then applying the standard central stencils?
mprinkey is offline   Reply With Quote

Old   February 5, 2015, 03:55
Default
  #6
New Member
 
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
prak_1989 is on a distinguished road
@mprinkey: No, I am generating coefficient matrix for the non-uniform grids and use standard finite difference scheme. I am not doing any co-ordinate transformation as such.

So, you tell that even if the time stepping is small, the combination of first order time stepping and higher order spatial derivative would be redundant?
prak_1989 is offline   Reply With Quote

Old   February 5, 2015, 19:07
Default
  #7
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
I think you are creating potential problems for yourself using first order. An accuracy study of this sort would be better undertaken with at least adams-moulton or trapezoidal rule for implicit time integration or a 3rd- or 4th-order RK scheme for explicit.

Set all of that aside. You have a differencing scheme. You have an exact solution. I recommend that you test the accuracy of your differencing scheme directly and see if your approach can produce the appropriate order plot...as in the simple note I linked to earlier. You should be able to plot your error at test points on a log plot and see the appropriate slope for each spatial scheme.

As I mentioned before, you need stencils that are lopsided in order to treat nodes near boundaries. Your 8-th order stencil is 9 nodes wide for central differencing. So for node 1-4 and node n-3 to n, you will need different stencils. If you are doing that, then you should test the convergence of your differencing scheme at all of those "special" nodes too. As I said before, errors from lower order boundary treatments can spread throughout the entire solution.
mprinkey is offline   Reply With Quote

Old   February 6, 2015, 02:18
Default
  #8
New Member
 
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
prak_1989 is on a distinguished road
@mprinkey: Thank you very much for your effort in answering me. I will try what you suggested.
prak_1989 is offline   Reply With Quote

Old   February 9, 2015, 03:11
Default
  #9
New Member
 
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
prak_1989 is on a distinguished road
@mprinkey: With the second order time stepping, its working. I got the L2 norm curves which represent the order of the scheme. Thank you very much.
prak_1989 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
recommended book to the study of reaction diffusion convection equation? lfgmarc Main CFD Forum 1 January 14, 2011 07:34
Diffusion equation solved using Parallel Computing Sachin Paramane Main CFD Forum 0 June 12, 2007 00:48
Advection equation.... CFD Question Main CFD Forum 4 May 12, 2005 13:00
Gas diffusion equation!! Arun Siemens 1 April 23, 2004 06:48
A bout scalar advection equation in SEM Mehdi BEN ELHADJ Phoenics 2 April 27, 2001 16:31


All times are GMT -4. The time now is 23:46.