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

UDF with VOF method to predict evaporation mass/heat flux at vapor-liquid interface

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 16, 2019, 02:48
Default UDF with VOF method to predict evaporation mass/heat flux at vapor-liquid interface
  #1
Senior Member
 
vidyadhar
Join Date: Jul 2016
Posts: 130
Rep Power: 5
vidyadhar is on a distinguished road
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
vidyadhar is offline   Reply With Quote

Old   February 16, 2019, 15:52
Default doesn't fluent already posses boiling model??
  #2
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 5
saddy is on a distinguished road
i dont know anything about udf
however, i think fluent does have rpi boiling model
why not use that?
saddy is offline   Reply With Quote

Old   February 20, 2019, 01:27
Default
  #3
Member
 
Khan
Join Date: Jan 2015
Posts: 32
Rep Power: 6
mohibanwar is on a distinguished road
Quote:
Originally Posted by vidyadhar View Post
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
Hello Vidya dhar,
Are you sure this UDF is working in your problem without any Energy source?
mohibanwar is offline   Reply With Quote

Old   February 20, 2019, 02:00
Default
  #4
Senior Member
 
vidyadhar
Join Date: Jul 2016
Posts: 130
Rep Power: 5
vidyadhar is on a distinguished road
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
vidyadhar is offline   Reply With Quote

Old   February 26, 2019, 06:13
Default
  #5
New Member
 
Rahul Ruia
Join Date: Feb 2019
Posts: 4
Rep Power: 2
ruiarahul is on a distinguished road
Quote:
Originally Posted by vidyadhar View Post
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
you seem to be pretty knowledgeable in multiiphase simulations, can you please help me with simulating capillary effect in a wick region?
ruiarahul is offline   Reply With Quote

Old   February 26, 2019, 06:22
Default
  #6
Senior Member
 
vidyadhar
Join Date: Jul 2016
Posts: 130
Rep Power: 5
vidyadhar is on a distinguished road
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
vidyadhar is offline   Reply With Quote

Old   June 23, 2019, 22:44
Default UDF for condenstion
  #7
Member
 
Soumitra Vadnerkar
Join Date: Aug 2018
Posts: 58
Rep Power: 3
soumitra2102 is on a distinguished road
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
soumitra2102 is offline   Reply With Quote

Old   June 24, 2019, 00:31
Default
  #8
Senior Member
 
vidyadhar
Join Date: Jul 2016
Posts: 130
Rep Power: 5
vidyadhar is on a distinguished road
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
vidyadhar is offline   Reply With Quote

Old   November 4, 2019, 12:23
Question UDF to save the time value when volume fraction in a cell becomes 1
  #9
New Member
 
shivam salokhe
Join Date: Feb 2017
Posts: 9
Rep Power: 4
sshivam is on a distinguished road
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
sshivam is offline   Reply With Quote

Reply

Tags
evaporation, evaporation-interface, hertz–knudsen equation, stefan problem, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
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


All times are GMT -4. The time now is 06:35.