- 
		
			- 
October 17, 2018 at 8:13 ammonaqu.1205 SubscriberHow do I modify the boiling.c code to account for level set method along with VOF model for horizontal film boiling tutorial given by fluent?? 
- 
October 17, 2018 at 9:02 amRob Forum ModeratorIn what way do you want to modify the code? It'd probably help if you posted the UDF too. 
- 
October 17, 2018 at 9:41 ammonaqu.1205 SubscriberI would like to include Level-set method for calculating surface tension at the interface for film boiling. I am attaching the standard code provided by ansys for film boiling using VOF model is attached below:Â Â 
 #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_NULL); 
 Â 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_NULL); 
 Â 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) 
 Â Â Â Â Â } 
 Â 
 } 
- 
October 17, 2018 at 10:20 amAmine Ben Hadj Ali Ansys EmployeeThe CLSVOF implementation in Fluent does not support mass transfer. Adding that would require a lot of efforts. 
- 
October 17, 2018 at 11:47 amKarthik Remella AdministratorHello, 
 just a curious question - is there a reason why you would like to add level set to this UDF? 
 thanks. 
 Best Regards, 
 Karthik 
- 
October 18, 2018 at 4:41 ammonaqu.1205 SubscriberIn CLSVOFÂ method, I would be using VOF model to calculate mass transfer whereas level set method will be used to calculate surface tension force. 
 Â 
 So can you help me in modifying the code for CLSVOF? 
- 
October 18, 2018 at 4:45 ammonaqu.1205 SubscriberHello, 
 I want to include Level set method to calculate Surface tension force. 
- 
October 18, 2018 at 4:57 amAmine Ben Hadj Ali Ansys EmployeeYou can calculate Surface tension force without using the Level Set Method. The step to include mass transfer effects for CLSVOF is not easy and requires a lot of efforts and some deep knowledge of C programming, parallelization and UDF. As ANSYS Stuff we cannot help here. Perhaps a community member might help you here out. 
- 
October 18, 2018 at 9:21 ammonaqu.1205 SubscriberC programming and parallelization is not an issue. I'm positive, I can handle it. 
 However, I need to know what modifications are required in UDF. 
- 
October 18, 2018 at 10:31 amRob Forum ModeratorSimply (and that's as far as we're going as staff) you need to ID the cell with the free surface and add/remove material from the phases based on local temperature etc.  
- 
December 13, 2018 at 10:46 amamaligaadi2018 SubscriberHi monaqu.1205, I have same difficulty in the implementation of CLSVOF, please have you solved the problem and how did you do it? 
- 
July 28, 2019 at 10:17 amshadman Subscribercan anyone provide me with the test-2d.msh.gz boiling.c files for the tutorial of nucleate boiling? 
- 
July 29, 2019 at 2:35 pmRob Forum ModeratorThey'll be on the ANSYS Learning Hub, so you'll need to get access to that: we can't supply them. 
 
- 
- The topic ‘Film Boiling’ is closed to new replies.
- air flow in and out of computer case
- Varying Bond model parameters to mimic soil particle cohesion/stiction
- Eroded Mass due to Erosion of Soil Particles by Fluids
- I am doing a corona simulation. But particles are not spreading.
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- Issue to compile a UDF in ANSYS Fluent
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
- 
                        
                        4167
- 
                        
                        1487
- 
                        
                        1358
- 
                        
                        1189
- 
                        
                        1021
© 2025 Copyright ANSYS, Inc. All rights reserved.
 You are navigating away from the AIS Discovery experience
You are navigating away from the AIS Discovery experience 
               
          