CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Creating and implementing UDF for DPM droplet evaporation rate

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

Like Tree1Likes
  • 1 Post By fbsims

LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2023, 05:39
Question Creating and implementing UDF for DPM droplet evaporation rate
New Member
Join Date: Aug 2023
Posts: 5
Rep Power: 2
fbsims is on a distinguished road

I am trying to simulate a flash atomizing water spray. I've read that the 'pressure boiling' and 'temperature dependent latent heat' models do not calculate an appropriately fast evaporation rate and I will need to use a UDF. I am currently doing a steady sim with interaction with continuous phase turned on.

I have never used UDF's (or have programming experience beyond matlab) and don't know where/how to start. This is the calculation process (see below) I essentially need to follow (the code is written in Matlab, and I have all the parameters except for each droplet diameter, which I need to take from ansys at each iteration to get the new mass transfer rate (which is the mass removed from the droplet and added as a eulerian vapor phase).

Any help as to how I would turn this into a UDF would be much appreciated.


%% flashing mdot component
% get surface area of particle using diameter provided by ansys

A_p = 4*pi*(D/2)^2;

% using thermo constants and calculated alpha, along with surface
% area calculate mass transfer from flashing

mdot_flash = alpha * A_p * (TSH_act) / liq.hv;

%% condensing mdot component
% calculate Re with that D

Re_star = liq.rho*u_rel_initial*D/mu_ref;

% calculate Pr with known values
Pr_star = mu_ref*cp_ref/k_ref;

% calculate Nu* using Frossling correlation
Nu_star = 2 + 0.552 * Re_star^0.5 * Pr_star^(1/3);

% solve via netwon raphson
% error tolerance

err = 1e-20;

% initial guess
mdot_cond = 1;

% initial diff
diff = 1;

% loop until converged mdot_cond
while diff > err
% coefficient for equation using fluent droplet diameter
c1 = 2*pi*k_ref / cp_ref * D/2;

% set old flow rate for difference calc
m_old = mdot_cond;

% set ratio for evaporation
ratio_fc = mdot_flash/m_old;

% calculate new mdot_cond
mdot_cond = abs(c1 * (Nu_star / (1 + ratio_fc)) * log(1+(1+ratio_fc)*...
((h_ref-liq.h) / liq.hv)));

% check difference from previous guess
diff = abs(m_old-mdot_cond);
i = i+1;

%% total
mRES = mdot_cond + mdot_flash;
tongsw likes this.
fbsims is offline   Reply With Quote


dpm, evaporation, flashing flow, 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
Fluent Radiation/porous media Schmitt pierre-Louis FLUENT 26 September 1, 2016 10:29

All times are GMT -4. The time now is 04:31.