CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   evaporation in vof (http://www.cfd-online.com/Forums/fluent/41114-evaporation-vof.html)

asghari May 25, 2006 04:29

evaporation in vof
 
Hi all, how to involve evaporation process in vof by udf's? can everybody give me an example(with respective udf) in this case? thank all.


cg May 25, 2006 21:11

Re: evaporation in vof
 
Here's a UDF to propagate the VOF interface at a specified speed. I think that you can modify this accordingly for evaporation...

#include "udf.h" #include "sg.h" #include "sg_mphase.h" #include "flow.h" #include "mem.h"

/************************************************** ************/ /* UDF for specifying an interfacial area density */ /************************************************** ************/

#define flame_speed 2.;

DEFINE_ADJUST(area_density, domain) { Thread *t; Thread **pt; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE); real voidx, voidy, voidz=0;

Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_N ULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate);

mp_thread_loop_c (t,domain,pt)

if (FLUID_THREAD_P(t))

{

Thread *tp = pt[P_PHASE];

begin_c_loop (c,t)

{

voidx = C_VOF_G(c,tp)[0];

voidy = C_VOF_G(c,tp)[1]; #if RP_3D

voidz = C_VOF_G(c,tp)[2]; #endif

/* calculation of the interfacial area density */

C_UDMI(c,t,0)= sqrt( SQR(voidx) + SQR(voidy) + SQR(voidz) );

}

end_c_loop (c,t)

}

Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL); }

DEFINE_SOURCE(reactants, cell, thread, dS, eqn) { real source; Thread *tm = THREAD_SUPER_THREAD(thread); Thread **pt = THREAD_SUB_THREADS(tm); source = - C_UDMI(cell, tm, 0)*C_R(cell,pt[0]); source *= flame_speed; dS[eqn] = 0; return source; }

DEFINE_SOURCE(product, cell, thread, dS, eqn) { real source; Thread *tm = THREAD_SUPER_THREAD(thread); Thread **pt = THREAD_SUB_THREADS(tm); source = C_UDMI(cell, tm, 0)*C_R(cell,pt[0]); source *= flame_speed; dS[eqn] = 0; return source; }


greg May 26, 2006 11:03

Re: evaporation in vof
 
meby this will help you. By the way do you know haw to add a :from_species_index and to_species_index? the is only from_phase_index and to_phase_index. I don`t know how to do it.

/* UDF to define a simple mass transfer based on Saturation

Temperature. The "from" phase is the gas and the "to" phase is the

liquid phase */

#include "udf.h"

DEFINE_MASS_TRANSFER(liq_gas_source,cell,thread,fr om_index,from_species_index, to_index, to_species_index) {

real m_lg;

real T_SAT = 373.15;

Thread *gas = THREAD_SUB_THREAD(thread, from_index);

Thread *liq = THREAD_SUB_THREAD(thread, to_index);

m_lg = 0.;

if (C_T(cell, liq) >= T_SAT)

{

m_lg = -0.1*C_VOF(cell,liq)*C_R(cell,liq)*

fabs(C_T(cell,liq)-T_SAT)/T_SAT;

}

if ((m_lg == 0. ) && (C_T(cell, gas) <= T_SAT))

{

m_lg = 0.1*C_VOF(cell,gas)*C_R(cell,gas)*

fabs(T_SAT-C_T(cell,gas))/T_SAT;

}

return (m_lg); }

asghari May 27, 2006 02:58

Re: evaporation in vof
 
thank you , But is this UDF included heat transfer process and may be included this process?


All times are GMT -4. The time now is 21:03.