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

TVD schemes, questions about limitedLinear

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

Like Tree10Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   October 10, 2015, 14:09
Default TVD schemes, questions about limitedLinear
  #1
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 67
Rep Power: 3
davibarreira is on a distinguished road
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:
\phi_f=\phi_{UD}+\psi(\phi_{HO}-\phi_{UD})

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 (A few simple questions about linearUpwind and limitedLinear), 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.
davibarreira is offline   Reply With Quote

Old   October 12, 2015, 09:12
Default
  #2
Member
 
Join Date: Jun 2012
Posts: 68
Rep Power: 5
Bazinga is on a distinguished road
Quote:
Originally Posted by davibarreira View Post
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:
\phi_f=\phi_{UD}+\psi(\phi_{HO}-\phi_{UD})

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
\phi_f=\phi_{UD}+\psi(\phi_{HO}-\phi_{UD})
We get Upwind for \psi= 0 but we would not get the CDS for a value of \psi= 1. I think we would need a \psi= 0.5 to get CDS using Jasak's equation.

In Versteeg and Malalasekra you will also find a section about TVD Schemes. Here the equation is:
\phi_e=\phi_{P}+\frac{1}{2}\psi(\phi_{E}-\phi_{P})
Now, we would get a CDS for \psi= 1.
davibarreira likes this.
Bazinga is offline   Reply With Quote

Old   October 12, 2015, 09:28
Default
  #3
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 67
Rep Power: 3
davibarreira is on a distinguished road
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).
davibarreira is offline   Reply With Quote

Old   October 13, 2015, 09:21
Default
  #4
Member
 
Join Date: Jun 2012
Posts: 68
Rep Power: 5
Bazinga is on a distinguished road
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:
\phi_f=\phi_{UD}+\psi(\phi_{HO}-\phi_{UD})
Using Versteeg's naming convention and assuming that we take CDS for as the higher-order scheme (HO) we get:
\phi_f = \phi_e \; and \; \phi_{UD}=\phi_P \; and \; \phi_{HO} = \frac{\phi_P+ \phi_E}{2}
If you insert these in the first equation you get exactly Versteeg's equation:
\phi_e=\phi_{P}+\frac{1}{2}\psi(\phi_{E}-\phi_{P})

Now my guess is that due to the implementation of the schemes in OpenFOAM the \psi that the user can choose is different from the \psi 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.
Bazinga is offline   Reply With Quote

Old   October 13, 2015, 11:38
Default
  #5
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 67
Rep Power: 3
davibarreira is on a distinguished road
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.
davibarreira is offline   Reply With Quote

Old   October 14, 2015, 16:11
Default
  #6
New Member
 
Joseph Urich
Join Date: Mar 2009
Location: Pittsburgh, PA
Posts: 12
Rep Power: 8
jurich is on a distinguished road
limitedLinear is used in fvSchemes as Gauss limitedLinear k

The value k you specify when activating the scheme is not the same as \psi, as used in Jasak's thesis.

What you get from limitedLinear is \psi(r) = r * \frac{2}{k}, with r as defined in Jasak's thesis, and \psi limited between 0 and 1.

See the discussion: References for the limitedLinear scheme, and lines 76 and 95 of limitedLinear.H

So if you use k = 0, \psi 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 \psi(r) = 2 * r 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 and davibarreira like this.
jurich is offline   Reply With Quote

Old   October 14, 2015, 19:52
Default
  #7
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 67
Rep Power: 3
davibarreira is on a distinguished road
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.
davibarreira is offline   Reply With Quote

Old   October 18, 2015, 16:52
Default
  #8
New Member
 
Join Date: Jun 2015
Posts: 4
Rep Power: 2
cabrera is on a distinguished road
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:
cabrera is offline   Reply With Quote

Old   October 19, 2015, 13:08
Default
  #9
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 67
Rep Power: 3
davibarreira is on a distinguished road
Yes, Ana. I have pretty much the same interpretation.
cabrera likes this.
davibarreira is offline   Reply With Quote

Old   October 20, 2015, 10:04
Default
  #10
New Member
 
Joseph Urich
Join Date: Mar 2009
Location: Pittsburgh, PA
Posts: 12
Rep Power: 8
jurich is on a distinguished road
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.
jurich is offline   Reply With Quote

Old   October 22, 2015, 16:24
Default
  #11
Member
 
Eric R
Join Date: Jul 2012
Posts: 83
Rep Power: 5
msuaeronautics is on a distinguished road
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 View Post
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.
davibarreira likes this.
msuaeronautics is offline   Reply With Quote

Old   October 22, 2015, 16:42
Default
  #12
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 67
Rep Power: 3
davibarreira is on a distinguished road
Hey Eric, could you send a link to your Master thesis, so I can understand this scheme better.
davibarreira is offline   Reply With Quote

Old   October 23, 2015, 10:22
Default
  #13
Member
 
Eric R
Join Date: Jul 2012
Posts: 83
Rep Power: 5
msuaeronautics is on a distinguished road
Quote:
Originally Posted by davibarreira View Post
Hey Eric, could you send a link to your Master thesis, so I can understand this scheme better.
Here is the link.

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
File Type: png scalar_conv.png (5.6 KB, 32 views)
File Type: png LL_Scheme_K.png (16.9 KB, 39 views)
File Type: png ll_vs_ubcd.png (22.9 KB, 39 views)
File Type: png gaussian_ll.PNG (20.1 KB, 36 views)
davibarreira likes this.
msuaeronautics is offline   Reply With Quote

Old   October 27, 2015, 20:57
Default
  #14
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 67
Rep Power: 3
davibarreira is on a distinguished road
Great stuff, Eric. Havent finished, but it's already helping me.
msuaeronautics likes this.
davibarreira is offline   Reply With Quote

Old   October 28, 2015, 12:31
Default
  #15
Member
 
Eric R
Join Date: Jul 2012
Posts: 83
Rep Power: 5
msuaeronautics is on a distinguished road
Quote:
Originally Posted by davibarreira View Post
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.
msuaeronautics is offline   Reply With Quote

Old   November 5, 2015, 09:03
Question for a lid driven cavity, how to use tvd/nvd schemes for divergence schemes
  #16
New Member
 
narayana vekamulla
Join Date: Oct 2015
Posts: 4
Rep Power: 2
vnarayana is on a distinguished road
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@narayana-Lenovo-G50-80 ~/OpenFOAM/narayana-2.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.0-f0842aea0e77
Exec : icoFoam
Date : Nov 06 2015
Time : 05:55:30
Host : "narayana-Lenovo-G50-80"
PID : 5304
Case : /home/narayana/OpenFOAM/narayana-2.4.0/run/tutorials/incompressible/icoFoam/cavity_nvd
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied 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/narayana-2.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 .
vnarayana is offline   Reply With Quote

Old   November 5, 2015, 09:09
Default
  #17
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 67
Rep Power: 3
davibarreira is on a distinguished road
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.
davibarreira is offline   Reply With Quote

Old   November 5, 2015, 14:32
Cool for a lid driven cavity, how to use tvd/nvd schemes for divergence schemes
  #18
New Member
 
narayana vekamulla
Join Date: Oct 2015
Posts: 4
Rep Power: 2
vnarayana is on a distinguished road
Thank you very much. UMIDST not working.
vnarayana is offline   Reply With Quote

Old   November 5, 2015, 15:22
Default
  #19
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 67
Rep Power: 3
davibarreira is on a distinguished road
Sorry, UMIST.
davibarreira is offline   Reply With Quote

Old   November 6, 2015, 03:17
Smile for a lid driven cavity, how to use tvd/nvd schemes for divergence schemes
  #20
New Member
 
narayana vekamulla
Join Date: Oct 2015
Posts: 4
Rep Power: 2
vnarayana is on a distinguished road
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

vnarayana is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


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 Pre-Processing 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


All times are GMT -4. The time now is 14:35.