-
-
July 10, 2024 at 4:08 pmAsif Shahriar NafiSubscriber
For Eulerian Multiphase flow:
As far I know, UDF of the momentum source term has to be hooked for each phase inside the "cell zone condition" (i.e., for phase 1, phase 2, etc.)
For example:
say for phase-1: x-momentum source term UDF isÂ
Â
DEFINE_SOURCE(xmom_source,cell,thread,dS,eqn)
{
    PHASE1_U_Velocity = C_U(cell, thread);
    PHASE1_VOF = C_VOF(cell, thread);
    source = PHASE1_VOF*PHASE1_U_Velocity;
    return source ;
}
Â
From my understanding, C_U and C_VOF here will give the Phase 1 velocity and volume fraction only. To calculate my source term, I need the PHASE2 velocity and volume fraction as well. how do I get both of them for Phase 2 inside that particular cell.Â
Thanks in AdvanceÂ
Â
Â
-
July 10, 2024 at 4:18 pmRobForum Moderator
You need to access the phase thread, so start reading here  https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v241/en/flu_udf/flu_udf_GenPurposeLoopingMacros.html%23flu_udf_sec_THREAD_SUB_THREAD
-
July 10, 2024 at 4:44 pmAsif Shahriar NafiSubscriber
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 -
July 11, 2024 at 8:17 amRobForum Moderator
Looks about right. Best approach is to build a simple model and test. We're unable to give UDF advice on here beyond what's in the manual, or "very obvious" in code snippets.Â
-
- The topic ‘Momentum source UDF in Eulerian Multiphase Flow (Fluent)’ 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
-
1241
-
543
-
523
-
225
-
209
© 2024 Copyright ANSYS, Inc. All rights reserved.