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

turbulence->correct(), EXPERT NEEDED

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

Like Tree1Likes
  • 1 Post By santiagomarquezd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 31, 2012, 01:15
Default turbulence->correct(), EXPERT NEEDED
  #1
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
beeo is on a distinguished road
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 post-processing.

Thanks for your answers!
Beeo
beeo is offline   Reply With Quote

Old   October 31, 2012, 11:55
Default
  #2
New Member
 
Join Date: Oct 2012
Posts: 16
Rep Power: 13
pascool is on a distinguished road
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
pascool is offline   Reply With Quote

Old   October 31, 2012, 12:30
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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.
mturcios777 is offline   Reply With Quote

Old   October 31, 2012, 14:13
Default
  #4
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
beeo is on a distinguished road
Thanks Pascal and mturcios777 for your answers.

Quote:
Originally Posted by mturcios777 View Post
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.
In order to find out the influence of turbulence->correct() on the thermal field I did the following:

Simulation of a heated channel flow with constant heat flux at the lower and upper wall (RANS)
  1. calculate the velocity field (turbulence model: RSTM)
  2. calculate the thermal field based on 1. with two different approaches for the turbulent scalar fluxes
  • Fourier's Law (−ui θ = f(∂Θ/∂xi)) --> no dependence on the velocity field
  • Own model (−ui θ = f(ui uj , Sij , ∂P/ ∂xi, ...)) --> explicit dependence on velocity field
For each of the two models, computations are done with turbulence->correct() active and inactive respectively. All other parameters are the same.


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

Old   October 31, 2012, 15:39
Default
  #5
New Member
 
Ozgur Kirlangic
Join Date: May 2009
Location: Istanbul
Posts: 16
Rep Power: 16
ozgur is on a distinguished road
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
ozgur is offline   Reply With Quote

Old   November 1, 2012, 13:43
Default
  #6
New Member
 
Join Date: Sep 2012
Posts: 10
Rep Power: 13
beeo is on a distinguished road
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();
    }
This part of the code is followed by (in words)
  • Update of epsilon and G at the wall
  • Dissipation equation
  • Wall correction
  • Reynolds stress equation
  • Re-calculation of turbulent viscosity
  • Correction of wall shear stresses
  • Calculation of near-wall velocity gradient
  • Calculation of near-wall shear-stress tensor
  • Reset of the shear components of the stress tensor

I do not completely understand the if-statements. 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 if-statements is true, I can neglect turbulence->correct() in combination with the TEqn.

Right?
beeo is offline   Reply With Quote

Old   December 17, 2012, 18:52
Default
  #7
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Quote:
Originally Posted by beeo View Post
Thanks Ozgur.

[...]

I do not completely understand the if-statements. 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 if-statements is true, I can neglect turbulence->correct() in combination with the TEqn.

Right?
Might as well answer as I'm purging my subscriptions. turbulence_ is a member variable that is set by the turbulence keyword in RASProperties. If this is set to off, then there is no need to proceed further. The statement is the member access function to the private member of mesh_ that determined if the mesh is changing. If the mesh has changed, then we need to recalculate the yr.
mturcios777 is offline   Reply With Quote

Old   December 22, 2012, 10:41
Default
  #8
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 23
santiagomarquezd will become famous soon enough
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.
neeraj likes this.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd 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
Wrong calculation of nut in the kOmegaSST turbulence model FelixL OpenFOAM Bugs 27 March 27, 2012 10: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 12:35
turbulence modeling questions llowen Main CFD Forum 3 September 11, 1998 05:24


All times are GMT -4. The time now is 04:35.