Compressible turbulence model issues
Hello forum,
I've been trying to compile my my own compressible RASbased turbulence model, based upon compressible kepsilon for use with rhoSimpleFoam in ver 2.2.0 but have been having a number of issues. The root of the problems seems to be a mismatch between units within the model centered around the mut term. Although the model does compile correctly with no errors, I've had to copy the turbulenceModel/compressible directory to my run directory to compile the model. The only addition to the files in Make/ has been the new .C file and the write directory set to user library. The options file remains unchanged. Copying the dimensions from the tutorial case located in : /opt/openfoam/220/tutorials/compressible/rhoSimpleFoam/angledExplicitDuctFixedCoeffs; give the units for mut as being [1 1 1 0 0 0 0], however when attempting to run with my new model, the mut term only calculates as [0 2 1 0 0 0 0], obviously missing the unit change for rho [1 3 0 0 0 0 0] despite its inclusion in the equations. Although this model was written using the incompressible kEpsilon model originally, all terms and files have been updated to match compressible kEpsilon. Code:
mut_ = (Cmu_*rho_*sqr(k_)/epsilon_); Code:
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" Does anyone have any pointers as to why the units for density are seemingly being missed out? Or is there a specific way in which the rho term is handled during the compressible solver use? Thanks. Dom. 
Hi Dom,
can you be more specific on Quote:
in src/turbulenceModels/compressible/RAS/kEpsilon. Are you sure you didn't miss an occurance of the mut_ equation and have you adapted. Is the namespace correct ? May be you are not missing rho units when you compute mut but when muEff=mut+mu is done. Gregor 
Hi Gregor,
the only reason I used the incompressible model as a basis for the compressible version was that I had fully implemented all additional equations in that version and was hoping for a quick, easy transition. Not so much :) You were quite right, the fault lay with the units for muEff rather than the mut calculation with the turbulence model .C file; I took your advice and started again with the compressible model as a basis and now seems to work  additions pending. Thank you very much for the assistance. Cheers. Dom. 
Hello,
I'm just starting to learn the openfoam turbulence models. Regarding kEpsilon model for compressible flows, I'm not clear about the of's formulations. Namely rho is included in the first unsteady term in the equation, say for epsilon, correspondingly the convection term also needs to include the rho contribution. But as seen the code below, phi_ is just function of Sf and U; where is rho's contribution? Does it appear in the RHS as  fvm::SuSp(((2.0/3.0)*C1_ + C3_)*rho_*divU, epsilon_). fvm::ddt(rho_, epsilon_) + fvm::div(phi_, epsilon_)... 290 // Dissipation equation 291 tmp<fvScalarMatrix> epsEqn 292 ( 293 fvm::ddt(rho_, epsilon_) 294 + fvm::div(phi_, epsilon_) 295  fvm::laplacian(DepsilonEff(), epsilon_) 296 == 297 C1_*G*epsilon_/k_ 298  fvm::SuSp(((2.0/3.0)*C1_ + C3_)*rho_*divU, epsilon_) 299  fvm::Sp(C2_*rho_*epsilon_/k_, epsilon_) 300 ); Many thanks. Regards, Jason 
Hi Jason,
please double check the definition of phi it should contain rho*U e.g. in compressibleCreatePhi.H Code:
linearInterpolate(rho*U) & mesh.Sf() Cheers Gregor 
Hi Gregor,
Exactly you are right. I just found definition of phi is different for incompressible and compressible flow. Regards, Jason Quote:

All times are GMT 4. The time now is 21:08. 