|
[Sponsors] |
How to simulate the process of water evaporation by UDF? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 2, 2009, 21:31 |
How to simulate the process of water evaporation by UDF?
|
#1 |
New Member
qiyang
Join Date: Nov 2009
Posts: 3
Rep Power: 17 |
Here is a UDF program I wrote in order to realize the process of water evaporation in Fluent.The water evaporation occurs as a result of the decrease of pressure in stead of temperature increasement.So,the program is based on the pressure driven theory.A low pressure boundary is also used to develop a low pressure region nearby.
However,when it was hooked to the fluent solver ,it wound't work. Can you help me ? #include "udf.h" /*包括常规宏*/ #include "sg_mphase.h" /*包括体积分数宏*/ #define LAT_HT 2260 /*定义水蒸汽潜热*/ #define pi 3.1415 /*圆周率常数*/ #define R 8.314 /*gas constant 8.314j/mol.K*/ #define moleweight 0.018 /*SI unit water mole weight 0.018kg/mol */ #define A 7.19621 #define B 1730.63 #define C 233.426 DEFINE_SOURCE(liq_src, cell, pri_th, dS, eqn) /*定义液相源项*/ { Thread *mix_th, *sec_th; /*混合相、第二相 定义计算区域指针*/ real m_dot_l; /*蒸发冷凝速率 定义液相质量转移*/ real P_SAT ; mix_th = THREAD_SUPER_THREAD(pri_th); /*指向混合区的主相即液相的指针*/ sec_th = THREAD_SUB_THREAD(mix_th, 1); /* 指向单相控制区的气相的指针*/ P_SAT=exp(A-B/(C_T(cell,pri_th)+C-273.15))*1e3; /*定义饱和蒸汽压与液相温度的关系式,即antoine公式*/ if(C_P(cell, mix_th)< P_SAT) {m_dot_l = -(P_SAT-C_P(cell,sec_th))*sqrt(moleweight)*(2*pi*R*C_T(cel l,pri_th)); /*定义液相向气相转移的速率,如果气相 的压力小于一定温度下的饱和蒸汽压,液 相向气相发生质量转移*/ dS[eqn]= sqrt(moleweight)*(2*pi*R*C_T(cell,pri_th)); /*定义源项对质量转移偏导,fabs为取绝对值*/ } else {m_dot_l = (P_SAT-C_P(cell,sec_th))*sqrt(moleweight)*(2*pi*R*C_T(cel l,pri_th)); /*定义液相向气相转移的速率,如果气 相压力大于一定温度下的饱和蒸汽压,气 相向液相发生质量转移*/ 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; real P_SAT ; mix_th = THREAD_SUPER_THREAD(sec_th); pri_th = THREAD_SUB_THREAD(mix_th, 0); P_SAT=exp(A-B/(C_T(cell,pri_th)+C-273.15))*1e3; if(C_P(cell, mix_th)< P_SAT) { m_dot_v = (P_SAT-C_P(cell,sec_th))*sqrt(moleweight)*(2*pi*R*C_T(cel l,pri_th)); dS[eqn] =0; } else {m_dot_v = -(P_SAT-C_P(cell,sec_th))*sqrt(moleweight)*(2*pi*R*C_T(cel l,pri_th)); dS[eqn]=sqrt(moleweight)*(2*pi*R*C_T(cell,pri_th)); } return m_dot_v; } DEFINE_SOURCE(enrg_src, cell, mix_th, dS, eqn) { Thread *pri_th,*sec_th; real m_dot; real P_SAT; pri_th=THREAD_SUB_THREAD(mix_th,0); sec_th=THREAD_SUB_THREAD(mix_th,1); P_SAT=exp(A-B/(C_T(cell,pri_th)+C-273.15))*1e3; if(C_P(cell, mix_th)< P_SAT) { m_dot =- (P_SAT-C_P(cell,sec_th))*sqrt(moleweight)*(2*pi*R*C_T(cel l,pri_th)); dS[eqn]=sqrt(moleweight)*(2*pi*R*C_T(cell,pri_th)); } else { m_dot = (P_SAT-C_P(cell,sec_th))*sqrt(moleweight)*(2*pi*R*C_T(cel l,pri_th)); dS[eqn]=-sqrt(moleweight)*(2*pi*R*C_T(cell,pri_th)); } return LAT_HT*m_dot; } DEFINE_PROFILE(pressure_out,t,i) {real x[ND_ND]; real y; face_t f; begin_f_loop(f,t) {F_CENTROID(x,f,t); y=x[1]; F_PROFILE(f,t,i)=0.5e5; } end_f_loop(f,t) } |
|
April 1, 2010, 10:11 |
formula about evaporation!
|
#3 |
New Member
|
Hi!
Have your problem solved? I'm interesting in the problem of evaporation as yours. After reading your programme, I have a question about the formula(m_dot_l = -(P_SAT-C_P(cell,sec_th))*sqrt(moleweight)*(2*pi*R*C_T(cel l,pri_th)), which literature include this? Looking forward to your reply! Thanks! |
|
April 5, 2010, 05:45 |
|
#4 |
Member
Robert
Join Date: Feb 2010
Location: Germany
Posts: 32
Rep Power: 16 |
Hi
Why not using the cavitation-models, already included in FLUENT? You can use Singhal, Schnerr-Sauer and Zwart-Gerber-Belamri there. Greetings |
|
April 6, 2010, 08:41 |
|
#5 | |
New Member
|
Quote:
Thank you for your suggestion. In my opinion, the mechanism of evaporation in the cavitation is different from flash evaporation. Maybe I am wrong, I will learn about the cavitation-models. Are you familiar with cavitation? beauty |
||
April 6, 2010, 09:31 |
|
#6 | |
Member
Robert
Join Date: Feb 2010
Location: Germany
Posts: 32
Rep Power: 16 |
Hi
What is 'flash evaporation' ? You mean temperature-driven evaporation? Quote:
If the pressure falls under a critical value, evaporation occurs. If the pressure is increasing downstream, the bubbles collapse (condensation) and locally you get really big values of temperature and pressure (its like an implosion). Just look over the FLUENT user-guide or ask me again. Maybe I can help. Greetings |
||
April 7, 2010, 23:38 |
|
#7 |
New Member
|
Hi
Flash evaporation is pressure-driven evaporation. When the saturated liquid (for example, liquid Hydrogen under high pressure) is released into atmosphere, most or all of the liquid immediately "flashes" into vapor, resulting in decrease of the system temperature. I wonder if the cavitation model can be helpful. Thanks Beauty |
|
August 25, 2010, 03:49 |
evaporation
|
#8 |
New Member
Rana
Join Date: Apr 2010
Posts: 10
Rep Power: 16 |
qiyang
Is your's a constant temperature or varying temperature model, i need to write a udf for evaporation ocuring by means of decreasing pressure which in turn decreases the temperature. can u help me... |
|
March 6, 2011, 02:48 |
|
#9 |
Senior Member
|
||
March 6, 2011, 02:58 |
|
#10 | |
Senior Member
|
Quote:
? |
||
January 9, 2015, 14:59 |
Udf
|
#11 | |
Member
Muhammed Asmail
Join Date: Nov 2009
Location: Iraq
Posts: 43
Rep Power: 17 |
Quote:
did you reach to best solution? Please I need UDF |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Evaporation of water... help needed!! | Arpit | FLUENT | 2 | September 10, 2007 11:04 |
Water Evaporation and condensation modeling | Linjie | CFX | 6 | May 24, 2007 15:55 |
How to simulate the water hammer pressure. | arwang | FLUENT | 0 | March 12, 2007 08:07 |
How to use CFX to simulate sand casting process ? | Cong Phung Chi | CFX | 2 | April 13, 2006 00:34 |
Use smoke density to simulate water | Wei-zhi Liao | Main CFD Forum | 0 | February 13, 2006 04:06 |