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

Convectional term -fvm::Sp(fvc::div(phi_), epsilon_) in RNGkEpsilon OF 1.7.1 missing

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

Like Tree3Likes
  • 1 Post By makaveli_lcf
  • 1 Post By alberto
  • 1 Post By makaveli_lcf

Reply
 
LinkBack Thread Tools Display Modes
Old   May 25, 2011, 11:56
Default Convectional term -fvm::Sp(fvc::div(phi_), epsilon_) in RNGkEpsilon OF 1.7.1 missing
  #1
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 213
Rep Power: 10
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Hi!

I have a quistion: why this terms are missing in RNGkEpsilon model in epsilon and k equations?

Code:
        fvm::ddt(epsilon_)
      + fvm::div(phi_, epsilon_)
      - fvm::Sp(fvc::div(phi_), epsilon_)
      - fvm::laplacian(DepsilonEff(), epsilon_)
...

        fvm::ddt(k_)
      + fvm::div(phi_, k_)
      - fvm::Sp(fvc::div(phi_), k_)
      - fvm::laplacian(DkEff(), k_)
... and special thanks to Prof. Jasak, I'am using his updated version with
the

Code:
      + fvm::SuSp(-fvc::div(phi_), epsilon_)
...
      + fvm::SuSp(-fvc::div(phi_), k_)
which helps to reduce error due to the non-orthgonality.
Only one remark: why there is no such treatment for kEpsilon model in OF-1.6-ext (in kEpsilon.C)?

BTW the residuals normalization used now in OF is not appropriated, because it is connected with the source term and for the turbulent transport equations produces under-estimated residuals level.

Regards,
Alexander
Tushar@cfd likes this.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Advanced Process Simulation of
Solidification and Melting"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

Franz-Josef-Str. 18
A - 8700 Leoben
Österreich / Austria
Tel.: +43 3842 - 402 - 3125
http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   May 26, 2011, 02:35
Default
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by makaveli_lcf View Post
Hi!

I have a quistion: why this terms are missing in RNGkEpsilon model in epsilon and k equations?

Code:
        fvm::ddt(epsilon_)
      + fvm::div(phi_, epsilon_)
      - fvm::Sp(fvc::div(phi_), epsilon_)
      - fvm::laplacian(DepsilonEff(), epsilon_)
...

        fvm::ddt(k_)
      + fvm::div(phi_, k_)
      - fvm::Sp(fvc::div(phi_), k_)
      - fvm::laplacian(DkEff(), k_)
The code currently in 1.7.x looks consistent with the standard form of the incompressible RNG k-epsilon model. Why should that term be there?

It seems you are trying to treat the convective term in non-conservative form (why?). If you think to:

div(kU) = U . grad(k) + k div(U),

you are discretizing U . grad(k), since you have the full convective term in conservative form at the line

fvm::div(phi_, epsilon_)

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods

Last edited by alberto; May 26, 2011 at 10:08.
alberto is offline   Reply With Quote

Old   May 26, 2011, 05:14
Default
  #3
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 213
Rep Power: 10
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
... I ask because IT IS, for example, in realizableKE (incompressible) in OF 1.7.1:

Code:
    // Dissipation equation
    tmp<fvScalarMatrix> epsEqn
    (
        fvm::ddt(epsilon_)
      + fvm::div(phi_, epsilon_)
      - fvm::Sp(fvc::div(phi_), epsilon_)
      - fvm::laplacian(DepsilonEff(), epsilon_)
     ==
        C1*magS*epsilon_
      - fvm::Sp
        (
            C2_*epsilon_/(k_ + sqrt(nu()*epsilon_)),
            epsilon_
        )
    );

...

    // Turbulent kinetic energy equation
    tmp<fvScalarMatrix> kEqn
    (
        fvm::ddt(k_)
      + fvm::div(phi_, k_)
      - fvm::Sp(fvc::div(phi_), k_)
      - fvm::laplacian(DkEff(), k_)
     ==
        G - fvm::Sp(epsilon_/k_, k_)
    );
as well as in standard k-epsilon, and also in kOmegaSST...


Heh..., it is funny, the flux phi is divergence free... So why is it included?

div(UK) k = U grad(k) + k div(U) = U grad(k)

for incompressible liquid. That is well known transition between conservative and non-conservatives forms of the convectional term.

Alberto, I am sorry, but would you be kind to clarify: is convectional term in RNG somehow different from those in standard and realizable k-epsilon?
And are you tallking about 1.7.x, which is not 1.7.1? Do you mean some development version?
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Advanced Process Simulation of
Solidification and Melting"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

Franz-Josef-Str. 18
A - 8700 Leoben
Österreich / Austria
Tel.: +43 3842 - 402 - 3125
http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   May 26, 2011, 05:36
Default
  #4
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 213
Rep Power: 10
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
So I agree with Alberto,
that U*grad(k) or U*grad(epsilon) or U*grad(omega) are discretized.

Hmm..., why? Is it some error?

For example, standard k-epsilon, transport of kinetic energy is:

dk/dt + div(U K) = div(D_k grad(k)) + G - epsilon

There is no terms, from which we can get U*grad(k).

Any comments?


To avoid miss-understanding:

I am not trying to put "div(U*k) - k*div(U) = U*grad(k)" in the OF source code, it is all already there)))


I only noticed the difference between approaches how convectional term is discretized in RNGkEpsilon.C and in other incompressible RAS models. I recognized it while modifying RAS models for my solidification part.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Advanced Process Simulation of
Solidification and Melting"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

Franz-Josef-Str. 18
A - 8700 Leoben
Österreich / Austria
Tel.: +43 3842 - 402 - 3125
http://smmp.unileoben.ac.at

Last edited by makaveli_lcf; May 26, 2011 at 09:49. Reason: To clarify the question.
makaveli_lcf is offline   Reply With Quote

Old   May 26, 2011, 10:15
Default
  #5
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Hi,

Quote:
Originally Posted by makaveli_lcf View Post
So I agree with Alberto,
that U*grad(k) or U*grad(epsilon) or U*grad(omega) are discretized.

Hmm..., why? Is it some error?

For example, standard k-epsilon, transport of kinetic energy is:

dk/dt + div(U K) = div(D_k grad(k)) + G - epsilon

There is no terms, from which we can get U*grad(k).

Any comments?
well, as you noticed, div(U), which in OpenFOAM is div(phi), is zero.
As a consequence, they are implementing U . grad(k) = div(U, k) - k div(U), to avoid using U & grad(k), and use the conservative flux.

What is not clear to me is why not implementing directly div(phi, k), as in the original equation from the literature?
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   May 26, 2011, 11:04
Default
  #6
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 213
Rep Power: 10
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Sometimes for the discretization (e.g. for the finite differences method) it is easier to use nonconservative form of the convectional term

div(U*k) = k*div(U)+U & grad(k)

But here we get the wrong term. So I will try direct conservative form and compare the results.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Advanced Process Simulation of
Solidification and Melting"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

Franz-Josef-Str. 18
A - 8700 Leoben
Österreich / Austria
Tel.: +43 3842 - 402 - 3125
http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   May 26, 2011, 11:25
Default
  #7
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by makaveli_lcf View Post
Sometimes for the discretization (e.g. for the finite differences method) it is easier to use nonconservative form of the convectional term

div(U*k) = k*div(U)+U & grad(k)
Yes, and I do not like using the non-conservative form, if not strictly necessary.

Quote:
But here we get the wrong term. So I will try direct conservative form and compare the results.
If you consider div(U) = 0, the terms they have are identical, since

div(U*k) = U & grad(k)

if div(U) = 0. Now, since numerically it is not exactly zero, they probably enforce the "incompressible form" by using the term

U & grad(k) = div(U*k) - k*div(U)

This in OpenFOAM becomes

fmv::div(phi, k) - fvm::Sp(fvc::div(phi), k),

since using phi and not U does not introduce errors, being phi corrected to enforce conservation after solving for p.
sharonyue likes this.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods

Last edited by alberto; May 26, 2011 at 11:28. Reason: typo and note
alberto is offline   Reply With Quote

Old   May 26, 2011, 16:14
Default
  #8
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 213
Rep Power: 10
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Alberto, thanks! I got it:

Code:
U = U* + delta
U* = U - delta
U* - exact solution, delta - error vector

div(U*) = 0                                               (1)
div(U) = div(U*) + div(delta) = div(delta)        (2)
So if we would get the exact solution, it should be:
Code:
div(U*.k) = U*&grad(k)
Now we estimate an calculation error:
Code:
Err1 = div(U.k) - U*&grad(k) 
      = k.div(U*) + U*&grad(k) + k.div(delta) + delta&grad(k) - U*&grad(k)
From (1) and (2)
Code:
Err1 = k.div(delta) + delta&grad(k) = k.div(U) + delta&grad(k)
So, performing
div(U.k) - k.div(U) we reduce the calculation error to the delta&grad(k)

)))

I am curious, does it worth to use such approach for other scalar equations? E.g. for heat transfer... It would be really nice to here some comment from developers, why they decided to use this method for the turbulence modeling?
lakeat likes this.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Advanced Process Simulation of
Solidification and Melting"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

Franz-Josef-Str. 18
A - 8700 Leoben
Österreich / Austria
Tel.: +43 3842 - 402 - 3125
http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   July 19, 2012, 11:53
Default
  #9
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: South Bend, IN, USA
Posts: 688
Blog Entries: 9
Rep Power: 12
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
I have the same questions, I feel very confused:

1. Is using "fvm::SuSp(-fvc::div(phi_), epsilon_)" better using "- fvm::Sp(fvc::div(phi_), epsilon_)"?
2. For other transport equations, should we use this approach? Why it is commented out from RNG k-epsilon?
__________________
~
Daniel WEI
-------------
NatHaz Modeling Laboratory
Department of Civil & Environmental Engineering & Earth Sciences
University of Notre Dame, USA
Email || My Personal CFD Blog
lakeat is offline   Reply With Quote

Old   July 20, 2012, 03:24
Default
  #10
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 213
Rep Power: 10
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Hi Daniel!

1. Using SuSp operator is to increase matrix diagonal influence. With Sp operator it goes always to the diagonal and can reduce diagonal elements which makes its solution more problematic for the linear solver.

2. If you check OpenFOAM-ext such approach is used in all RANS model (*reffering to the source code.... yap! it's there!).

I am just using it for RANS models and for energy equation as well. But I did not make any test if it is better for the scalar equation in general. Let's do it!
What are your suggestions for the benchmark? It should be some simple case...
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Advanced Process Simulation of
Solidification and Melting"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

Franz-Josef-Str. 18
A - 8700 Leoben
Österreich / Austria
Tel.: +43 3842 - 402 - 3125
http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   July 20, 2012, 10:42
Default
  #11
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: South Bend, IN, USA
Posts: 688
Blog Entries: 9
Rep Power: 12
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
pitzDaily maybe or other BFS flow?
__________________
~
Daniel WEI
-------------
NatHaz Modeling Laboratory
Department of Civil & Environmental Engineering & Earth Sciences
University of Notre Dame, USA
Email || My Personal CFD Blog
lakeat is offline   Reply With Quote

Old   July 20, 2012, 11:06
Default
  #12
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: South Bend, IN, USA
Posts: 688
Blog Entries: 9
Rep Power: 12
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
Hmm, Two more questions,

1. When to use source term explicitly and when shall one use it implicitly using Sp or Susp?

2. In ke formulation, why epsilon is solved first instead of k?

Thanks
__________________
~
Daniel WEI
-------------
NatHaz Modeling Laboratory
Department of Civil & Environmental Engineering & Earth Sciences
University of Notre Dame, USA
Email || My Personal CFD Blog
lakeat 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
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 13 November 4, 2013 15:13
Missing Term in RAS-Models ngj OpenFOAM Bugs 17 February 29, 2012 08:05
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 1 November 25, 2008 21:21
bouyancy term in epsilon equation Michael Main CFD Forum 1 June 25, 1999 10:20


All times are GMT -4. The time now is 01:59.