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

DEFINE_SOURCE boil tutorial

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2007, 12:57
Default DEFINE_SOURCE boil tutorial
  #1
emanuele
Guest
 
Posts: n/a
hello. I have interpreted in Fluent this UDF ( i have founded it in boil tutorial )

#include "udf.h" #include "sg_mphase.h" #define T_SAT 373 define LAT_HT 1.e3 DEFINE_SOURCE(liq_src, cell, pri_th, dS, eqn) { Thread *mix_th, *sec_th; real m_dot_l; mix_th = THREAD_SUPER_THREAD(pri_th); sec_th = THREAD_SUB_THREAD(mix_th, 1);

if(C_T(cell, mix_th)>=T_SAT) {

m_dot_l = -0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)* fabs(C_T(cell, pri_th) - T_SAT)/T_SAT;

dS[eqn] = -0.1*C_R(cell, pri_th)* fabs(C_T(cell, pri_th) - T_SAT)/T_SAT;

}

else {

m_dot_l = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)* fabs(T_SAT-C_T(cell,mix_th))/T_SAT;

dS[eqn] = 0.;

}

return m_dot_l;}

DEFINE_SOURCE(vap_src, cell, sec_th, dS, eqn)

{ Thread * mix_th, *pri_th; real m_dot_v;

mix_th = THREAD_SUPER_THREAD(sec_th); pri_th = THREAD_SUB_THREAD(mix_th, 0);

if(C_T(cell, mix_th)>=T_SAT){ m_dot_v = 0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)* fabs(C_T(cell, mix_th) - T_SAT)/T_SAT; dS[eqn] = 0.; }

else {

m_dot_v = -0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)* fabs(T_SAT-C_T(cell,mix_th))/T_SAT;

dS[eqn] = -0.1*C_R(cell, sec_th)* fabs(C_T(cell, sec_th) - T_SAT)/T_SAT;

return m_dot_v;

}

DEFINE_SOURCE(enrg_src, cell, mix_th, dS, eqn) {

Thread *pri_th, *sec_th;

real m_dot;

pri_th = THREAD_SUB_THREAD(mix_th, 0);

sec_th = THREAD_SUB_THREAD(mix_th, 1);

if(C_T(cell, mix_th)>=T_SAT){

m_dot = -0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*fabs(C_T(cell, pri_th) - T_SAT)/T_SAT;

dS[eqn] = -0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)/T_SAT;

}

else {

m_dot = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*fabs(T_SAT-C_T(cell,mix_th))/T_SAT;

dS[eqn] = -0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)/T_SAT;}

return LAT_HT*m_dot; }

Because i'm only interested in evaporating process ( when temperature reachs Tsat, T >Tsat )and not when T<Tsat, have i to delete the else condition ( T<Tsat )into the three precedents define_source ? Or what can i do?

  Reply With Quote

Old   March 5, 2007, 13:01
Default Re: DEFINE_SOURCE boil tutorial
  #2
emanuele
Guest
 
Posts: n/a
I'm sorry. I'll repeat.

Because i'm only interested in evaporating process ( when temperature reachs Tsat, T >Tsat )and not when T < Tsat, have i to delete the else condition ( T<Tsat )in the precedents define_source udf? Or what can i do?

thanks

  Reply With Quote

Old   March 6, 2007, 04:42
Default Re: DEFINE_SOURCE boil tutorial
  #3
emanuele
Guest
 
Posts: n/a
the problem is that if T < Tsat the model seems doesn't works and isn't stable, while if i patch an initial temperature of 374 ( > Tsat) it works. I'm only interesting in evaporating process and not in consendating, but in my model at the beginning of simulation temperature is < Tsat. How can i modify the udf?
  Reply With Quote

Old   March 11, 2007, 00:45
Default velocity profile
  #4
mohsen soleimani
Guest
 
Posts: n/a
Hi, I am trying to model the fully develop velocity profile with fluent , can yu help me in this field?could you please send for me a udf profile that describe the velocity profile?

  Reply With Quote

Old   March 13, 2007, 15:08
Default Re: DEFINE_SOURCE boil tutorial
  #5
Bak_Flow
Guest
 
Posts: n/a
Dear Emanuele,

I have used this basic 2 phase mass transfer udf but had similar stability problems. It will depend on the case as to what you have to do to make it work but here are some suggestions that I found useful:

1. Always run your case transient (first order if you don't care about accurate time history) as in the tutorial. You can play with time steps and iterations per time step but if all you are interested in is the steady state then just a few iterations per time step are probably all you need.

2. The model has a constant ie 0.1 in: m_dot=0.1*Phi_primary*Density_primary Although this worked for the tutorial case, i found the model a lot more stable if you make this smaller. You can either start off smaller and converge to a solution and "load it up"...sometimes called load stepping or parameter continuuation.

3. The accuracy of your results should be investigated in light of 2 given the physical phenomena you are trying to simulate. The issue is whether the evaporation is limited by mass transfer or if the ability to transfer heat to cell limits the process. You could look at this as the above rate implied a given evaporation rate in a cell. Can the flow or heat transfer keep up to this rate? Does this match the experiment?

Let us know how it works out.

Best Regards,

Bak_Flow
  Reply With Quote

Old   March 13, 2007, 19:38
Default Re: DEFINE_SOURCE boil tutorial
  #6
emanuele
Guest
 
Posts: n/a
hello, thanks for your reply!! Now i have resolved my convergence problem but i have noticed that the evaporation is too fast in comparison to the real case. I have full evaporation of water after only two second. What can i do to make the evaporation slower? can i change something in UDF ? i have put 0,001 instead of 0,1 as relax costant but i haven't noticed many differences in evaporation time. Thanks for your help. emanuele
  Reply With Quote

Old   March 14, 2007, 09:56
Default Re: DEFINE_SOURCE boil tutorial
  #7
Bak_Flow
Guest
 
Posts: n/a
Hi,

what did you do to solve the convergence problems? Did any of the suggestions help?

It looks like you will need a more complicated model for evaporation/boiling. You may have to look at a mass transfer limited case. There you need something like Kl*A(C-C_bulk) Kl-mass transfer coefficient A-area for mass transfer C-equilbrium concentration...say from Henry's law C_buld-concentration in the bulk

.....or something like that??? Have you contacted fluent for ideas on this?

Regards,

Bak_Flow
  Reply With Quote

Old   March 14, 2007, 10:38
Default Re: DEFINE_SOURCE boil tutorial
  #8
emanuele
Guest
 
Posts: n/a
Hello! To improve convergence I have drastically reduced time step and also some under relaxed factor. I have alreay contacted Fluent for ideas on my model.. but they told me that they can't give indications on as to write UDF function. I would like to know if some changes in UDF can increase evaporation time but i really don't know what kind of changes i have to do. Thanks for help Emanuele

  Reply With Quote

Reply


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
Problem on Fluent Tutorial: Horizontal Film Boilig Feng FLUENT 2 April 13, 2013 05:34
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
STAR-CD Tutorial shekhar aryal STAR-CD 4 March 22, 2010 03:25
Rotor/stator tutorial, and how to... gilberto CFX 5 January 21, 2002 09:41


All times are GMT -4. The time now is 00:05.