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

Compressible turbulence model issues

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

Like Tree1Likes
  • 1 Post By gregor

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 17, 2013, 08:07
Default Compressible turbulence model issues
  #1
New Member
 
Dominic
Join Date: Jan 2011
Location: Leeds, UK
Posts: 25
Rep Power: 15
351Cleveland is on a distinguished road
Hello forum,

I've been trying to compile my my own compressible RAS-based turbulence model, based upon compressible k-epsilon 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_);
    mut_.correctBoundaryConditions();
I am wondering if there has been a missing link somewhere as it does not seem to recognise the addition of the rho terms dimensional units? When adding a file for rho to the 0/ directory, the following error is returned:

Code:
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::compressible::mutkWallFunctionFvPatchScalarField::calcMut() const in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#4  Foam::compressible::mutWallFunctionFvPatchScalarField::updateCoeffs() in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#5  Foam::fvPatchField<double>::evaluate(Foam::UPstream::commsTypes) in "/opt/openfoam220/platforms/linux64GccDPOpt/bin/rhoSimpleFoam"
#6  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::evaluate() in "/opt/openfoam220/platforms/linux64GccDPOpt/bin/rhoSimpleFoam"
#7  Foam::compressible::RASModels::yliqcomp::yliqcomp(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&, Foam::word const&) in "/home/moffat/OpenFOAM/moffat-2.2.0/platforms/linux64GccDPOpt/lib/libuserRAScomp.so"
#8  Foam::compressible::RASModel::adddictionaryConstructorToTable<Foam::compressible::RASModels::yliqcomp>::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/home/moffat/OpenFOAM/moffat-2.2.0/platforms/linux64GccDPOpt/lib/libuserRAScomp.so"
#9  Foam::compressible::RASModel::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#10  
 in "/opt/openfoam220/platforms/linux64GccDPOpt/bin/rhoSimpleFoam"
#11  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#12  
 in "/opt/openfoam220/platforms/linux64GccDPOpt/bin/rhoSimpleFoam"
Floating point exception (core dumped)
Despite the lack of any such file in the tutorial time directory - I included it in an attempt to correct the lack of unit recognition. But this seems to throw up an error in the wall functions. Upon trying to run my case there are also a number of duplicate entries added to the runTime selection table, I'm assuming this is due to the copying of the turbulence model directory and the original in the src/ directory - but this doesn't seem to have any bearing on the problems.

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

Old   September 18, 2013, 05:34
Default
  #2
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 16
gregor is on a distinguished road
Hi Dom,

can you be more specific on

Quote:
Although this model was written using the incompressible kEpsilon model originally, all terms and files have been updated to match compressible kEpsilon.
You copied the code incompressible from the incompressible formulation and replaced it ? Why dont you start from the compressible kEpsilon formulation
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
351Cleveland likes this.
gregor is offline   Reply With Quote

Old   September 18, 2013, 06:48
Default
  #3
New Member
 
Dominic
Join Date: Jan 2011
Location: Leeds, UK
Posts: 25
Rep Power: 15
351Cleveland is on a distinguished road
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.
351Cleveland is offline   Reply With Quote

Old   October 23, 2013, 16:43
Default
  #4
New Member
 
Hf
Join Date: Nov 2012
Posts: 27
Rep Power: 13
jasonchen is on a distinguished road
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
jasonchen is offline   Reply With Quote

Old   October 24, 2013, 07:57
Default
  #5
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 16
gregor is on a distinguished road
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()
In the code you posted i dont find a definintion of phi.

Cheers
Gregor
gregor is offline   Reply With Quote

Old   October 24, 2013, 16:41
Default
  #6
New Member
 
Hf
Join Date: Nov 2012
Posts: 27
Rep Power: 13
jasonchen is on a distinguished road
Hi Gregor,

Exactly you are right. I just found definition of phi is different for incompressible and compressible flow.

Regards,
Jason

Quote:
Originally Posted by gregor View Post
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()
In the code you posted i dont find a definintion of phi.

Cheers
Gregor
jasonchen is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Implement an les turbulence model pante OpenFOAM Programming & Development 19 December 5, 2014 17:16
How to decide to Turbulence model shipman OpenFOAM 2 August 18, 2013 04:00
compressible low-Re turbulence model immortality OpenFOAM Running, Solving & CFD 8 June 11, 2013 05:58
turbulence model equation Andy Chen FLOW-3D 4 January 1, 2010 22:45
Problem calculate Y in compressible turbulence model luca OpenFOAM Running, Solving & CFD 5 June 1, 2006 06:53


All times are GMT -4. The time now is 15:25.