CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Define bubble diameter UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 14, 2025, 10:24
Default Define bubble diameter UDF
  #1
New Member
 
Hector Maldonado
Join Date: Feb 2024
Location: Rotterdam
Posts: 8
Rep Power: 3
DigiHctrGT is on a distinguished road
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!
DigiHctrGT is offline   Reply With Quote

Reply

Tags
bubble, define_property, diameter, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
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


All times are GMT -4. The time now is 22:08.