TAGGED: #fluent-#ansys, cfd-udf-fleunt, turbulence-intensity
-
-
October 19, 2024 at 10:45 amanupamkrishnan91Subscriber
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.
-
October 21, 2024 at 10:02 amRobForum 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.
-
October 21, 2024 at 1:31 pmanupamkrishnan91Subscriber
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 adjustedint 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 kDEFINE_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 adjustedint 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. -
October 21, 2024 at 1:56 pmRobForum Moderator
That's set on the inlet boundary?
-
October 21, 2024 at 1:58 pmanupamkrishnan91Subscriber
Hi Rob,
yes. As variable k and variable epsilon in the inlet boundary condition.
Thank you.
-
October 21, 2024 at 2:02 pmRobForum 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.
-
October 21, 2024 at 2:06 pmanupamkrishnan91Subscriber
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.
-
October 21, 2024 at 2:13 pmRobForum Moderator
Do k & e match the calculated values?
-
October 21, 2024 at 2:15 pmanupamkrishnan91Subscriber
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.
-
October 21, 2024 at 2:17 pmRobForum Moderator
Monitor k & e to see if they tie up with your expections.
-
October 21, 2024 at 2:20 pmanupamkrishnan91Subscriber
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?
-
October 21, 2024 at 2:27 pmRobForum 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.
-
October 21, 2024 at 2:36 pmanupamkrishnan91Subscriber
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?
-
October 21, 2024 at 2:55 pmRobForum 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.
-
- You must be logged in to reply to this topic.
- How do I get my hands on Ansys Rocky DEM
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Fluent fails with Intel MPI protocol on 2 nodes
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- convergence issue for transonic flow
-
1436
-
599
-
591
-
591
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.