CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Adding new term in to K eqn of K-Epsilon turbuelnce model (http://www.cfd-online.com/Forums/openfoam-solving/107903-adding-new-term-k-eqn-k-epsilon-turbuelnce-model.html)

neeraj October 9, 2012 05:29

Adding new term in to K eqn of K-Epsilon turbulence model
 
Hi all,
i have made a copy of existing kepsilon model and renamed as mykEpsilon. Now i want to add compressibility correction factor Ym=2*epsilon*(M^2) ,where M=sqrt(k/(a^2)) in to the k equation.
Now i have to define a new dimensioned scalar constant "a" (velocity of sound= 350 m/s). can someone help me in doing this?
how should i define "a"?
where should i give its dimension?
etc..
Plz help..!

neeraj October 10, 2012 01:44

My try...!
 
I tried by adding these lines to mykEpsilon.C
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
airvel_
(
dimensioned<scalar>::lookupOrAddToDict
(
"airvel",
coeffDict_, //added by me //
117649
)
),
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


and by adding these line to mykEpsilon.H class protected data
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensionedScalar airvel_;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //



Also added the dimensions into transportproperties in the pitzDaily/Constant
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;

nu nu [ 0 2 -1 0 0 0 0 ] 1e-05;
airvel_ airvel_ [ 0 2 -2 0 0 0 0 ] 117649;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


But i am getting error as follows:::
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model mykEpsilon
mykEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
sigmaEps 1.3;
airvel 117649;
}

Defining my own kEpsilon model
No field sources present


SIMPLE: convergence criteria
field p tolerance 0.01
field U tolerance 0.001
field "(k|epsilon|omega)" tolerance 0.001


Starting time loop

Time = 1

DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 0.0606635, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 0.0316293, No Iterations 1
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.00922589, No Iterations 161
time step continuity errors : sum local = 0.58783, global = -0.001983, cumulative = -0.001983
DILUPBiCG: Solving for epsilon, Initial residual = 0.225166, Final residual = 0.0179849, No Iterations 1


--> FOAM FATAL ERROR:
incompatible dimensions for operation
[k[0 2 -3 0 0 0 0] ] - [k[0 4 -5 0 0 0 0] ]

From function checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/fvMatrix.C at line 1316.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 void Foam::checkMethod<double>(Foam::fvMatrix<double> const&, Foam::fvMatrix<double> const&, char const*) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#3 at mykEpsilon.C:0
#4 Foam::incompressible::RASModels::mykEpsilon::corre ct() in "/home/http/OpenFOAM/http-2.1.1/platforms/linux64GccDPOpt/lib/libmyTurbulenceModels.so"
#5
in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/simpleFoam"
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7
in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/simpleFoam"
Aborted (core dumped)

neeraj October 10, 2012 01:45

new k-eqn
 
// 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(2*epsilon_/airvel_, k_) //***added Ym compressibilty effect***//
);

neeraj October 11, 2012 07:18

plz reply... if you want any more details please ask.... i think the basic problem is where to define the new variable "airvel"


All times are GMT -4. The time now is 19:17.