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;
}

Â