|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Hector Maldonado
Join Date: Feb 2024
Location: Rotterdam
Posts: 8
Rep Power: 3 ![]() |
Hi all,
I'm trying to set a UDF to set the bubble diameter for an Eulerian simulation while simulating the turbulence under the Dispersed model (as the density ratio is way beyond 1). While a similar UDF works perfectly for the Mixture model (for turbulence), it does not work with the modifications I've deemed necessary (i.e., pointing to the liquid-primary phase thread using the super_thread macro, as suggested in another thread from this Forum). The previous formulation resulted in SIGSEV error. I managed to solve the issue: 1. Mixture and liquid threads need to be defined, 2. Mixture is pointed by using the THREAD_SUPER_THREAD(t) macro 3. Liquid phase is pointed by using the conventional THREAD_SUB_THREAD(mix, 0) - 0 because that's the ID of the continuous phase. Thus, the UDF looks like: #include "udf.h" #include "math.h" Thread *mix; /* Define the mixture thread */ Thread *liq; /* Define the liquid thread */ DEFINE_PROPERTY(calderbank_db, c, t) { /* Accessing the liquid domain */ mix = THREAD_SUPER_THREAD(t); /* Pointing to mixture thread */ liq = THREAD_SUB_THREAD(mix, 0); /* Pointing to liquid phase */ /* Define the variables */ real db; /* Bubble diamter placeholder */ /* Get local conditions from the dispersed (gas) phase */ real eps = C_D(c, liq); /* Obtain turbulence dissipation from liquid phase */ real eG = C_VOF(c, t); /* Volume fraction of the gas phase */ /* Liquid properties */ double density_liq = 998.2; /* Density of liquid phase (kg/m³) */ /* Ensure epsilon is positive to avoid division errors */ if (eps <= 0.0) { eps = 0.0000000001; /* Small value to prevent singularity */ } if (eG > 0.3) { db = 0.0000001; /* almost zero db */ } /* Calderbank's model (1958) for pure liquid */ /* db = C1 + C2 * ((surf_tension / rhoL)^0.6 / eps^0.4) * eG^0.5 */ db = 0.0009 + 4.15 * pow(0.072 / density_liq, 0.6) * 1 / (pow(eps, 0.4)) * pow(eG, 0.5); return db; } Last edited by DigiHctrGT; March 17, 2025 at 05:23. Reason: Solution was found! |
|
![]() |
![]() |
![]() |
Tags |
bubble, define_property, diameter, udf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF bubble diameter | CeesH | Fluent UDF and Scheme Programming | 9 | May 20, 2023 02:54 |
Define chemkin mechanism and UDF for combustion problem in Fluent. | Deepak Chauhan | Main CFD Forum | 0 | August 13, 2020 07:02 |
HELP----Surface Reaction UDF | Ashi | Fluent UDF and Scheme Programming | 1 | May 19, 2020 21:13 |
UDF carbon conversion | papteo | Fluent UDF and Scheme Programming | 1 | August 18, 2011 07:32 |
Free surface boudary conditions with SOLA-VOF | Fan | Main CFD Forum | 10 | September 9, 2006 12:24 |