TAGGED: dpm, les, particle-tracking, udf
-
-
November 22, 2023 at 10:23 amll00023Subscriber
I tried to calculate the stockes number for a specific group of particles. here is the code.
This udf has been hooked up in DPM model and the number of scalar is set to 1.
the code has no compiling issue in this LES case. the case runs on HPC with 128 cores. memory info is listed below.
Â
but when the calculation started, then it crashed.
Â
#include "udf.h"#include "dpm.h"ÂDEFINE_DPM_SCALAR_UPDATE(StokesNumber,c,t,init,p){  cphase_state_t *cp;  cp = p->cphase;  /* cphase_state_t *c = &(p->cphase); */  real tau_p = 0;  real drag_factor;  real tau_f = 1e-16;  real C_mu = 0.09;  real l_int, u_f;  /* Compute particle relaxation time */  if (P_DIAM(p) != 0.0)  {tau_p = P_RHO(p)*pow(P_DIAM(p), 2.0)/C_MU_L(TP_CELL(p), TP_CELL_THREAD(p));drag_factor = DragCoeff(p); /* returns 18*Cd*Rep/24 ? Please check */tau_p /= drag_factor;  }  else  {tau_p = 0.;  }  /* Compute the fluid time scale    (based on integral length scale) */  if (C_D(TP_CELL(p), TP_CELL_THREAD(p)) > 0)  {    l_int = C_mu*pow(C_K(TP_CELL(p), TP_CELL_THREAD(p)), 1.5)/C_D(TP_CELL(p), TP_CELL_THREAD(p));  }  else  {l_int = 1.;  }  Â  /* Velocity magnitude*/  u_f = sqrt(pow(cp->V[0], 2.0) + pow(cp->V[1], 2.0) + pow(cp->V[2], 2.0));  if (u_f > 1e-12)  {tau_f = l_int/u_f;  }   else  {tau_f = 1.;  }  /* Stokes Number */  P_USER_REAL(p,0) = tau_p / tau_f;Â} -
November 22, 2023 at 12:44 pmRobForum Moderator
I can only point you at https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v232/en/flu_udf/flu_udf_DPMDEFINE.html%23flu_udf_sec_define_dpm_scalar_update Â
Simplify the code to start with just setting a single value for the scalar, if that works start turning on more of the maths until it breaks. Then review what causes the problem.Â
-
November 23, 2023 at 1:55 amll00023Subscriber
if I get rid of all other info and just give a stokes number a value. it can run. I will keet testing and update it here.
Thank you Rob.Â
-
November 23, 2023 at 11:36 amRobForum Moderator
Good, so the scalar part is OK. Now see if you can pass P_DIAM(p)Â or similar to the scalar. If that works, pass cell velocity.Â
-
November 25, 2023 at 1:09 amll00023Subscriber
P_USER_REAL(p,0) = cp->V[1]; is used to export y velocity of particle. no issue.
P_USER_REAL(p,0) = P_DIAM(p), no issue.
-
November 25, 2023 at 6:13 amll00023Subscriber  if (C_D(TP_CELL(p), TP_CELL_THREAD(p)) > 0)  {    l_int = C_mu*pow(C_K(TP_CELL(p), TP_CELL_THREAD(p)), 1.5)/C_D(TP_CELL(p), TP_CELL_THREAD(p));  }  else  {l_int = 1.;  }when testing this code, it crashed FLUENT.
-
November 25, 2023 at 8:19 amll00023Subscriber
is C_D or C_K obtained from LES case?Â
-
November 25, 2023 at 8:06 pmll00023Subscriber
C_D dissipation rate is not available for LES case. So I calculated the dissipation rate with sqrt (C_MU_T(c, t))/ C_STRAIN_RATE_MAG.
what's the difference of C_MU_T and C_MU_L in LES case?
When I calculated particle relaxation time, should I use Laminar viscosity?
-
November 28, 2023 at 1:54 pmRobForum Moderator
Turbulent viscosity will take the turbulence into account, so it's probably what you want in the UDF: to an extent that's for you to decide based on your model requirements.Â
-
November 28, 2023 at 11:15 pmll00023Subscriber
-
- The topic ‘UDF crash’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Script error Code: 800a000d
- Cyclone (Stairmand) simulation using RSM
- Fluent fails with Intel MPI protocol on 2 nodes
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
-
1236
-
543
-
523
-
225
-
209
© 2024 Copyright ANSYS, Inc. All rights reserved.