CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Nvd / tvd

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By santiagomarquezd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 7, 2011, 12:19
Default Nvd / tvd
  #1
New Member
 
Michael Buchmayr
Join Date: Mar 2010
Posts: 16
Rep Power: 16
MichiB is on a distinguished road
Hi,

I was wondering if there is a major difference in the implementation of NVD and TVD schemes in OpenFOAM.
Am I right in the assumption that the only real difference between NVD and TVD schemes in OpenFOAM is the limiters?
Is it right that in OpenFOAM TVD schemes are actually nothing but special NVD schemes?

I'm having a hard time grasping how convection schemes are implemented in OpenFOAM, but as far as I understand the code, both NVD and TVD should work identically up to the point where phict ( \Tilde{ phi_{C} } ) is being calculated.

The reason why I'm asking this is that I'd like to know how the van Leer TVD (or is it NVD?) scheme works and effects the diagonal dominance of my matrix...

Michi
MichiB is offline   Reply With Quote

Old   October 7, 2011, 17:30
Default
  #2
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
Michael take a look to the document in the following link:

https://docs.google.com/viewer?a=v&p...ht7iRTTn&hl=es

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   October 10, 2011, 06:39
Default
  #3
New Member
 
Michael Buchmayr
Join Date: Mar 2010
Posts: 16
Rep Power: 16
MichiB is on a distinguished road
Thank you for the nice summery, Santiago. Te lo agradezco mucho!
It seems that I was wrong and TVD schemes in OpenFOAM do calculate r and not phict as I thought before.
Regards,
Michi
MichiB is offline   Reply With Quote

Old   October 30, 2015, 04:07
Default
  #4
Member
 
J.-H. Wang
Join Date: Oct 2010
Posts: 72
Rep Power: 16
f0208secretx is on a distinguished road
I have a particular question about Van Leer limiter implementation in OpenFOAM 2.4.0.

I used it to limit my divergence term by the following excerpt in fvSchemes
Code:
divSchemes
{
    default             Gauss linear;
    div(phi,U)          Gauss vanLeerV 2;
    div(phi,nuTilda)    Gauss limitedLinear 1;

}
The documentation here (http://cfd.direct/openfoam/user-guide/fvschemes/) suggested that the Van Leer limiter can be strictly bounded for scalar field. However, since I used it on U, I chose the multivariate van Leer and give it sort of an arbitrary number 2. The number 2 seems to do something, since if I don't specify this number then my solution could diverge. However, if one look into the code vanLeer.H, there does not seem to be a place for this number I specified:
Code:
  
(vanLeer.H)  
    vanLeerLimiter(Istream&)
    {}

    scalar limiter
    (
        const scalar,
        const scalar faceFlux,
        const typename LimiterFunc::phiType& phiP,
        const typename LimiterFunc::phiType& phiN,
        const typename LimiterFunc::gradPhiType& gradcP,
        const typename LimiterFunc::gradPhiType& gradcN,
        const vector& d
    ) const
    {
        scalar r = LimiterFunc::r
        (
            faceFlux, phiP, phiN, gradcP, gradcN, d
        );

        return (r + mag(r))/(1 + mag(r));
    }
Specifically, the red line seemed to suggest the in stream does not do anything. Whereas if one look into limitedLinear.H
Code:
(limtedLinear.H)
    limitedLinearLimiter(Istream& is)
    :
        k_(readScalar(is))
    {
        if (k_ < 0 || k_ > 1)
        {
            FatalIOErrorIn("limitedLinearLimiter(Istream& is)", is)
                << "coefficient = " << k_
                << " should be >= 0 and <= 1"
                << exit(FatalIOError);
        }

        // Avoid the /0 when k_ = 0
        twoByk_ = 2.0/max(k_, SMALL);
    }

    scalar limiter
    (
        const scalar cdWeight,
        const scalar faceFlux,
        const typename LimiterFunc::phiType& phiP,
        const typename LimiterFunc::phiType& phiN,
        const typename LimiterFunc::gradPhiType& gradcP,
        const typename LimiterFunc::gradPhiType& gradcN,
        const vector& d
    ) const
    {
        scalar r = LimiterFunc::r
        (
            faceFlux, phiP, phiN, gradcP, gradcN, d
        );

        return max(min(twoByk_*r, 1), 0);
    }
The instream was used and a blending factor was considered (bounded between 0 and 1).

I am very confused now if van leer takes any argument and how do I specify it? Further, if I specify a strict bound, how can one choose such a number... it does not make sense to me that one could set an absolute bound before solving the system, otherwise why do you need the solver for...
f0208secretx is offline   Reply With Quote

Old   October 31, 2015, 17:12
Default
  #5
Member
 
J.-H. Wang
Join Date: Oct 2010
Posts: 72
Rep Power: 16
f0208secretx is on a distinguished road
any ideas?
f0208secretx is offline   Reply With Quote

Old   November 5, 2015, 09:18
Default
  #6
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 76
Rep Power: 12
davibarreira is on a distinguished road
Why are you trying to bound the U (velocity)? The use of bounded values with vanLeer is usually for scalars who have limited values, such as volume fraction that has to be between 0 and 1. For vectors, you are using vanLeerV, so I would guess that it makes no sense to prescribe a limiter such as 2, and for such reason it does nothing.
davibarreira is offline   Reply With Quote

Old   June 2, 2021, 05:54
Default
  #7
New Member
 
Youjiang Wang
Join Date: Apr 2015
Location: Hamburg
Posts: 22
Rep Power: 11
wyj216 is on a distinguished road
By reading the code, I have no problem to understand the implementation of TVD. However, for the NVD, e.g. Gamma scheme, it seems that the limiter for phict > 1 is not correct. When phict > 1, upwind should be used, which means the limiter should be 0. But the code would gave a limiter having value of 1. Does anyone have the same confusion?

Code:
//position: src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/Gamma/Gamma.H
scalar limiter
     (
         const scalar cdWeight,
         const scalar faceFlux,
         const typename LimiterFunc::phiType& phiP,
         const typename LimiterFunc::phiType& phiN,
         const typename LimiterFunc::gradPhiType& gradcP,
         const typename LimiterFunc::gradPhiType& gradcN,
         const vector& d
     ) const
     {
         scalar phict = LimiterFunc::phict
         (
             faceFlux, phiP, phiN, gradcP, gradcN, d
         );
  
         return min(max(phict/k_, 0), 1);
     }
wyj216 is offline   Reply With Quote

Old   June 6, 2021, 16:19
Default
  #8
s.v
New Member
 
s.v
Join Date: Jun 2021
Posts: 13
Rep Power: 5
s.v is on a distinguished road
Hi Youjiang:

Few years ago I looked a little bit at some OpenFOAM convection schemes and I think the Gamma scheme implementation is bugged in OpenFOAM (atleast it was in the version I was using).

I do not remember all the details of my work at this point -- but I do talk about a bug in the Gamma scheme in my PhD thesis "A LARGE EDDY SIMULATION STUDY OF THE EFFECTS OF WIND AND SLOPE ON THE STRUCTURE OF A TURBULENT LINE FIRE" (it can be downloaded from here: https://drum.lib.umd.edu/handle/1903/21883) -- please see pages 31 and 32 in my thesis -- I think I am talking about the same issue that you are mentioning in your post.

There is more information about convection schemes in my thesis that you might find interesting -- for example the Gamma and the limitedLinear schemes are practically identical at lower values of k (see Figure 2.10 in my thesis), the limitedLinear scheme is incorrectly described on the NVD diagram in the OpenFOAM documentation (see Figure 2.8 in my thesis).

I am thinking maybe I should create a small post here on cfd-online and summarize my work on OpenFOAM convection schemes -- that might be useful for other OpenFOAM users. I think my thesis goes a little bit beyond this very helpful OpenFOAM based book by Moukalled et al. https://www.springer.com/gp/book/9783319168739, in terms of OpenFOAM convection schemes.

I hope it helps a little bit.

Cheers ....

Last edited by s.v; June 6, 2021 at 16:36. Reason: typo
s.v is offline   Reply With Quote

Old   July 21, 2021, 06:27
Default
  #9
New Member
 
Youjiang Wang
Join Date: Apr 2015
Location: Hamburg
Posts: 22
Rep Power: 11
wyj216 is on a distinguished road
Quote:
Originally Posted by s.v View Post
Hi Youjiang:

Few years ago I looked a little bit at some OpenFOAM convection schemes and I think the Gamma scheme implementation is bugged in OpenFOAM (atleast it was in the version I was using).

I do not remember all the details of my work at this point -- but I do talk about a bug in the Gamma scheme in my PhD thesis "A LARGE EDDY SIMULATION STUDY OF THE EFFECTS OF WIND AND SLOPE ON THE STRUCTURE OF A TURBULENT LINE FIRE" (it can be downloaded from here: https://drum.lib.umd.edu/handle/1903/21883) -- please see pages 31 and 32 in my thesis -- I think I am talking about the same issue that you are mentioning in your post.

There is more information about convection schemes in my thesis that you might find interesting -- for example the Gamma and the limitedLinear schemes are practically identical at lower values of k (see Figure 2.10 in my thesis), the limitedLinear scheme is incorrectly described on the NVD diagram in the OpenFOAM documentation (see Figure 2.8 in my thesis).

I am thinking maybe I should create a small post here on cfd-online and summarize my work on OpenFOAM convection schemes -- that might be useful for other OpenFOAM users. I think my thesis goes a little bit beyond this very helpful OpenFOAM based book by Moukalled et al. https://www.springer.com/gp/book/9783319168739, in terms of OpenFOAM convection schemes.

I hope it helps a little bit.

Cheers ....
Thanks for your reply, salman, I would have a look at your thesis. It seems that it will help a lot.
wyj216 is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interpolation in OpenFoam srinath OpenFOAM Programming & Development 7 June 6, 2021 16:52
TVD ... Questioner Main CFD Forum 1 June 7, 2006 09:54
4th and 5th Order TVD Runge-Kutta Methods saygin Main CFD Forum 2 January 30, 2006 12:45
TVD TVD Main CFD Forum 0 November 17, 2005 12:25
TVD Schemes Matt Umbel Main CFD Forum 1 January 25, 2000 05:21


All times are GMT -4. The time now is 16:54.