Ansys Learning Forum › Forums › Discuss Simulation › Fluids › Momentum source UDF in Eulerian Multiphase Flow (Fluent) › Reply To: Momentum source UDF in Eulerian Multiphase Flow (Fluent)
July 10, 2024 at 4:44 pm
Asif Shahriar Nafi
Subscriber
If my understanding is correct:
for water (phase 1) - air (phase 2) flow (Eulerian Multiphase):
A UDF for Phase 1 x-momentum source can be written as:
DEFINE_SOURCE(xmom_source,cell, mixture_thread, dS, eqn)
{Â Â Â
int phase1_domain_index = 0; /* primary (water) phase-1 index is 0 */
  int phase2_domain_index = 1; /* secondary (air) phase-2 index is 1 */
Thread *mixture_thread; /* mixture-level thread pointer */
Thread *water = THREAD_SUB_THREAD(mixture_thread,phase1_domain_index);
Thread *air = THREAD_SUB_THREAD(mixture_thread,phase2_domain_index);
    water_U_Velocity = C_U(cell, water);
    water_VOF = C_VOF(cell, water);
    air_U_Velocity = C_U(cell, air);
    air_VOF = C_VOF(cell, air);
Â
    source = water_VOF*water_U_Velocity*air_VOF*air_U_Velocity;
    return source ;
}
Please let me know if my assumption is correct ?
Thanks in Advance