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

How to implement compressibility correction factor in k-epsilon model

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 12, 2012, 00:24
Question How to implement compressibility correction factor in k-epsilon model
  #1
New Member
 
neeraj's Avatar
 
OpenFoam
Join Date: Jul 2012
Posts: 24
Rep Power: 13
neeraj is on a distinguished road
Hi all,
I made a copy of existing kepsilon model and renamed as mykEpsilon and compiled successfully into OpenFOAM 2.1.1. Now i want to add compressibility correction factor Ym=2*epsilon*(M^2) ,where M=sqrt(k/(airvel^2)) in to the k equation.
For this i have to define a new dimensioned scalar constant "airvel" (velocity of sound= 350 m/s). can someone help me in doing this?
how should i define "airvel"?
where should i define its dimension?
etc..

K-equation is edited as follows:

// 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***//
);


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 is offline   Reply With Quote

 


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
Turbulence Model Curvature Correction Jorg CFX 0 August 10, 2012 18:05
new compressibility model jml OpenFOAM 1 March 2, 2012 09:28
implement of Spalart-Allmaras model K S Chang Main CFD Forum 1 August 21, 2010 16:59
How to implement swirling phenomenon to model FAN OPticdesigner Main CFD Forum 3 January 9, 2006 07:16
FDS - how to implement your FORTRAN model???? ana Main CFD Forum 0 July 1, 2005 10:06


All times are GMT -4. The time now is 03:41.