# k-epsilon implementation? (including volScalarField G)

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

 August 21, 2016, 11:24 k-epsilon implementation? (including volScalarField G) #1 Senior Member     Oskar Join Date: Nov 2015 Location: Poland Posts: 184 Rep Power: 10 Dear All. I'm using: engineFoam (xiFoam), openfoam 2.2.1. I'm trying to understand k-epsilon turbulence model in openFoam but I can't get through those k and epsilon equations. Let's focus on k equation: Code:  tmp kEqn ( fvm::ddt(rho_, k_) + fvm::div(phi_, k_) - fvm::laplacian(DkEff(), k_) == G - fvm::SuSp((2.0/3.0)*rho_*divU, k_) - fvm::Sp(rho_*epsilon_/k_, k_) ); I'm not sure if kEpsilon implements this equation but it looks similar: If that's true, then: fvm::ddt(rho_, k_) = fvm::div(phi_, k_) = fvm::laplacian(DkEff(), k_) = fvm::Sp(rho_*epsilon_/k_, k_) = Probably: - fvm::SuSp((2.0/3.0)*rho_*divU, k_) = and maybe this term is to remove trace but as long as I cant understand G, I can't go any further. Definition of G is Code:  volScalarField G(GName(), mut_*(tgradU() && dev(twoSymm(tgradU())))); and I don't know how to understand this. I can't figure out how: G - fvm::SuSp((2.0/3.0)*rho_*divU, k_) is equal to If someone can correct me or lead me to correct answer it would be great. Greetings to all. randolph, Cajal and pramodhkumaresh like this.

 August 23, 2016, 14:42 #2 Member   Darko Radenkovic Join Date: Oct 2015 Posts: 38 Rep Power: 10 Have a look here (page 123, at the top) http://www.tfd.chalmers.se/~lada/pos...-modelling.pdf About G: You need volScalarField to enter k equation. Regards, Darko sheaker likes this.

 August 24, 2016, 15:17 #3 Senior Member     Oskar Join Date: Nov 2015 Location: Poland Posts: 184 Rep Power: 10 Hello. Thank You for this pdf but I can't find full solution (exact implementation formula). According to my further research k-epsilon turbulent model is based on this report: "k-epsilon equation for compressible reciprocating engine flows", Journal of Energy, Vol. 7, No. 4 (1983), pp. 345-353. Unfortunately it is not free.

 August 25, 2016, 04:34 #4 Member   Darko Radenkovic Join Date: Oct 2015 Posts: 38 Rep Power: 10 Hello. Here is your paper. https://www.dropbox.com/s/iwnvw5om0b...48086.pdf?dl=0 About your first post, in exact k equation (have look here) https://en.wikipedia.org/wiki/Turbulence_kinetic_energy find production term. Insert Bussinesk assumption in that production term and you will get terms that you need. In the case of incompressible flow, is equal to zero. Best regards, Darko sheaker likes this.

 August 26, 2016, 08:12 #6 Member   Darko Radenkovic Join Date: Oct 2015 Posts: 38 Rep Power: 10 Book at this link has very good introduction part about tensors https://www.dropbox.com/s/72rz5760b3...ou%29.pdf?dl=0 Sooner or later, you will have to learn it, so it is better to start now. Pay attention to eq. 1.76, it will make things easier for you many times. If we use (1.148) from above book, it follows: tgradU() && dev(twoSymm(tgradU())) = Last term is equal to zero when flow is incompressible. It has been utilized that product of symmetric and asymmetric tensor is zero. Regards, Darko randolph and sheaker like this.

 August 26, 2016, 17:26 #7 Senior Member     Oskar Join Date: Nov 2015 Location: Poland Posts: 184 Rep Power: 10 Dear Darko. Thank You for a lot of patience to me. I forgot about splitting gradU into symmetric and antisymmetric parts. I understand that: (tgradU() && dev(twoSymm(tgradU())) = According to previous hints: should be equal to And I'm not sure about that. The first one is a scalar and it looks correct but I can't transform it to that second form. Darko, wish You best! Last edited by sheaker; August 27, 2016 at 04:32.

 August 27, 2016, 05:25 #8 Member   Darko Radenkovic Join Date: Oct 2015 Posts: 38 Rep Power: 10 I wasn't clear enough. is rate of strain tensor and from the above mentioned link from Chalmers, page 123, you can see that Term is not in your starting equation. When I think better from the very beginning we used assumption of incompressible flow through Bussinesq assumption - in the case of compressible flow, Bussinesq assumption is If you again insert Bussinesq assumption into production term of TKE, this forgotten term explains existence of in Openfoam implementation of k-epsilon. This agrees well with k equation of http://turbmodels.larc.nasa.gov/ke-chien.html Of course, in incompressible flow trace of rate of strain tensor is zero. Regards, Darko

 August 27, 2016, 09:07 #9 Senior Member     Oskar Join Date: Nov 2015 Location: Poland Posts: 184 Rep Power: 10 Thank You for Your help. I think I get it now. So the therm SHOULD exist in my TKE equation? And G(openFoam) = Production P = I think that is correct now. Kindest regards, Oskar randolph likes this.

 August 27, 2016, 11:46 #10 Member   Darko Radenkovic Join Date: Oct 2015 Posts: 38 Rep Power: 10 Couple hours ago I verified this on link in my above post (but now, at the moment of this writing, above link doesn't work). If you check eq. (24) and eq. (37) from paper "k-e Equation for Compressible Reciprocating Engine Flows", 1983, I believe you will see that is it. Regards, Darko sheaker likes this.

 May 22, 2018, 09:51 #11 Member   Sami Join Date: Nov 2012 Location: Cap Town, South Africa Posts: 87 Rep Power: 13 Hello all, Thank you for this very useful discussion. I'm using multiphaseEulerFoam (OFv4) to perform simulation of two-phase (gas dispersed in liquid) dispersed flow. To model turbulence, I used the k-epsilon model. The code has a little bit changed in version 4 (https://github.com/OpenFOAM/OpenFOAM...lon/kEpsilon.C) compared to what you shared in last posts. In OFv4, we have source terms "kSource()" and "epsilonSource()". My understanding is that they are used for bubble induced turbulence in the case of two-phase dispersed flow. Do you know how they are implemented and what is their exact definition? Thank you. mhrz

 March 22, 2019, 07:02 #12 Senior Member   Jianrui Zeng Join Date: May 2018 Location: China Posts: 157 Rep Power: 8 I am also interested in kSource（）and epsilonSource（). What is its function and meaning?

July 1, 2019, 18:29
#13
Senior Member

Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
They are used to modify the turbulence model, e.g. for buoyancy effects. See https://github.com/OpenFOAM/OpenFOAM...uoyantKEpsilon

This turbulence model inherits from the basic compressible k-epsilon turbulence model and overwrites those methods to implement the effect of buoyancy on turbulence.

Quote:
 Originally Posted by calf.Z I am also interested in kSource（）and epsilonSource（). What is its function and meaning?

May 20, 2021, 09:51
#14
New Member

Sourav Hossain
Join Date: Mar 2019
Posts: 25
Rep Power: 7
Quote:
 Originally Posted by dradenkovic Hello. Here is your paper. https://www.dropbox.com/s/iwnvw5om0b...48086.pdf?dl=0 About your first post, in exact k equation (have look here) https://en.wikipedia.org/wiki/Turbulence_kinetic_energy find production term. Insert Bussinesk assumption in that production term and you will get terms that you need. In the case of incompressible flow, is equal to zero. Best regards, Darko
Dear Sir, could you please upload the paper again? The link is showing that the paper is deleted.

May 20, 2021, 10:03
#15
New Member

Sourav Hossain
Join Date: Mar 2019
Posts: 25
Rep Power: 7
Quote:
 Originally Posted by sheaker Thank You for Your help. I think I get it now. So the therm SHOULD exist in my TKE equation? And G(openFoam) = Production P = I think that is correct now. Kindest regards, Oskar
Dear sir, Could you please share the paper and the book shared by Darko Radenkovi? The link is broken.

 April 6, 2022, 05:54 #16 New Member   Join Date: Jul 2017 Posts: 14 Rep Power: 8 Dear Sheaker Do you have any Idea about G? Here we have tmp kEqn ( fvm::ddt(alpha, rho, k_) + fvm::div(alphaRhoPhi, k_) - fvm::laplacian(alpha*rho*DkEff(), k_) == alpha*rho*G - fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_) - fvm::Sp(Ce(D, KK)*alpha*rho*sqrt(k_)/this->delta(), k_) + kSource() + fvModels.source(alpha, rho, k_) ); I have understood the term - fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_) but still this one is unclear: alpha*rho*G

April 6, 2022, 05:56
#17
New Member

Join Date: Jul 2017
Posts: 14
Rep Power: 8
Quote:
 Originally Posted by sheaker Thank You for Your help. I think I get it now. So the therm SHOULD exist in my TKE equation? And G(openFoam) = Production P = I think that is correct now. Kindest regards, Oskar
Dear Sheaker

Do you have any Idea about G?

Here we have
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(alpha, rho, k_)
+ fvm::div(alphaRhoPhi, k_)
- fvm::laplacian(alpha*rho*DkEff(), k_)
==
alpha*rho*G
- fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_)
- fvm::Sp(Ce(D, KK)*alpha*rho*sqrt(k_)/this->delta(), k_)
+ kSource()
+ fvModels.source(alpha, rho, k_)
);

I have understood the term - fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_)
but still this one is unclear:
alpha*rho*G

 May 31, 2022, 10:27 #18 Member   Join Date: Dec 2012 Posts: 33 Rep Power: 13 G refers to the production of the TKE. This is written out as: Code: nut*(tgradU() && dev(twoSymm(tgradU()))) which is essentially a double inner over gradU(j,i) and 2*S(i,j) - 2/3 S(k,k) \delta(i,j). The first term is the velocity gradient and the second term represents the model for the Reynolds stress less the nut, which is pre-multiplied. reverseila likes this.

 June 6, 2023, 19:41 #19 Senior Member     Alain Islas Join Date: Nov 2019 Location: Mexico Posts: 142 Rep Power: 6 Dear Sourav Hossain The book is "Papanastasiou, T., Georgiou, G., & Alexandrou, A. N. (2021). Viscous fluid flow. CRC press."