CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How to? Extra term in k-e equation. Implicit-Explicit (https://www.cfd-online.com/Forums/openfoam-programming-development/114679-how-extra-term-k-e-equation-implicit-explicit.html)

be_inspired March 15, 2013 08:48

How to? Extra term in k-e equation. Implicit-Explicit
 
Hi all,

I am trying to implement a canopy model into OF.
With respect to the momentum equation, I am seeing several post where the code was similar to the following one:
Quote:

// Solve the Momentum equation
UEqn() == -fvc::grad(p)-fvm::Sp(mag(fvc::Sp(Cd*canopydensity*canopyleaf,U) ),U)
The point is when I need to implement the extra terms in k and epsilon equation.
I have introduced the following ones:
Quote:

// Turbulent kinetic energy equation

volScalarField Fk=0.8*canopydensity_*canopyleaf_*mag(U_)*mag(U_)* mag(U_);
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(k_)
+ fvm::div(phi_, k_)
+ fvm::SuSp(-fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G
- fvm::Sp(epsilon_/k_, k_) + Fk

// Dissipation equation
volScalarField Fe=(epsilon_/k_)*Cpepsilon1_*Fk;
tmp<fvScalarMatrix> epsEqn
(
fvm::ddt(epsilon_)
+ fvm::div(phi_, epsilon_)
+ fvm::SuSp(-fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
C1_*G*epsilon_/k_
- fvm::Sp(C2_*epsilon_/k_, epsilon_) + Fe
It compiles correctly and I obtain some physical results, but I have just found a master thesis where:

Quote:

// Dissipation equation
tmp<fvScalarMatrix> epsEqn
(
fvm::ddt(epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
C1_*G*epsilon_/k_
- fvm::Sp(C2_*epsilon_/k_, epsilon_)
+ fvm::Sp(Cd_*alphaL_/k_*(CEps4_*betap_*pow(mag(U_),3)-CEps5_*betad_*k_*mag(U_)), epsilon_); //Source Term)
// 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_)
+ fvm::Sp(Cd_*alphaL_/k_*(betap_*pow(mag(U_),3)-betad_*k_*mag(U_)), k_); //Source term)
The question are:

Is correct my implementation?

what is the advantages to take the extra terms as implicit in the k and epsilon equation with respect to take them as explicit terms? Quick Convergence? Stability?

Thank you very much for your time.

be_inspired March 19, 2013 11:50

Ok, It seems according to the other topic that it is related to the stability of the equations...


All times are GMT -4. The time now is 06:48.