CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

DEFINE_MASS_TRANSFER evaporation

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

Like Tree3Likes
  • 1 Post By emanuele
  • 1 Post By dokeun
  • 1 Post By Nikolopoulos

Reply
 
LinkBack Thread Tools Display Modes
Old   February 27, 2007, 13:15
Default DEFINE_MASS_TRANSFER evaporation
  #1
emanuele
Guest
 
Posts: n/a
hello, I have to simulate the mass transfer due to evaporation in Fluent and i should do it with DEFINE_MASS_TRANSFER udf. I have a plain surface with water on the top and a flow of hot air is passing over the water. Some amount of water is evaporated and converted in water vapor in air phase. I use VOF model to model water and air phase ( air phase is a mixture of water vapor and air ). Do someone has an example of DEFINE_MASS_TRANSFER udf, based on saturation temperature, to model transfer of water in water phase to water vapor in air phase ? ( i have to use it in phase interaction panel )

Please help me Thanks

  Reply With Quote

Old   February 28, 2007, 12:22
Default Re: DEFINE_MASS_TRANSFER evaporation
  #2
emanuele
Guest
 
Posts: n/a
i have written this UDF ( i have found it in UDF manual )

/* 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); }

When i interpret it in Fluent, it works. So i define a mass transfer mechanism in phase interaction panel between phase 2 (water liquid) and phase 1, species h20. When i start my unsteady simulation fluent send message:

Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: ()

What kind of error is this ?

Please help me, thanks

  Reply With Quote

Old   February 28, 2007, 12:48
Default Re: DEFINE_MASS_TRANSFER evaporation
  #3
Sujith
Guest
 
Posts: n/a
the udf is accessing some memory which is not allocated. for example you are accessing the value of velocity at mixture thread, where velocity is defined for phase thread...

You may debug ur udf by commenting or printing a message and find out the problematic area...
  Reply With Quote

Old   February 28, 2007, 13:12
Default Re: DEFINE_MASS_TRANSFER evaporation
  #4
emanuele
Guest
 
Posts: n/a
But i have interpreted udf in fluent and fluent doesn't send any error message. I'm very confused, what is wrong ?
  Reply With Quote

Old   February 28, 2007, 15:41
Default Re: DEFINE_MASS_TRANSFER evaporation
  #5
Sujith
Guest
 
Posts: n/a
interpretor will work; it just checks whether the code is correct in wrt c standards. But fluent may not digest some part and it gives you the error message.
  Reply With Quote

Old   March 1, 2007, 00:59
Default Re: DEFINE_MASS_TRANSFER evaporation
  #6
JIE
Guest
 
Posts: n/a
You'd better to use compile mode instead of interpretor
  Reply With Quote

Old   March 1, 2007, 11:28
Default Re: DEFINE_MASS_TRANSFER evaporation
  #7
emanuele
Guest
 
Posts: n/a
Thanks for the reply. I couldnt understand the UDF example for mass transfer. In the following UDF it says that the mass transfer takes place gas to liquid and the magnitude is negative.

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

{

m_lg = -0.1*C_VOF(cell,liq)*C_R(cell,liq)*fabs(C_T(cell,li q)-T_SAT)/T_SAT;

}

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

{

I'm interested only in mass transfer from liquid to gas. Can I remove the negative sign and change the mass transfer direction from liq to gas? Or have i to delete the second if condition but not removing negative sign ? thanks for help
  Reply With Quote

Old   March 2, 2007, 13:36
Default Re: DEFINE_MASS_TRANSFER evaporation
  #8
Sujith
Guest
 
Posts: n/a
the value of m_lg will be passed to the Phase interactions panel; there u can see how is the mass transfer defined, from where to where. If the value is -ve then mass transfer will take place in the opp. direction to that defined in the phase interactions panel.
  Reply With Quote

Old   March 4, 2007, 13:06
Default Re: DEFINE_MASS_TRANSFER evaporation
  #9
emanuele
Guest
 
Posts: n/a
thanks a lot! In phase interaction panel i define one mass transfer mechanism FROM water liquid TO water vapor defining this udf DEFINE_MASS_TRANSFER :

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

}

return (m_lg); } It should be correct? I use mixture mode, k-eps RNG; the problem is that it's very difficult to reach convergence, i have to use time step size of 1e-06. I have also tried to decrease under relaxed factor and change pressure velocity coupling and discretization but i don't know exactly what to do to improve convergence. Because the return value of m_lg in UDF is kg/m3/second have i to wait the solution for first second to begin to see water phase fraction decreasing ?

kkaral likes this.
  Reply With Quote

Old   October 26, 2009, 03:20
Default
  #10
New Member
 
Narayansing
Join Date: Mar 2009
Location: Mysore
Posts: 8
Rep Power: 9
chhanwal is on a distinguished road
I think we have to rewrite whole programme in different manner if we need mass transfer from liquid to gas phase

Last edited by chhanwal; October 27, 2009 at 00:43.
chhanwal is offline   Reply With Quote

Old   November 24, 2009, 07:49
Default
  #11
New Member
 
pinho
Join Date: May 2009
Posts: 22
Rep Power: 9
jpinho is on a distinguished road
Hello there!!!

Can anyone explain me the use of the following equation:

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

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

What is the ideia of the factor 0.1? And how can be this equation phisically intrepertated?

Thanks
Jorge
jpinho is offline   Reply With Quote

Old   January 19, 2011, 22:54
Default you can find that coefficient in theory guide
  #12
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Posts: 71
Rep Power: 8
dokeun is on a distinguished road
Coefficient 0.1 is default value commented in theory guide.
Just what i'm wondering is whether the mass-transfer equ represented in this thread is applicable to VOF.
And I think there should be energy transfer between phases during evaporation.

Quote:
Originally Posted by jpinho View Post
Hello there!!!

Can anyone explain me the use of the following equation:

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

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

What is the ideia of the factor 0.1? And how can be this equation phisically intrepertated?

Thanks
Jorge
6863523 likes this.

Last edited by dokeun; January 19, 2011 at 23:42.
dokeun is offline   Reply With Quote

Old   January 21, 2011, 13:16
Default
  #13
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 7
Nikolopoulos is on a distinguished road
dokeun is right!

You should incorporate with heat sources the effect on energy equation for sure!
You can do it by storing the rate of the mass tranfer in a C_UDMI (user defined memory).

One question: If you put
return 0;
in the end does it still report an error?
If no, some value goes to infinity
6863523 likes this.
Nikolopoulos is offline   Reply With Quote

Old   January 23, 2011, 23:51
Default
  #14
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Posts: 71
Rep Power: 8
dokeun is on a distinguished road
Hello Nikolopoulos
I didn't figure out your question exactly. this is your experience or expectation.
But if this is your hypotheses.
If you mean "return 0;" is there is no mass transfer between the phases on a cell then there shouldn't be source term(mass&energy) due to phase change.
The reason you mentioned about going infinity of some value may be, in my guess, because you assumed that restored mass source for one cell (in a C_UDMI) is not changed during iteration. but the value keeps change during the iteration and if there is no mass transfer(mass source term is zero) by evaporation then energy source for the cell at that time is zero.

Good luck to you and me
Quote:
Originally Posted by Nikolopoulos View Post
One question: If you put
return 0;
in the end does it still report an error?
If no, some value goes to infinity
dokeun is offline   Reply With Quote

Old   January 24, 2011, 03:39
Default
  #15
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 7
Nikolopoulos is on a distinguished road
If i understand correctly, your code compiles, and runs a few iterations.

If you make a test and return zero from this UDF and you don't have any fluent crash downs the problem would probably be a division by zero or something like that. As good policy you should put an upper and lower bound for your variable that is returned.

If it stills crashes down, it means that either the model is not well developed in Fluent or there is a violating statement in your UDF.


Another idea is to check in your code if C_VOF(cell,liq) is greater than 10^-6. If "yes" proceed with your calculations and if "NO" then return zero.
Nikolopoulos is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Evaporation model in ansys Fluent 12.1 oldisbest Fluent UDF and Scheme Programming 9 June 13, 2013 22:44
Evaporation due to Heat Transport using InterFoam (Correct Implementation?) ovie OpenFOAM 12 December 16, 2011 10:44
Question:Considerations about the evaporation in VOF dokeun FLUENT 10 February 24, 2011 21:47
CFX Liquid Evaporation Model Jinx CFX 3 January 28, 2010 17:31
Defining Evaporation - A How To Guide. Owen FLUENT 1 July 25, 2005 09:56


All times are GMT -4. The time now is 20:46.