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

UDF-DROPLET EVAPORATION-interfacial area density

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2022, 01:03
Default UDF-DROPLET EVAPORATION-interfacial area density
  #1
New Member
 
masoud fard
Join Date: Jan 2022
Posts: 7
Rep Power: 4
fard734 is on a distinguished road
Dear friends
The following udf has been used for calculation of interfacial area density, which is need for prediction of evaporation rate from a single droplet. The udf can not calculate the theta, Anybody know what is the problem?


/**** Compute the interfacial area density ****/
NV_V(G,=,C_VOF_G(c,w_liq)); /* vof gradient vector assignment*/

theta = atan(G[0]/G[1]); /* compute angle of VOF gradient vector, n1/n2 because of how geometry is set up in Fluent */
cotan = cos(theta) / sin(theta); /* compute cotangent of angle*/

A = C_VOLUME(c,mixture_thread)/(2*pi); /* in 2D- axis area computed from volume */

len = sqrt((2*C_VOF(c,w_liq)*A/cotan) + (2*C_VOF(c,w_liq)*A*cotan)); /* compute length of interface in a cell */

ad = len/A; /* calculate interfacial area density*/
/***** Computed the area density ad = length of interface / area of cell ***/
fard734 is offline   Reply With Quote

Old   January 19, 2022, 02:35
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
did you include math.h ?
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   January 19, 2022, 02:40
Default
  #3
New Member
 
masoud fard
Join Date: Jan 2022
Posts: 7
Rep Power: 4
fard734 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
did you include math.h ?
Dear AlexanderZ
the udf is:
UDF for evaporation
the math.h is not included
fard734 is offline   Reply With Quote

Old   January 19, 2022, 03:29
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
include math.h folder and recompile.
if you need help put here full code, compilation log, description of errors
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   February 21, 2022, 15:44
Default error in udf-excuted on demand-parallel mode
  #5
New Member
 
masoud fard
Join Date: Jan 2022
Posts: 7
Rep Power: 4
fard734 is on a distinguished road
Dear AlexanderZ
Following udf is working in serial processing option, but under parallel mode, the error "Node 999999: Process 13848: Received signal SIGSEGV. MPI Application rank 0 exited before MPI_Finalize() with status -1 The fl process could not be started"
appear when "excuted on demand" is selected.
please let me know your thought,,,,

#include "udf.h"
DEFINE_ON_DEMAND(on_demand_calc)
{
Domain *d; /* declare domain pointer since it is not passed as an
argument to the DEFINE macro */

real R=8.314;
real D=26.1e-6;
float Y_W,X_W,Y_A;
float T_cell, P_cell, P_sat,Powsat;
Thread *t;
cell_t c;
d = Get_Domain(2); /* Get the domain using ANSYS Fluent utility */

/* Loop over all cell threads in the domain */
thread_loop_c(t,d)
{

/* Compute max, min, volume-averaged temperature */

Y_W = C_YI(c,t,0);
Y_A = C_YI(c,t,1);
X_W = (Y_W*29)/((29*Y_W) + (18*Y_A));
T_cell = C_T(c,t); /*cell mixture temperature*/
P_cell = C_P(c,t);
Powsat=(8.07131-1730.63/(233.426+(T_cell-273.15)));
P_sat = pow(10,Powsat)*133.322;

/* Loop over all cells */
begin_c_loop(c,t)
{
C_UDSI(c,t,0) = C_VOF(c,t);
C_UDSI(c,t,1) = C_YI(c,t,0);

C_UDMI(c,t,1)=NV_MAG(C_UDSI_G(c,t,0));
C_UDMI(c,t,2)=NV_MAG(C_UDSI_G(c,t,1));
C_UDMI(c,t,4)= pow(C_VOLUME(c,t),-0.333)*4.83;

if (C_UDMI(c,t,1)>40)
{
C_UDSI(c,t,1)=P_sat/ P_cell;

C_UDMI(c,t,2)=NV_MAG(C_UDSI_G(c,t,1));

C_UDMI(c,t,0)=D*P_cell/(R*T_cell)* C_UDMI(c,t,2)*C_UDMI(c,t,4);
C_UDMI(c,t,5)=ABS(D*P_cell/(R*T_cell)* C_UDMI(c,t,2));
}
else
{C_UDMI(c,t,0)=0;}
}
end_c_loop(c,t)
}
}

DEFINE_MASS_TRANSFER(mass_transfer1, c, t, from_phase_index, from_species_index, to_phase_index, to_species_index)
{


float m_lg, T_cell, P_cell, P_sat,Powsat;
float NV_VEC(G);
float X_W, Y_W, Y_A;
float cur_ts;
Thread *w_liq, *gas_mix, *w_gas;
face_t f;
Domain *mix_domain, *pdomain;
int i, pdomain_index;
float area[ND_ND], A, ad, theta, cotan, len;

/******** Define variables *********/
mix_domain = Get_Domain(1);
/* pdomain = DOMAIN_SUB_DOMAIN(mixture_domain,2); */ /* For gas domain */
pdomain_index = 0;
pdomain = DOMAIN_SUB_DOMAIN(mix_domain,pdomain_index);

w_liq = THREAD_SUB_THREAD(t, from_phase_index);
gas_mix = THREAD_SUB_THREAD(t, to_phase_index);
w_gas = THREAD_SUB_THREAD(t, to_species_index);
T_cell = C_T(c,t); /*cell mixture temperature*/
P_cell = C_P(c,t); /*cell mixture pressure*/
m_lg = ABS(C_UDMI(c,t,0));
C_UDMI(c,t,3)=m_lg;
return (m_lg); /* return value of mass transfer rate */
}
fard734 is offline   Reply With Quote

Reply


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
Density UDF lehoanganh07 Fluent UDF and Scheme Programming 3 August 17, 2014 09:36
Density UDF for supersonic flow David Christopher Fluent UDF and Scheme Programming 0 April 18, 2013 05:48
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 06:27
multiphase interfacial area density model Paul Main CFD Forum 0 August 5, 2003 17:33
density update by UDF in non-premixed combustion IKSOO FLUENT 2 December 8, 2002 20:37


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