
[Sponsors] 
October 31, 2012, 01:15 
turbulence>correct(), EXPERT NEEDED

#1 
New Member
Join Date: Sep 2012
Posts: 10
Rep Power: 5 
Dear all,
I want to simulate the turbulent, incompressible flow over a backward facing step with heat transfer. Since the velocity field does not depend on the thermal field I want to compute it in a first step. In order to obtain the velocity field I am running the original simpleFoam solver which works fine so far. In a second step, I want to compute the temperature field on the basis of the converged velocity field data since the temperature field depends on the velocity. So the results of my first computation serve as the initial folder of the second one plus the boundary condition for T. In order to compute the thermal field I modified the original simpleFoam solver by adding the energy equation in combination with a special turbulence model for the turbulent scalar fluxes. While running it, UEqn and pEqn are commented out since I want to use the converged results of step 1 rather than recalculate these fields. Now my main concern: The modified solver is running when "turbulence>correct()" is commented out. When active it crashes with a "sigFpe" error. Since my model for the turbulent scalar fluxes is a function of the Reynolds stresses and velocity gradients I am not sure wheter I need this part of the original simpleFoam solver or I can neglect it. Does anyone know what "turbulence>correct()" is exactly doing? Additionally, is my general procedure legitimate? Overall, I am using the velocity data of step 1 and the temperature data of step 2 for postprocessing. Thanks for your answers! Beeo 

October 31, 2012, 11:55 

#2 
New Member
Join Date: Oct 2012
Posts: 16
Rep Power: 5 
Hi beeo,
I encountered the same problem and I couldn't find out how the tubulent>correct statement actually works and how it affects the solving of the temperature equation when I already have a converged velocity field. I don't know why it crashes for flows with separation, in particular. Regards, Pascal 

October 31, 2012, 12:30 

#3 
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 727
Rep Power: 20 
turbulence>correct() updates the turbulence model based upon the now solved for U. What it does depends on whether you have a RANS or LES turbulence model enabled. Since you have already solved for the velocity field, you should not need to continue updating turbulence. The floating point error is likely from trying to update the turbulence model when nothing has happened. As long as mut and your Prandtl number are correct, you should be in business.


October 31, 2012, 14:13 

#4  
New Member
Join Date: Sep 2012
Posts: 10
Rep Power: 5 
Thanks Pascal and mturcios777 for your answers.
Quote:
Simulation of a heated channel flow with constant heat flux at the lower and upper wall (RANS)
While the results on the basis of Fourier's Law are identical and thus show no dependence on turbulence>correct(), the output of the own model behaves different. Please see the attached picture which displays the problem exemplary for T_wall along x/H. Ideas please! Beeo export.jpg 

October 31, 2012, 15:39 

#5 
New Member
Ozgur Kirlangic
Join Date: May 2009
Location: Istanbul
Posts: 16
Rep Power: 9 
Dear beeo,
If you were using a LES model I would say that the member function "correct()" will update the turbulent kinetic energy (k) and eddy viscosity (nuSgs) values which are member variables of the object "turbulence". I haven't looked at the RAS model codes so far, but it may be similar in a RAS models also. So if you are sure that you don't refer to the "turbulence" object in any other part of your code, i.e. by writing "turbulence > something", such as "turbulence> divDevReff(U)" or turbulence> nut()", then only calling the "turbulence> correct ()" should have no effect on your results at all (at least I guess this way).. By the way, are you totally dismantling the available turbulence model references from simpleFoam, and writing your own turbulence model as a part of solver, i.e. not as an external class?? This may also be helpful: http://www.tfd.chalmers.se/~hani/kur...lenceModel.pdf Ozgur 

November 1, 2012, 13:43 

#6 
New Member
Join Date: Sep 2012
Posts: 10
Rep Power: 5 
Thanks Ozgur.
I had a look at the code of the turbulence model. The function turbulenceModel::correct() starts as follows: Code:
void turbulenceModel::correct() { RASModel::correct(); if (!turbulence_) { return; } if (mesh_.changing()) { yr_.correct(); }
I do not completely understand the ifstatements. Can someone explain the exact meaning of if (!turbulence_) and if (mesh_.changing())? So if one of the two conditions is occuring during the computation of the TEqn, the turbulence>correct() statement is needed and I have to incorporate the entire function. If none of the ifstatements is true, I can neglect turbulence>correct() in combination with the TEqn. Right? 

December 17, 2012, 18:52 

#7  
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 727
Rep Power: 20 
Quote:


December 22, 2012, 10:41 

#8 
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 430
Rep Power: 16 
Well, there is a simple way to do what you want, it is using the
buoyantBoussinesqSimpleFoam solver, this solver is simpleFoam with buoyancy plus the energy equation. So that you have to use null thermal expansion coefficient (beta=0) to deactivate the buoyancy and set the other physical properties in order to use the energy equation. If you want to use RANS it is included, in the case of laminar you can use the laminar dummy model that avoids the use of the turbulent correction. In case you want LES you have to program a bit but it is easy. All the info is here: http://openfoamwiki.net/index.php/Bu...sinesqPisoFoam Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Research Scientist Research Center for Computational Methods (CIMEC)  CONICET/UNL Tel: 543424511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe  Argentina. http://www.cimec.org.ar 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Wrong calculation of nut in the kOmegaSST turbulence model  FelixL  OpenFOAM Bugs  27  March 27, 2012 09:02 
Question on Turbulence Intensity  Eric  FLUENT  1  March 7, 2012 05:30 
Turbulence dampening due to magnetic field in LES and RAS  eelcovv  OpenFOAM  0  June 8, 2010 11:35 
turbulence modeling questions  llowen  Main CFD Forum  3  September 11, 1998 04:24 