TAGGED: cfd-udf-fleunt, fluent, yplus
-
-
December 24, 2024 at 7:40 am
thamilmani
Subscriber#include "udf.h"real get_yplus(cell_t c, Thread* t, Domain* domain){  // Declaration  real result, cell_x_value, face_x_value, shear;  real cell_centroid[ND_ND];  real NV_VEC(face_centroid);  face_t f;Â
  shear = 10;  C_CENTROID(cell_centroid, c, t);  cell_x_value = cell_centroid[0];Â
  thread_loop_f(t, domain)  {    begin_f_loop(f, t)    {      if ((BOUNDARY_FACE_THREAD_P(t)) && (THREAD_TYPE(t) == THREAD_F_WALL))      {        F_CENTROID(face_centroid, f, t);        face_x_value = face_centroid[0];        if (cell_x_value == face_x_value)        {          shear = 1;        }      }    }    end_f_loop(f, t)  }Â
  return shear;}DEFINE_ADJUST(yplus, domain){  Thread* t;  cell_t c;  face_t f;Â
  /* Fill UDS with the variable. */  thread_loop_c(t, domain)  {    begin_c_loop(c, t)    {      C_UDSI(c, t, 0) = get_yplus(c, t, domain);    }    end_c_loop(c, t)  }Â
  thread_loop_f(t, domain)  {    if (THREAD_STORAGE(t, SV_UDS_I(0)) != NULL)    {      begin_f_loop(f, t)      {        if (BOUNDARY_FACE_THREAD_P(t))        {          F_UDSI(f, t, 0) = 0;        }        else        {          F_UDSI(f, t, 0) = ((get_yplus(F_C0(f, t), THREAD_T0(t), domain) + get_yplus(F_C1(f, t), THREAD_T1(t), domain)) / 2);        }      }      end_f_loop(f, t)    }  }}ÂThis UDF returns 10 only at all cell centres that is the internal face thread loop did not matched for any cell. Can anyone point what could be the logical flaw in the get_yplus function.
This is a 2D axisymmetric pipe, with a constant heat flux at the wall. -
December 24, 2024 at 10:14 am
Rob
Forum ModeratorYou may find some hints here  https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v242/en/flu_udf/flu_udf_ModelSpecificDEFINE.html%23flu_udf_sec_define_wall_functions   You may find y+ is only defined in the near wall cell, so also have a look at the adjacent cell/thread section of the manual.Â
-
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Ansys Innovation Space
Trending discussions
- air flow in and out of computer case
- Varying Bond model parameters to mimic soil particle cohesion/stiction
- Eroded Mass due to Erosion of Soil Particles by Fluids
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- I am doing a corona simulation. But particles are not spreading.
- Issue to compile a UDF in ANSYS Fluent
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
Top Contributors
-
3872
-
1414
-
1241
-
1118
-
1015
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.