
[Sponsors] 
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 
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/userguid...201140004.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.cfdonline.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:
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 higherorder 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. 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.cfdonline.com/Forums/ope...arscheme.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. 

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 fullfill the TVD condition, because then \Psi > 2r. Then for k=1 the TVD condition is fullfilled 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.


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. 

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.
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:
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. 

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.


October 28, 2015, 12:31 

#15 
Member
Eric Robertson
Join Date: Jul 2012
Posts: 95
Rep Power: 8 

November 5, 2015, 09:03 
for a lid driven cavity, how to use tvd/nvd schemes for divergence schemes

#16 
New Member
narayana vekamulla
Join Date: Oct 2015
Posts: 15
Rep Power: 3 
Hello every one,
how to apply TVD/NVD schmes for divergence schmes . i tried the following. in fvSchmes subfolder changed divSchemes { default none; div(phi,U) Gauss NVD schemes; } when i am running by using the command icoFoam i got the following error narayana@narayanaLenovoG5080 ~/OpenFOAM/narayana2.4.0/run/tutorials/incompressible/icoFoam/cavity_nvd $ icoFoam/**\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 2.4.0   \\ / A nd  Web: www.OpenFOAM.org   \\/ M anipulation   \**/ Build : 2.4.0f0842aea0e77 Exec : icoFoam Date : Nov 06 2015 Time : 05:55:30 Host : "narayanaLenovoG5080" PID : 5304 Case : /home/narayana/OpenFOAM/narayana2.4.0/run/tutorials/incompressible/icoFoam/cavity_nvd nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring runtime modified files using timeStampMaster allowSystemOperations : Allowing usersupplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading transportProperties Reading field p Reading field U Reading/calculating face flux field phi Starting time loop Time = 0.0025 Courant Number mean: 0 max: 0 > FOAM FATAL IO ERROR: Unknown discretisation scheme TVD Valid schemes are : 60 ( CoBlended Gamma GammaV LUST MUSCL MUSCLV Minmod MinmodV OSPRE OSPREV Phi QUICK QUICKV SFCD SFCDV SuperBee SuperBeeV UMIST UMISTV biLinearFit blended clippedLinear cubic cubicUpwindFit downwind filteredLinear filteredLinear2 filteredLinear2V filteredLinear3 filteredLinear3V fixedBlended limitWith limitedCubic limitedCubicV limitedLinear limitedLinearV limiterBlended linear linearFit linearPureUpwindFit linearUpwind linearUpwindV localBlended localMax localMin midPoint outletStabilised pointLinear quadraticFit quadraticLinearFit quadraticLinearUpwindFit quadraticUpwindFit reverseLinear skewCorrected upwind vanAlbada vanAlbadaV vanLeer vanLeerV weighted ) file: /home/narayana/OpenFOAM/narayana2.4.0/run/tutorials/incompressible/icoFoam/cavity_nvd/system/fvSchemes.divSchemes.div(phi,U) at line 32. From function surfaceInterpolationScheme<Type>::New(const fvMesh&, const surfaceScalarField&, Istream&) in file lnInclude/surfaceInterpolationScheme.C at line 137. FOAM exiting I got answers for upwind,quikc schmes but not TVD/NVD i tried but i could not get it. please help me . 

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. 

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  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
A few simple questions about linearUpwind and limitedLinear  chegdan  OpenFOAM  16  October 13, 2015 03:59 
Using TVD Schemes in fvScheme  aydemirk  OpenFOAM PreProcessing  1  August 20, 2014 04:26 
TVD schemes  Vino  Main CFD Forum  3  September 16, 2013 19:47 
TVD schemes: 2 questions  Shuo  Main CFD Forum  0  August 19, 2008 21:51 
TVD Schemes  Matt Umbel  Main CFD Forum  1  January 25, 2000 05:21 