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

Evaporation appears but condensation doesn't

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2016, 06:56
Default Evaporation appears but condensation doesn't
  #1
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
Hi everyone,
I implemented Lee model in the following UDF:
Code:
#include "udf.h"
#include "sg_mphase.h"
#include "mem.h"
#include "metric.h"
#include "flow.h"
#include "sg.h"

DEFINE_SOURCE(vap_src, cell, vap_th, dS, eqn)
{
    real m_dot_v;
    const real T_SAT = 373.0;
    Thread *mix_th, *liq_th;
    mix_th = THREAD_SUPER_THREAD(vap_th);
    vap_th = THREAD_SUB_THREAD(mix_th, 0);
    liq_th = THREAD_SUB_THREAD(mix_th, 1);
    m_dot_v = 0.0;
    if (C_T(cell, mix_th) > T_SAT)
    {
        //Message("Jestem w if vap\n");
        m_dot_v = 0.1*C_R(cell, liq_th)*C_VOF(cell, liq_th)*(C_T(cell, mix_th) - T_SAT)/T_SAT;
        //m_dot_v = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*(C_T(cell, mix_th) - T_SAT) / T_SAT;
        dS[eqn] = 0.0;
        //dS[eqn] = 0.1*C_R(cell, liq_th)*C_VOF(cell, liq_th)/T_SAT;
        //Message("VOF = %f", C_VOF(cell, liq_th), " \n");
        //Message("T = %f", C_T(cell, mix_th), " \n");
        //Message(" m_dot_v = %f%s", m_dot_v, "\n");
    }
    else 
    {
        //Message("Jestem w else vap\n");
        m_dot_v = -0.1*C_R(cell, vap_th)*C_VOF(cell, vap_th)*(T_SAT - C_T(cell, mix_th))/T_SAT;
        //m_dot_v = -0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*(T_SAT - C_T(cell, mix_th)) / T_SAT;
        //dS[eqn] = -0.1*C_R(cell, pri_th)*(T_SAT - C_T(cell, mix_th)) / T_SAT;
        dS[eqn] = 0.0;
        //dS[eqn] = 0.1*C_R(cell, vap_th)*C_VOF(cell, vap_th)/T_SAT;
        //Message("VOF = %f", C_VOF(cell, vap_th), " \n");
        //Message("T = %f", C_T(cell, mix_th), " \n");
        //Message(" m_dot_v = %f%s", m_dot_v, "\n");
    }
    //Message(" M_DOT_v = %f%s", m_dot_v, "\n");
    return m_dot_v;
}
DEFINE_SOURCE(liq_src, cell, liq_th, dS, eqn)
{
    real m_dot_l;
    const real T_SAT = 373.0;
    Thread *mix_th, *vap_th;
    mix_th = THREAD_SUPER_THREAD(liq_th);
    vap_th = THREAD_SUB_THREAD(mix_th, 0);
    liq_th = THREAD_SUB_THREAD(mix_th, 1);
    m_dot_l = 0.0;
    if (C_T(cell, mix_th) > T_SAT)
    {
        //Message("Jestem w if liq\n");
        m_dot_l = -0.1*C_R(cell, liq_th)*C_VOF(cell, liq_th)*(C_T(cell, mix_th) - T_SAT)/T_SAT;
        //m_dot_l = -0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*(C_T(cell, mix_th) - T_SAT) / T_SAT;
        dS[eqn] = 0.0; //-0.1*C_R(cell, sec_th)*(C_T(cell, mix_th) - T_SAT) / T_SAT;
        //dS[eqn] = -0.1*C_R(cell, liq_th)*C_VOF(cell, liq_th)/T_SAT;
        //Message("VOF = %f", C_VOF(cell, liq_th), " \n");
        //Message("T = %f", C_T(cell, mix_th), " \n");
        //Message(" m_dot_l = %f%s", m_dot_l, "\n");
    }
    else 
    {
        //Message("Jestem w else liq\n");
        m_dot_l = 0.1*C_R(cell, vap_th)*C_VOF(cell, vap_th)*(T_SAT - C_T(cell, mix_th))/T_SAT;
        //m_dot_l = 0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*(T_SAT - C_T(cell, mix_th)) / T_SAT;
        dS[eqn] = 0.0;
        //dS[eqn] = -0.1*C_R(cell, vap_th)*C_VOF(cell, vap_th)/T_SAT;
        //("VOF = %f", C_VOF(cell, vap_th), " \n");
        //Message("T = %f", C_T(cell, mix_th), " \n");
        //Message(" m_dot_l = %f%s", m_dot_l, "\n");
    }
    //Message(" M_DOT_l = %f%s", m_dot_l, "\n");
    return m_dot_l;
}
DEFINE_SOURCE(enrg_src, cell, mix_th, dS, eqn)
{
    real enrg_dot = 0.0;
    const real T_SAT = 373.0;
    const real LAT_HT = 2200e3;
    Thread *vap_th, *liq_th;
    vap_th = THREAD_SUB_THREAD(mix_th, 0);
    liq_th = THREAD_SUB_THREAD(mix_th, 1);
    if (C_T(cell, mix_th) > T_SAT)
    {
        enrg_dot = -0.1*C_VOF(cell, liq_th)*C_R(cell, liq_th)*LAT_HT*(C_T(cell, mix_th) - T_SAT)/T_SAT;
        dS[eqn] = 0.0;//-0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*LAT_HT / T_SAT;
        //dS[eqn] = -0.1*C_VOF(cell, liq_th)*C_R(cell, liq_th)*LAT_HT/T_SAT;
    }
    else 
    {
        enrg_dot = 0.1*C_VOF(cell, vap_th)*C_R(cell, vap_th)*LAT_HT*(T_SAT - C_T(cell, mix_th))/T_SAT;
        dS[eqn] = 0.0;//-0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*LAT_HT / T_SAT;
        //dS[eqn] = -0.1*C_VOF(cell, vap_th)*C_R(cell, vap_th)*LAT_HT/T_SAT;
    }
    return enrg_dot;
}
UDF compiles and works well. I did two simulations: first with domain filled with water at saturation temperature 373 K and left boundary at T = 398 K. I ran simulation and evaporation appeared (volume phase of water and vapor changed). When I set initial conditions to only vapor in the domain, at sat. tempr. 373 K and boundary condition at right wall at 300 K I haven't noticed any condensation. I do not know why because I checked m_dot_l and m_dot_v in both cases and they are not zero (by uncomment lines in UDF). Is it bug in Fluent?? Can anybody help? I append the case file.
Attached Files
File Type: zip ShuStefanLeeUDF.zip (150.3 KB, 239 views)
BlnPhoenix, D.M, phong6495 and 1 others like this.
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   August 6, 2016, 15:57
Default difficulty in modelling condensation
  #2
New Member
 
Nitin
Join Date: Mar 2012
Location: Bombay
Posts: 16
Rep Power: 14
Nitin Minocha is on a distinguished road
Hi
I am using mixture model and using evaporation-condensation model for mass transfer. I am not able to model condensation.
Any help will be greatly appreciated.


Thank You
Nitin Minocha
Nitin Minocha is offline   Reply With Quote

Old   August 8, 2016, 03:14
Default
  #3
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
I see that you have the same problem as me
Few other guys on this forum also reported on that
I don't know why it is so
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   September 20, 2016, 06:27
Default
  #4
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
Hi All,
I found the solution. Fluent 16.2 has a bug. Everything works well in 17.1 version.
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   October 18, 2016, 14:02
Default
  #5
New Member
 
Join Date: Oct 2016
Location: Ringkobing, Denmark
Posts: 10
Rep Power: 10
Abdelhamid Kassem is on a distinguished road
Quote:
Originally Posted by gaza View Post
Hi All,
I found the solution. Fluent 16.2 has a bug. Everything works well in 17.1 version.
Could you upload the working files after fixing the problem because, i still stuck with errors while doing the analysis,and i need it in my bachelor project, and i'm a beginner user of fluent.
My email: Abdelhamidkassem93@gmail.com

Thanks in advance.
Abdelhamid Kassem is offline   Reply With Quote

Old   October 20, 2016, 15:39
Default
  #6
New Member
 
Vivek Kumar Mahato
Join Date: Jun 2016
Location: Taipei, Taiwan
Posts: 14
Rep Power: 10
ImVKMahato is on a distinguished road
Hello sir, I m new to heat pipe (wick or wickless ) simulation using UDF.I have done a lot of research but has not been very much fruitful. Could you plz guide me How to do it using UDF. I request you. It is very essential for my project. Thank u
ImVKMahato is offline   Reply With Quote

Old   October 20, 2016, 16:04
Default
  #7
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
Quote:
Originally Posted by ImVKMahato View Post
Hello sir, I m new to heat pipe (wick or wickless ) simulation using UDF.I have done a lot of research but has not been very much fruitful. Could you plz guide me How to do it using UDF. I request you. It is very essential for my project. Thank u
Hi All
The code in the post #1 is correct. It did not work in Fluent 16 but it works in 17. The is to compile this on linux because windows compiler sometimes does not see the errors.
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   October 20, 2016, 16:15
Default
  #8
New Member
 
Vivek Kumar Mahato
Join Date: Jun 2016
Location: Taipei, Taiwan
Posts: 14
Rep Power: 10
ImVKMahato is on a distinguished road
I have watch few videos on youtube regarding using UDFs n compiling them. However I m not very clear about it. Do you have any suggestion where I can make my concept clear about compiling , running these codes and getting desired results. Thanks for the previous reply.... Regards
ImVKMahato is offline   Reply With Quote

Old   October 20, 2016, 16:26
Default
  #9
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
Quote:
Originally Posted by ImVKMahato View Post
I have watch few videos on youtube regarding using UDFs n compiling them. However I m not very clear about it. Do you have any suggestion where I can make my concept clear about compiling , running these codes and getting desired results. Thanks for the previous reply.... Regards
read the udf manual ...
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   November 1, 2016, 05:05
Default
  #10
New Member
 
Vivek Kumar Mahato
Join Date: Jun 2016
Location: Taipei, Taiwan
Posts: 14
Rep Power: 10
ImVKMahato is on a distinguished road
I have been reading UDF manual for quiet a few days now...Could you advice or suggest something which can help me move ahead in my work in simulation. I donot have much knowledge about the various models eg. Lee model etc..
ImVKMahato is offline   Reply With Quote

Old   November 2, 2016, 07:46
Default
  #11
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
The udf is in post #1
You have to compile it and hook the udf into your simulation.
The tutorial on that is film boiling

https://www.google.pl/url?sa=t&rct=j...ci9r3Q&cad=rja
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   November 2, 2016, 09:36
Default
  #12
New Member
 
Vivek Kumar Mahato
Join Date: Jun 2016
Location: Taipei, Taiwan
Posts: 14
Rep Power: 10
ImVKMahato is on a distinguished road
Thankful for the tutorial you provided .. Leme try it and i will let you know if i have some problem.. Thank you again.. Regards
ImVKMahato is offline   Reply With Quote

Old   November 3, 2016, 00:45
Default
  #13
New Member
 
Vivek Kumar Mahato
Join Date: Jun 2016
Location: Taipei, Taiwan
Posts: 14
Rep Power: 10
ImVKMahato is on a distinguished road
Could you email me the files mentioned in the tutorial test-2d.msh and boiling.c? i could not find them ..thanks
ImVKMahato is offline   Reply With Quote

Old   November 3, 2016, 00:49
Default
  #14
New Member
 
Vivek Kumar Mahato
Join Date: Jun 2016
Location: Taipei, Taiwan
Posts: 14
Rep Power: 10
ImVKMahato is on a distinguished road
VOF multiphase model too..if u have..
ImVKMahato is offline   Reply With Quote

Old   December 21, 2016, 12:20
Default Heat Pipe
  #15
New Member
 
Reza
Join Date: Dec 2016
Posts: 2
Rep Power: 0
Rezaa is on a distinguished road
Hi everyone. I am new in the two-phase flow and heat pipe field and I should simulate a wicked heat pipe by OpenFoam. It is appreciated if anyone can help me ... Thanks
Rezaa is offline   Reply With Quote

Old   January 10, 2017, 09:07
Default
  #16
New Member
 
manan
Join Date: Dec 2016
Posts: 1
Rep Power: 0
manan13 is on a distinguished road
Increase condensation frequency
manan13 is offline   Reply With Quote

Old   January 20, 2017, 06:29
Default
  #17
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
Quote:
Originally Posted by gaza View Post
Hi All
The code in the post #1 is correct. It did not work in Fluent 16 but it works in 17. The is to compile this on linux because windows compiler sometimes does not see the errors.
Hi
sorry I was wrong. It also does not work in fluent 17. I got evaporation and condensation but also artificial condensation at the liquid-vapor interface. I do not know how to solve it.
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   September 19, 2017, 22:50
Default
  #18
New Member
 
phong6495
Join Date: Jun 2016
Posts: 5
Rep Power: 10
phong6495 is on a distinguished road
Hi gazza, you uses VOF models or mixture model????
phong6495 is offline   Reply With Quote

Old   September 20, 2017, 03:23
Default
  #19
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
I used VOF model
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   September 20, 2017, 09:00
Default
  #20
New Member
 
phong6495
Join Date: Jun 2016
Posts: 5
Rep Power: 10
phong6495 is on a distinguished road
Thanks gazza. I'm also simulating evaporation, condensation with thermosyphon. With condensation, your boundary conditions like? Are the heat transfer coefficients used?
Thanks!!!!
phong6495 is offline   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
Evaporation and condensation model in VOF ic3lemon Fluent Multiphase 0 December 12, 2015 07:56
Evaporation & condensation in 2D Heat Exchanger Somnath rangrej Main CFD Forum 0 December 8, 2015 12:25
Evaporation and condensation Model in Fluent amy24d Fluent Multiphase 5 May 26, 2015 13:20
Evaporation & Condensation model Amit FLUENT 0 September 7, 2012 07:53
evaporation and condensation in the VOF model Glev FLUENT 0 December 24, 2004 05:55


All times are GMT -4. The time now is 21:36.