|
[Sponsors] |
March 20, 2019, 06:47 |
2nd order Upwind Scheme (FDM)
|
#1 |
New Member
Jayabrata Dhar
Join Date: Nov 2018
Posts: 17
Rep Power: 8 |
It is a peculiar thing I noticed that the 1st order FDM scheme gives a realistic result than a 2nd order one-sided FDM scheme for approximating first-order derivatives. See the image below for the one-sided approximation.
[IMG]https://doc-0c-2s-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/jtrqejfqmdige42m1bjdhnpue7r3o5t9/1553076000000/02266267703806582586/*/1WrAE_vC_RLNlIgQPHusJ2AOmB2HPjG3A[/IMG] I am using a one-sided approximation for a simple 2nd order upwind scheme wherein my velocity is positive at i=3 (I want to avoid a 1st order scheme for numerical diffusivity issues). Now, because of this anomaly, my code is predicting a negative concentration in spite of concentration at the boundary is 1 (u1) and all other points are zero (u2, u3 and so on) at the initial time. Please note, I have written a 3D geometric multigrid code but given the example of a 1D situation for easier explanation. Since in the first time I am encountering a negative u, the later times are therefore giving all wrong results. It would be really kind of any of the members to let me know is there any simpler scheme to get rid of this issue without sacrificing the 2nd-order accuracy. Thank you in advance. |
|
March 20, 2019, 08:04 |
|
#2 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
To understand clearly the effect of the second order upwind formula I suggest to see the modified wavenumber (real and imaginary parts), you will discover a strange behavior. Of course you have to take into account the global effect when a time discretization is in effect, too.
|
|
March 20, 2019, 12:02 |
|
#3 |
Senior Member
-
Join Date: Jul 2012
Location: Germany
Posts: 184
Rep Power: 14 |
Your example is ill posed, because
1. You want to compare gradient approximations with non-smooth functions, the result is meaningless. 2. Higher order methods does not mean immediately more accuracy. It tells you something about the decay of the error if you increase your DOFs. |
|
March 20, 2019, 12:44 |
|
#4 | |
New Member
Jayabrata Dhar
Join Date: Nov 2018
Posts: 17
Rep Power: 8 |
Quote:
Whatever you said is true but the strange fact is that it gives an answer worse than 1st order, which was bothering me. I found that no linear 2nd order accurate upwind schemes are safe from generating local or global extremum (minimum or maximum), only the first-order upwind scheme is safer in this sense (with a loss in the accounting of numerical diffusivity). So, I have to shift to non-linear upwind schemes (like TVD). Nevertheless, I was curious if there is still a way to get around the above issue for such a simple boundary condition of the wall having a Dirichlet value while all other points are zero. PS: Thanks for all the above replies |
||
March 20, 2019, 12:48 |
|
#5 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
Quote:
What you are discovering is the basic knowledge of CFD. The first thing to know is the concept of monotonic scheme and the consequence of the Godunov theorem. Then, any accuracy order evaluation can be done only on regular smooth functions. |
||
March 20, 2019, 13:01 |
|
#6 |
Senior Member
Join Date: Jul 2009
Posts: 358
Rep Power: 19 |
Another way to think about is that when you choose a 2nd order approximation to the derivative, you are making an underlying assumption that your data can be approximated by a quadratic function. Your example is better approximated by a piecewise linear function, which is the underlying functional representation for a 1st order derivative approximation. So it is not surprising that your results show what you see. Numerical schemes have formal orders of accuracy, and practical orders of accuracy. Applying a formally second order accurate algorithm to a problem requires attention to the details of your problem to ensure that you get 2nd order accuracy at the end.
|
|
Tags |
boundary condition error, fdm, second-order upwind |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Third order MUSCL Scheme | 94bb494nd41f | FLUENT | 4 | January 25, 2024 13:23 |
Implementation of 2nd order upwind scheme | jaason | OpenFOAM Running, Solving & CFD | 4 | February 6, 2015 18:40 |
grid independence and first order upwind scheme | yhy20081016 | Main CFD Forum | 4 | February 24, 2014 00:09 |
IS calc. with 2nd order discret. always necessary? | Azman | FLUENT | 2 | March 14, 2013 05:28 |
second order FD upwind scheme | Heinz Wilkening | Main CFD Forum | 2 | November 3, 1998 15:33 |