Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.

Ansys Learning Forum Forums Discuss Simulation Fluids Rotating and mass flow inlet Reply To: Rotating and mass flow inlet

warhammer975
Subscriber

I tried to write a function to determine the wall cells of the inner cylinder (id=5) for pumping air into them, but so far Fluent refuses to understand this mass flow...

#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_ADJUST(adjust_mass_source, domain)
{
    Thread *t;
    cell_t c;
    real mass_flow = 2;  
    real cell_dist;
 
 
    thread_loop_c(t, domain)
    {
        begin_c_loop(c, t)
        {
 
            cell_dist = C_WALL_DIST(c, t);
 
 
            if (cell_dist < 0.001)  
            {
 
                C_UDMI(c, t, 0) = mass_flow;  
            }
        }
        end_c_loop(c, t)
    }
}

 

[bingo_chatbox]