|
[Sponsors] |
UDF with VOF method to predict evaporation mass/heat flux at vapor-liquid interface |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 16, 2019, 02:48 |
UDF with VOF method to predict evaporation mass/heat flux at vapor-liquid interface
|
#1 |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
Hi Everyone,
Taking the help of online forums, I have managed to write an UDF that predicts evaporation mass/heat flux at the vapor-liquid interface using VOF method of Fluent.The evaporation flux equation is Hertz-Knudsen-Schrage Equation simplified according to Tanasawa's linearization as mentioned in Hardt and Wondra, J.Compt.Physics 227(2008) 5871-5895. But, I am facing problems in validating this UDF with literature such as Stefan Problem. Stefan problem involves movement of the interface between a superheated vapor and saturated liquid due to the evaporation of liquid; heat being supplied from a hot wall through the vapor phase. By running the following UDF, the interface is moving but with higher speed than predicted by analytical solution of Stefan problem. I request anyone to help me- if there is any mistake in the UDF code. ******************************************* ******************************************* #include "udf.h" #define T_SAT 373.15 /*to store gradient of volume fraction of primary phase, DEFINE_ADJUST macro has been used*/ DEFINE_ADJUST(my_adjust, mixture_domain) { int phase_domain_index=0.; Thread *t; Thread **pt; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(mixture_domain,phase_domain_inde x); { 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,mixture_domain,pt) if (FLUID_THREAD_P(t)) { Thread *ppt = pt[phase_domain_index]; begin_c_loop (c,t) { C_UDMI(c,t,0)=NV_MAG(C_VOF_G(c,ppt)); } end_c_loop (c,t) } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL); } /*This macro is used to apply mass and heat exchange between vapor and liquid phases*/ DEFINE_MASS_TRANSFER(liq_gas_source,c,t,from_index ,from_species_index,to_index,to_species_index) { Thread *gas=THREAD_SUB_THREAD(t,to_index); Thread *liq=THREAD_SUB_THREAD(t,from_index); real source; if (C_VOF(c,liq)!=0.0 && C_VOF(c,liq)!=1.0 && C_UDMI(c,t,0)!=0) { source=5.150461258e-05*(C_T(c,t)-T_SAT)*(C_UDMI(c,t,0)); /*mass transfer rate flux = constant X (Ti-Tsat); Ti is interface temperature */ return source; } } Thanks in advance! Vidyadhar Last edited by vidyadhar; January 22, 2019 at 00:10. Reason: text has been edited |
|
February 16, 2019, 15:52 |
doesn't fluent already posses boiling model??
|
#2 |
Senior Member
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 10 |
i dont know anything about udf
however, i think fluent does have rpi boiling model why not use that? |
|
February 20, 2019, 01:27 |
|
#3 | |
Member
Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 11 |
Quote:
Are you sure this UDF is working in your problem without any Energy source? |
||
February 20, 2019, 02:00 |
|
#4 |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
Hi,
I understand that the macro DEFINE_MASS_TRANSFER will account for mass and energy source terms in the respective equations. In that way, it should estimate energy sources. However, I could not get the desired result by using the above UDF and I am still working on it. Thanks & Regards, Vidyadhar |
|
February 26, 2019, 06:13 |
|
#5 | |
New Member
Rahul Ruia
Join Date: Feb 2019
Posts: 4
Rep Power: 7 |
Quote:
|
||
February 26, 2019, 06:22 |
|
#6 |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
Hello Rahul,
I have just started learning multiphase flows. Currently I am not fully involved in it. In future I may study them at length. I do not know about the simulation of capillary effect etc. You may please take the help of experts in that area. Thanks & Regards, Vidyadhar |
|
June 23, 2019, 22:44 |
UDF for condenstion
|
#7 |
Member
Soumitra Vadnerkar
Join Date: Aug 2018
Posts: 70
Rep Power: 8 |
Hi Vidyadhar,
Can this UDF be useful for simulating condensation phenomenon as well? If not, then can you please suggest me anything? Fluent's VoF+Evapo-Conden model did not gave me any considerable condensaton volume fraction. Thanks -Soumitra |
|
June 24, 2019, 00:31 |
|
#8 |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
Hello Soumitra,
I think it should be valid for condensation as well. You may have to slightly modify the UDF to suit the physics of condensation. Once it is validated with some proven results, you can rely on it. As of now, it just works. But, it should be validated. All the best! vidyadhar |
|
November 4, 2019, 12:23 |
UDF to save the time value when volume fraction in a cell becomes 1
|
#9 |
New Member
shivam salokhe
Join Date: Feb 2017
Posts: 10
Rep Power: 9 |
Hello,
can anyone please guide regarding the UDF that saves the time value for a cell when the volume fraction becomes 1. I am using VOF method. Thanks |
|
March 23, 2020, 04:57 |
|
#10 | |
New Member
Chuang-Yao Zhao
Join Date: Mar 2020
Posts: 1
Rep Power: 0 |
Quote:
Hi Vidyadhar, Have you solved your problem? I am using Tanasawa's model in simulation of falling film evaporation through the similar UDF. But I am not sure the realibility of the calculation of vof gradient or the |alpha|. Because the temperature is too large. Any suggestion? Thanks |
||
March 24, 2020, 00:55 |
|
#11 |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
Hello Zhao,
I think the gradient estimation is correct. But, I have not validated it yet. In future I have to work on this. Thanks |
|
January 1, 2021, 12:08 |
Regarding writing UDF on Boiling flow in Ansys
|
#12 |
New Member
Gujarat
Join Date: Jul 2020
Posts: 6
Rep Power: 6 |
Hello Sir, Have you solved the problem of UDF for boiling flow analyses. ?
|
|
January 1, 2021, 12:10 |
|
#13 |
New Member
Gujarat
Join Date: Jul 2020
Posts: 6
Rep Power: 6 |
Hello Sir, Have you solved the problem of UDF for boiling flow analyses. ?
|
|
January 2, 2021, 02:32 |
|
#14 |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
||
January 5, 2021, 01:07 |
|
#15 |
New Member
Gujarat
Join Date: Jul 2020
Posts: 6
Rep Power: 6 |
Hello sir, You have stored the gradient of volume fraction in C_UDMI(c,t,0). How do you ensure that this gradient value is positive always. ?
My another question is source term in continuity equation is multiply with ((1/rhoV)-(1/rhoL)) and in energy equation it is multiply with (hlv-(Cpv-Cpl)T). (reference paper: M.Magnini et al./IJHMT). So in your UDF, how do you ensure that this source term what you have calculated is mulitply with respective term in continity and energy equation? |
|
January 5, 2021, 02:01 |
|
#16 | |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
Quote:
2. I have used the simplified equation (Tanasawa model). The evaporation flux equation is Hertz-Knudsen-Schrage Equation simplified according to Tanasawa's linearization as mentioned in Hardt and Wondra, J.Compt.Physics 227(2008) 5871-5895. Other ref: https://docs.lib.purdue.edu/cgi/view..._dissertations https://cpb-us-e2.wpmucdn.com/facult...Phase-2017.pdf Regards, Vidyadhar |
||
January 5, 2021, 02:06 |
|
#17 |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
Correction to the original post:
Instead of DEFINE_Mass_Transfer, we should use DEFINE_SOURCE for adding source terms in continuity and energy equations. |
|
January 5, 2021, 03:38 |
|
#18 |
New Member
Gujarat
Join Date: Jul 2020
Posts: 6
Rep Power: 6 |
Sir, when I am Interpreting your udf in fluent, I am getting an error in udf. .. "Scalar_Reconstruction: undeclared variable"
I also found one udf in ansys manual for to store the gradient value of volume fraction.. UDMs are often used to store diagnostic values derived from calculated values of a UDS. Below is an example that shows a technique for plotting the gradient of any flow variable. In this case, the volume fraction of a phase is loaded into a user scalar. If an iteration is made such that the UDS is not calculated, the gradients of the scalar will nevertheless be updated without altering the values of the user scalar. The gradient is then available to be copied into a User Memory variable for displaying. # include "udf.h" # define domain_ID 2 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f; domain = Get_Domain(domain_ID); /* Fill UDS with the variable. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDSI(c,t,0) = C_VOF(c,t); } end_c_loop (c,t) } thread_loop_f (t,domain) { if (THREAD_STORAGE(t,SV_UDS_I(0))!=NULL) begin_f_loop (f,t) { F_UDSI(f,t,0) = F_VOF(f,t); } end_f_loop (f,t) } } DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; Thread *t; domain=Get_Domain(1); /* Fill the UDM with magnitude of gradient. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); } end_c_loop (c,t) } } Can we use this code for store the gradient value of volume fraction ? |
|
January 6, 2021, 22:27 |
|
#19 |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
You might not have defined any variable. pls search for the error over internet.
Also please test UDFs (eg. Gradient calculation - given in the first post and as mentioned in Fluent UDF manual) by comparing the results with any standard numerical/experimental results |
|
March 2, 2022, 13:41 |
|
#20 | |
New Member
Ejaz Ahmed
Join Date: May 2021
Posts: 7
Rep Power: 5 |
Quote:
Hello vidyadhar, have you been able to validate this UDF? I was looking into the CFD forums to find a way how to implement a "constant" evaporation source term on the vapor-liquid interface with VOF method in Fluent. I think I just need to add a constant in the "source" variable that you declared. But I don't know where exactly should I put this UDF. Can you please guide me how I can use this UDF in Fluent so that the source terms are consistent with continuity, momentum & energy equation? Also, should I add a species transport equation to see the vapor transport in the gas phase? Thanks in advance for your help! |
||
Tags |
evaporation, evaporation-interface, hertz–knudsen equation, stefan problem, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field | xiexing | CFX | 3 | March 29, 2017 11:00 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
UDF to propagat VOF interface at a specified speed | Johann | FLUENT | 1 | May 27, 2006 12:39 |
interface reconstruction in Fluent VOF method? | daniel | FLUENT | 0 | May 4, 2006 04:46 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |