# TVD schemes, questions about limitedLinear

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 10, 2015, 14:09 TVD schemes, questions about limitedLinear #1 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 76 Rep Power: 5 Sponsored Links I've been reading about the numerical schemes in OpenFOAM, and I found (perhaps) some divergence concerning the TVD schemes and Sweby limiters. In Dr. Jasak's thesis (pg 98), it says that: So for ψ = 1 we get a Higher Order scheme (central difference), while ψ = 0 we get Upwind. The thing is, at OpenFOAM's website (http://cfd.direct/openfoam/user-guid...20-1140004.4.5), it is said that "Some TVD/NVD schemes require a coefficient ψ,0 ≤ ψ ≤ 1 where ψ = 1 corresponds to TVD conformance, usually giving best convergence and ψ = 0 corresponds to best accuracy". But doesn't that mean that for ψ = 0 we get the higher order (more accurate) and ψ = 1 we get less accurate (Upwind)? And isn't it the opposite of what is written in Dr. Jasak's thesis? I expected that limitedLinear 0.5 would be the same as linearUpwind grad(U), but when I run the same case for these two schemes, the results are different. Also, as stated in this thread (http://www.cfd-online.com/Forums/ope...tedlinear.html), I thought that limitedLinear 0 would be equal to upwind and limitedLinear 1 would be equal to linear, but it is not the case. Did I understand thing in a wrong way, or is there an inconsistency? Also, should these schemes be indeed the same or not? Thanks in advance. Btw, sorry if this is posted in the wrong section of the forum. I saw that another similar thread was posted in this section, so I did the same. Last edited by davibarreira; October 11, 2015 at 10:15.

October 12, 2015, 09:12
#2
Senior Member

Join Date: Jun 2012
Location: Germany, Bochum
Posts: 146
Rep Power: 8
Quote:
 Originally Posted by davibarreira I've been reading about the numerical schemes in OpenFOAM, and I found (perhaps) some divergence concerning the TVD schemes and Sweby limiters. In Dr. Jasak's thesis (pg 98), it says that: So for ψ = 1 we get a Higher Order scheme (central difference), while ψ = 0 we get Upwind.
I can not really tell how it is implemented in OpenFOAM but I will try to have a look at it if I find the time.

If we use the equation of Jasak

We get Upwind for but we would not get the CDS for a value of . I think we would need a to get CDS using Jasak's equation.

In Versteeg and Malalasekra you will also find a section about TVD Schemes. Here the equation is:

Now, we would get a CDS for .

 October 12, 2015, 09:28 #3 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 76 Rep Power: 5 Indeed, I just checked Versteeg and Malalasekra, and it's like you said. Thanks for the correction. Although, the problem remains, cause using limitedLinear 0 and limitedLinear 1, none of them is equal to Upwind (when comparing the results of the simulations).

 October 13, 2015, 09:21 #4 Senior Member   Join Date: Jun 2012 Location: Germany, Bochum Posts: 146 Rep Power: 8 Just a bit more information and a correction. Jasak's equation is actually the same as Versteeg's equation. I understood Jasak's naming convention wrong in my last reply: Jasak: Using Versteeg's naming convention and assuming that we take CDS for as the higher-order scheme (HO) we get: If you insert these in the first equation you get exactly Versteeg's equation: Now my guess is that due to the implementation of the schemes in OpenFOAM the that the user can choose is different from the in the equations above. Thus making for example limitedLinear 0 not equal Upwind. davibarreira likes this. Last edited by Bazinga; October 13, 2015 at 12:36.

 October 13, 2015, 11:38 #5 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 76 Rep Power: 5 That's also what I thought, since the simulation results were not matching. I tried to take a look at the code, but couldn't understand it. The thing is, I'm using limitedLinear 1 for the convection term, but I dont know how appropriate it is, since I couldn't figure out the proper implementation of the limitedLinear scheme.

 October 14, 2015, 16:11 #6 New Member   Joseph Urich Join Date: Mar 2009 Location: Pittsburgh, PA Posts: 14 Rep Power: 10 limitedLinear is used in fvSchemes as Gauss limitedLinear k The value k you specify when activating the scheme is not the same as , as used in Jasak's thesis. What you get from limitedLinear is , with r as defined in Jasak's thesis, and limited between 0 and 1. See the discussion: http://www.cfd-online.com/Forums/ope...ar-scheme.html, and lines 76 and 95 of limitedLinear.H So if you use k = 0, will be fixed at 1.0, and you get the higher order scheme everywhere, in this case central differencing. If you use k = 1, you get a limiter of applied. This limiter is the edge of Sweby's TVD region; it is TVD conforming. That's why the documentation describes it that way. Bazinga, davibarreira and chengyu like this.

 October 14, 2015, 19:52 #7 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 76 Rep Power: 5 Thank you, Joseph. I read the thread and the code, and it is indeed as you pointed out. The only thing that I still dont get is why using Gauss linear is not giving me the same result as Gauss linearLimited 0, since both should be central diff. I will keep on digging, but thanks again for your info.

 October 18, 2015, 16:52 #8 New Member   Join Date: Jun 2015 Posts: 4 Rep Power: 4 Hello Joseph and Davi, I am also working with the limitedLinear scheme. I would be grateful if you could tell me if you agree with the following interpretation of the code. The limiter \Psi is defined in limitedLinear.H to have the following limits (line 95) 0<= \Psi = 2r/k <=1 where 0<=k<=1 is introduced by the user. Therefore, the limitedLinear scheme is a TVD scheme ONLY when the user chose k=1 (\Psi = 2r). When the user choose whatever other value for k, the scheme does not full-fill the TVD condition, because then \Psi > 2r. Then for k=1 the TVD condition is full-filled and stability is "assured" (within the limitations of the TVD schemes), but the accuracy depends on r. As r is a function of the gradients of \Psi it represents how convective the flow is. The more convection, the more upwinding is introduced and the accuracy decreases. For pure diffusive flows r=1 and the CD scheme is used, still fulfilling the TVD condition because k=1. Do you agree? Thank you very much! Ana Information about the TVD scheme can be found at Hrvoje Jasak PhD thesis. Regions for a TVD second order scheme:

 October 19, 2015, 13:08 #9 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 76 Rep Power: 5 Yes, Ana. I have pretty much the same interpretation. cabrera likes this.

 October 20, 2015, 10:04 #10 New Member   Joseph Urich Join Date: Mar 2009 Location: Pittsburgh, PA Posts: 14 Rep Power: 10 Hello Ana, I agree with your interpretation on TVD as well. However, r is calculated as the ratio of upwind gradient to downwind gradient. Scalar version is given starting at line 95 of NVDTVD.H. It divides the gradient at cell center projected to the face (d & gradcP) by the difference between cell value and neighbor value of phi ( phiN - phiP ). So it is calculated as a function of the local values of phi only. I don't think that's quite the same as your interpretation of diffusion vs. convective gradients. cabrera likes this.

October 22, 2015, 16:24
#11
Member

Eric Robertson
Join Date: Jul 2012
Posts: 95
Rep Power: 8
For what it's worth, I've studied the limitedLinear scheme in some detail for my Master's work. Important to me because it is my divergence scheme of choice for most OF simulations. I have some figures showing the behavior of several k values on a pure scalar convection problem.

Quote:
 Originally Posted by davibarreira The only thing that I still dont get is why using Gauss linear is not giving me the same result as Gauss linearLimited 0, since both should be central diff.
I see this reflected in my results, where setting k to zero or a really small value still does not recover central differencing. Maybe I am missing something in the explanations given here that would reveal why this is. If anyone is interested in my results, I can dig through some figures and post them.

 October 22, 2015, 16:42 #12 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 76 Rep Power: 5 Hey Eric, could you send a link to your Master thesis, so I can understand this scheme better.

October 23, 2015, 10:22
#13
Member

Eric Robertson
Join Date: Jul 2012
Posts: 95
Rep Power: 8
Quote:
 Originally Posted by davibarreira Hey Eric, could you send a link to your Master thesis, so I can understand this scheme better.

http://pqdtopen.proquest.com/doc/171...5.html?FMT=ABS

The scheme is only a minor part of the entire document, so I have included some supplemental figures as an attachment to this post, showing the setup of the test as well as some figures. I tested the convection of a step and a Gaussian profile. In the Gaussian, you can see that smaller values of k don't necessarily recover the original central difference (my nomenclature calls this UBCD).

I finished my Master's degree before I could dig any further. I believe I have also written a program to output the value of the Phi(r) limiter at every point based on its definition in the source code, which I will try to recover.
Attached Images
 scalar_conv.png (5.6 KB, 82 views) LL_Scheme_K.png (16.9 KB, 99 views) ll_vs_ubcd.png (22.9 KB, 104 views) gaussian_ll.PNG (20.1 KB, 99 views)

 October 27, 2015, 20:57 #14 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 76 Rep Power: 5 Great stuff, Eric. Havent finished, but it's already helping me. msuaeronautics likes this.

October 28, 2015, 12:31
#15
Member

Eric Robertson
Join Date: Jul 2012
Posts: 95
Rep Power: 8
Quote:
 Originally Posted by davibarreira Great stuff, Eric. Havent finished, but it's already helping me.
Good to know. If you have any questions, don't hesitate to send me a message.

 November 5, 2015, 09:09 #17 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 76 Rep Power: 5 As the error message says, the way you are writing the scheme is wrong. As you must know, there are several TVD schemes (TVD is more like a class of schemes), so you must choose one. Some of them are the vanLeer, UMIDST, SuperBee... The one I'm using is the limitedLinearV 1, which is discussed in this thread. But you may try the vanLeer, which is better documented. P.S: when you are using the divScheme of vectors, you might want to use vanLeerV, intead of vanLeer. vnarayana likes this.

 November 5, 2015, 14:32 for a lid driven cavity, how to use tvd/nvd schemes for divergence schemes #18 New Member   narayana vekamulla Join Date: Oct 2015 Posts: 15 Rep Power: 3 Thank you very much. UMIDST not working.

 November 5, 2015, 15:22 #19 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 76 Rep Power: 5 Sorry, UMIST.

 November 6, 2015, 03:17 for a lid driven cavity, how to use tvd/nvd schemes for divergence schemes #20 New Member   narayana vekamulla Join Date: Oct 2015 Posts: 15 Rep Power: 3 Thank you Davi Barreira, In NVD schemes, other than SFCD is there any other methods. Gamma and GammaV not working? would you please send theory on TVD/NVD schemes . where to get each method notes ? , how works in openfoam? Thanks & Regards narayan

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post chegdan OpenFOAM 16 October 13, 2015 03:59 aydemirk OpenFOAM Pre-Processing 1 August 20, 2014 04:26 Vino Main CFD Forum 3 September 16, 2013 19:47 Shuo Main CFD Forum 0 August 19, 2008 21:51 Matt Umbel Main CFD Forum 1 January 25, 2000 05:21