|
[Sponsors] |
May 26, 2013, 10:48 |
boiling in pipe (UDF)
|
#1 |
Senior Member
ahmad
Join Date: Feb 2012
Posts: 101
Rep Power: 14 |
Hi all .
I go throug this UDF for simulation a boiling in pipe , my questions is : 1- is this UDF general for all boiling . ( i get it from fluent tutorials ) 2- if its not general , is the mass transfer source from 2 phases is same ? i mean is general ? 3-should i use the initializing flow field variables ? #include"udf.h" #include"sg.h" #include"sg_mphase.h" #include"flow.h" #include"mem.h" /************************************************** ************/ /* UDF for specifying an interfacail area density */ /************************************************** ************/ 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); } { Alloc_Storage_Vars(domain, SV_T_RG, SV_T_G, SV_NULL); T_derivatives(domain); Free_Storage_Vars(domain, SV_T_RG, SV_NULL); } mp_thread_loop_c (t,domain,pt) if (FLUID_THREAD_P(t)) { Thread *tp = pt[P_PHASE]; begin_c_loop (c,t) { #if RP_3D C_UDMI(c,t,0) = (C_VOF_G(c,tp)[0]*C_T_G(c,t)[0]+ C_VOF_G(c,tp)[1]*C_T_G(c,t)[1]+C_VOF_G(c,tp)[2]*C_T_G(c,t)[2]); #endif #if RP_2D C_UDMI(c,t,0) = (C_VOF_G(c,tp)[0]*C_T_G(c,t)[0]+ C_VOF_G(c,tp)[1]*C_T_G(c,t)[1]); #endif } end_c_loop (c,t) } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL); Free_Storage_Vars(domain, SV_T_G, SV_NULL); } DEFINE_SOURCE(gas, cell, thread, dS, eqn) { real x[ND_ND]; real source; Thread *tm = THREAD_SUPER_THREAD(thread); Thread **pt = THREAD_SUB_THREADS(tm); real Kl = C_K_L(cell, pt[1])*C_VOF(cell, pt[1]), Kg = C_K_L(cell, pt[0])*C_VOF(cell, pt[0]); real L = 1e5; source = (Kl+Kg)*C_UDMI(cell,tm,0) / L; C_UDMI(cell, tm, 1) = source; C_UDMI(cell, tm, 2) = -source*L; dS[eqn] =0; return source; } DEFINE_SOURCE(liquid, cell, thread, dS, eqn) { real x[ND_ND]; real source; Thread *tm = THREAD_SUPER_THREAD(thread); Thread **pt = THREAD_SUB_THREADS(tm); source = -C_UDMI(cell, tm, 1); dS[eqn] = 0; return source; } DEFINE_SOURCE(energy, cell, thread, dS, eqn) { real x[ND_ND]; real source; Thread *tm = thread; source = C_UDMI(cell, tm, 2); dS[eqn] = 0; return source; } /************************************************** *********************/ /* UDF for initializing flow field variables */ /************************************************** *********************/ DEFINE_INIT(my_init_function, domain) { Thread *t; Thread **pt; Thread **st; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE); Domain *sDomain = DOMAIN_SUB_DOMAIN(domain,S_PHASE); real xc[ND_ND], y, x; mp_thread_loop_c (t,domain,pt) if (FLUID_THREAD_P(t)) { Thread *tp = pt[P_PHASE]; begin_c_loop (c,t) { C_CENTROID(xc,c,t); x=xc[0]; y=xc[1]; if ( y < 0.00292 + 0.0006*cos(6.283*x/0.0778) ) C_VOF(c,tp) = 1; else C_VOF(c,tp) = 0; } end_c_loop (c,t) } mp_thread_loop_c (t,domain,st) if (FLUID_THREAD_P(t)) { Thread *sp = st[S_PHASE]; begin_c_loop (c,t) { C_CENTROID(xc,c,t); x=xc[0]; y=xc[1]; if ( y < 0.00292 + 0.0006*cos(6.283*x/0.0778) ) C_VOF(c,sp) = 0; else C_VOF(c,sp) = 1; } end_c_loop (c,t) } } |
|
May 27, 2013, 01:14 |
|
#2 |
Senior Member
ahmad
Join Date: Feb 2012
Posts: 101
Rep Power: 14 |
any body have any idea ?
|
|
November 13, 2016, 07:54 |
Boiling in Co-axial pipes
|
#3 |
New Member
Nabeel
Join Date: May 2016
Posts: 4
Rep Power: 10 |
Hello
It looks like you did'nt get any help. Same is the case with me. However, you may have solved the problem by yourself. I want to ask from you that do we always need a UDF for boiling. My case is simply boiling of water in pipe with heat coming from annulus pipe. Can you please explain? I did a simulation of water boiling with constant heat flux without using a UDF. Tell me if I did wrong by not using UDF ? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[DesignModeler] DesignModeler Pipe within pipe | shields | ANSYS Meshing & Geometry | 13 | November 25, 2018 23:14 |
BOILING HEAT TRANSFER COEFFICIENT | John | FLUENT | 1 | September 4, 2013 08:57 |
Simulation with UDF for species mass fraction and velocity profile | virgy | Fluent UDF and Scheme Programming | 8 | February 7, 2012 05:30 |
-What udf macro for boiling - | thomas | FLUENT | 6 | January 19, 2004 08:31 |
DEFINE_DPM_OUTPUT macro UDF HELP | Puneet | FLUENT | 3 | November 28, 2003 11:55 |