|
[Sponsors] |
January 29, 2015, 06:15 |
Advection-Diffusion equation
|
#1 |
New Member
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11 |
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 |
|
January 29, 2015, 12:53 |
|
#2 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
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: |
|
January 29, 2015, 13:00 |
|
#3 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73 |
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? |
|
February 4, 2015, 06:37 |
|
#4 |
New Member
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11 |
@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. |
|
February 4, 2015, 10:28 |
|
#5 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
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? |
|
February 5, 2015, 03:55 |
|
#6 |
New Member
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11 |
@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? |
|
February 5, 2015, 19:07 |
|
#7 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
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. |
|
February 6, 2015, 02:18 |
|
#8 |
New Member
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11 |
@mprinkey: Thank you very much for your effort in answering me. I will try what you suggested.
|
|
February 9, 2015, 03:11 |
|
#9 |
New Member
Prakash
Join Date: Jan 2015
Posts: 14
Rep Power: 11 |
@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.
|
|
|
|
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 |