Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Unexpected Downward Trend in Turb. Intensity Using Variable k and ε in Fluent

    • anupamkrishnan91
      Subscriber

      Hello,

      I'm running a simulation with a Reynolds number of 100,000 and encountering an issue with the expected variation of turbulence intensity (TI). I’m using a Realizable k-ε turbulence model with variable turbulent kinetic energy (k) and dissipation rate (ε), controlled via a UDF. My setup includes:

      • Reynolds number: 100,000
      • Turbulence model: Realizable k-ε with Menter-Lechner wall treatment
      • Time steps: 150, each with a 0.1 s step size
      • Velocity: 1.46 m/s, leading to the specified Reynolds number

      The issue is that, when calculating the TI based on the fluctuating values of k and ε, I am expecting an upward variation in the TI values over time. However, the actual trend I am observing is downward. This was quite unexpected, and I was hoping to gain insight into why this might be happening.

      Has anyone encountered similar behavior in Fluent or has any thoughts on why the trend could be downward? Is there something I could be missing in my UDF or in how Fluent handles the turbulence variables over time?

      Any insights or suggestions would be greatly appreciated!

      Thank you.

    • Rob
      Forum Moderator

      Without knowing what the UDF actually does I can't comment, and I'm also not able to debug code. So, have a look at what values the UDF takes to calculate stuff and work backwards. 

    • anupamkrishnan91
      Subscriber

      Hi, Thank you for the reply. 
      #UDF Starts from the next line#

      #include "udf.h"
      #include "math.h"
      #include "stdlib.h"
       
      // Define constants
      #define C_MU 0.09
      #define LENGTH_SCALE 0.07 /* Approximate length scale as 7% of characteristic length */
      #define VELOCITY 1.46 /* Mean velocity (m/s) */
      #define MIN_TI 0.44 /* Minimum turbulence intensity: 44% */
      #define MAX_TI 0.60 /* Maximum turbulence intensity: 60% */
       
      // Function to set time-dependent turbulent kinetic energy (k)
      DEFINE_PROFILE(variable_k, thread, position)
      {
          real time = CURRENT_TIME; /* Get current simulation time */
          real I; /* Turbulence intensity */
          real k; /* Turbulent kinetic energy */
          face_t f;
       
          /* Predefined turbulence intensity values*/
          real TI_values[15] = {0.44, 0.44, 0.44, 0.48, 0.51, 0.53, 0.56, 0.58, 0.56, 0.55, 0.53, 0.50, 0.49, 0.48, 0.46}; // Values adjusted
       
          int index = (int)(time); /* Convert time to an integer index (0 to 14) */
          if (index > 14) 
          {
              index = 14; /* Cap the index at 14 to keep TI at 46% after 15 seconds */
          }
       
          I = TI_values[index]; /* Assign the corresponding turbulence intensity */
       
          begin_f_loop(f, thread)
          {
              /* Compute turbulent kinetic energy (k) based on turbulence intensity (I) */
              k = 1.5 * pow(I * VELOCITY, 2); /* k = 3/2 * (I * U)^2 */
       
              F_PROFILE(f, thread, position) = k;
          }
          end_f_loop(f, thread)
      }
       
      // Function to set time-dependent turbulent dissipation rate (ε) based on k
      DEFINE_PROFILE(variable_epsilon, thread, position)
      {
          real time = CURRENT_TIME; /* Get current simulation time */
          real I; /* Turbulence intensity */
          real k; /* Turbulent kinetic energy */
          real epsilon; /* Turbulent dissipation rate */
          real l = LENGTH_SCALE; /* Turbulence length scale */
          face_t f;
       
          /* Predefined turbulence intensity values */
          real TI_values[15] = {0.44, 0.44, 0.44, 0.48, 0.51, 0.53, 0.56, 0.58, 0.56, 0.55, 0.53, 0.50, 0.49, 0.48, 0.46}; // Values adjusted
       
          int index = (int)(time); /* Convert time to an integer index (0 to 14) */
          if (index > 14) 
          {
              index = 14; /* Cap the index at 14 to keep TI at 46% after 15 seconds */
          }
       
          I = TI_values[index]; /* Assign the corresponding turbulence intensity */
       
          begin_f_loop(f, thread)
          {
              /* Compute turbulent kinetic energy (k) */
              k = 1.5 * pow(I * VELOCITY, 2); /* k = 3/2 * (I * U)^2 */
       
              /* Compute dissipation rate (ε) */
              epsilon = pow(C_MU, 0.75) * pow(k, 1.5) / l;
       
              F_PROFILE(f, thread, position) = epsilon;
          }
          end_f_loop(f, thread)
      }

      ###

      This is the UDF that I am using. 

      Hope this would define the problem. 
      Thanks in advance. 

       

    • Rob
      Forum Moderator

      That's set on the inlet boundary? 

    • anupamkrishnan91
      Subscriber

      Hi Rob, 

      yes. As variable k and variable epsilon in the inlet boundary condition. 

      Thank you. 

    • Rob
      Forum Moderator

      And where are you measuring the TI? Fluent will use the boundary values and then ramp up/down the level of turbulence based on the flow. 

    • anupamkrishnan91
      Subscriber

      I am measuring the area-weighted average of TI at the inlet over the flow time. The problem is that I defined a specific set in the UDF at each 1s interval, but the TI is coming down, starting from 0.44 to around 0.36. 

    • Rob
      Forum Moderator

      Do k & e match the calculated values? 

    • anupamkrishnan91
      Subscriber

      I didn't monitor the k and epsilon values, but seeing the TI trend, I believe they are following the same trend as TI. In the UDF the k and epsilon are recalculated according to TI.

       

    • Rob
      Forum Moderator

      Monitor k & e to see if they tie up with your expections. 

    • anupamkrishnan91
      Subscriber

      Ok. I will check the k and epsilon values. But my genuine question is, would fluent be able to modify the k and epsilon by itself during the flow rather than sticking to the UDF?

    • Rob
      Forum Moderator

      Not on the boundary - you need to set something for the solver to use in the cell zone. Those values will vary inside the domain based on the boundary and flow field. 

    • anupamkrishnan91
      Subscriber

      Simulation starts at 0.44 as defined by the UDF, then one step size is 0.1s and we are defining TI in an interval of 1s. So can TI vary by itself as controlled by fluent during this 1 s time at the inlet?

    • Rob
      Forum Moderator

      You set a boundary condition on the surface facet. You are monitoring something on the surface, but that may be influenced by the neighbouring cell value. As I have not seen any results I have no idea what you're seeing relative to what you think you're setting. 

Viewing 13 reply threads
  • You must be logged in to reply to this topic.