September 10, 2024 at 5:22 pm
warhammer975
Subscriber
I also tried to use this function, but the result remained the same:
#include "udf.h"
Â
DEFINE_EXECUTE_AT_END(find_first_near_wall_cells)
{
  Domain *domain;
  Thread *wall_thread;
  face_t f;
  cell_t c;
  Thread *adjacent_thread;
  real cell_dist;
  Â
  /* Получаем домен */
  domain = Get_Domain(1);
  Â
Â
  wall_thread = Lookup_Thread(domain, 5);Â
 Â
  begin_f_loop(f, wall_thread)
  {
    Â
    c = F_C0(f, wall_thread);
Â
   Â
    adjacent_thread = THREAD_T0(wall_thread);
    cell_dist = C_WALL_DIST(c, adjacent_thread);
Â
Â
    if (cell_dist < 0.001)
    {
      Message("Found adjacent cell to wall at face: %d\n", c);
    }
  }
  end_f_loop(f, wall_thread)
}
Â
Â
DEFINE_SOURCE(mass_source, cell, thread, dS, eqn)
{
  real source;  Â
  real mass_flow;Â
  real cell_dist;
  Â
Â
  mass_flow = 2;
Â
Â
  cell_dist = C_WALL_DIST(cell, thread);
Â
  Â
  if (cell_dist < 0.001)Â
  {
    source = mass_flow;
  }
  else
  {
    source = 0.0;
  }
Â
  return source;
}
Â