turbulence>correct(), EXPERT NEEDED
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 
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 
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.

1 Attachment(s)
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 Attachment 16552 
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 
Thanks Ozgur.
I had a look at the code of the turbulence model. The function turbulenceModel::correct() starts as follows: Code:
void turbulenceModel::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? 
Quote:

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. 
All times are GMT 4. The time now is 03:06. 