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

DEFINE_MASS_TRANSFER udf divergence problem

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

Like Tree1Likes
  • 1 Post By cbooks77

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 24, 2021, 08:15
Default DEFINE_MASS_TRANSFER udf divergence problem
  #1
New Member
 
Navdeep
Join Date: Mar 2021
Posts: 5
Rep Power: 5
Navsing is on a distinguished road
Hi,

I am conducting a 2D simulation of water-vapor condensation upon a pipe wall. My simulation runs fine when using the default Lee's model in fluent.

However I'm trying to implement a mass transfer phase change model from a paper which will provide more accurate results. I'm implementing this through the UDF macro DEFINE_MASS_TRANSFER.

Although when I run the simulation with my mass transfer udf, it runs for approx 100 iterations and then the simulation starts to diverge. My UDF is listed here:
#include "udf.h"

DEFINE_MASS_TRANSFER(liq_gas_source, cell, thread, from_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);
real delta_t;
delta_t = CURRENT_TIMESTEP;
real lc = C_H(cell,gas)-C_H(cell,liq)

m_lg = 0.;
if (C_T(cell, liq) >= T_SAT)
{
m_lg = (1./lc)*C_VOF(cell,liq)*(C_R(cell,liq)*C_CP(cell,liq)* fabs(T_SAT-C_T(cell,liq))/delta_t);
}
else if ((m_lg == 0. ) && (C_T(cell,gas) <= T_SAT))
{
m_lg = (1./lc)*C_VOF(cell,gas)*(C_R(cell,gas)*C_CP(cell,gas)* fabs(T_SAT-C_T(cell,gas))/delta_t);
}

return (m_lg);
}

Any ideas of what could be causing this?

Many thanks!
Navsing is offline   Reply With Quote

Old   November 8, 2021, 04:08
Default
  #2
New Member
 
Jun
Join Date: Aug 2021
Posts: 3
Rep Power: 4
RestlessBreeze is on a distinguished road
Hi,I want to know what formula your m_lg is based on? Thanks
RestlessBreeze is offline   Reply With Quote

Old   November 18, 2021, 11:11
Default
  #3
New Member
 
mohammad reza
Join Date: Apr 2014
Location: Iran-Isfahan
Posts: 10
Rep Power: 12
m.r.soufivand is on a distinguished road
Is your problem solved? I have a similar problem.
m.r.soufivand is offline   Reply With Quote

Old   December 10, 2021, 16:49
Default
  #4
New Member
 
Chris
Join Date: Mar 2021
Posts: 23
Rep Power: 5
cbooks77 is on a distinguished road
You should use the linearized mass transfer UDF like Ansys recommends. The solver generally expects linearized source terms to remain stable and avoid under/over shoots. You might get away with non linear mass transfer if its a very simple case. Also you should be running this in transient and find a time step that is stable. Also you will want to underrelax the pressure and momentum quite a bit (0.3)
m.r.soufivand likes this.
cbooks77 is offline   Reply With Quote

Old   December 11, 2021, 10:51
Default
  #5
New Member
 
Navdeep
Join Date: Mar 2021
Posts: 5
Rep Power: 5
Navsing is on a distinguished road
Yes I've solved this problem. I just needed to swap the phases over (the from and to index) as I defined the primary phase as the condensate and the vapour as the secondary.
Navsing is offline   Reply With Quote

Old   December 11, 2021, 14:58
Default
  #6
New Member
 
Navdeep
Join Date: Mar 2021
Posts: 5
Rep Power: 5
Navsing is on a distinguished road
Quote:
Originally Posted by RestlessBreeze View Post
Hi,I want to know what formula your m_lg is based on? Thanks
The formula is based on the simple heat transfer energy equation which deduces the volumetric mass transfer rate between the liquid-vapour interface. The full explaination can be found from this reference:

A.S. Rattner, S. Garimella, Simple mechanistically consistent formulation for
volume-of-fluid based computations of condensing flows, J. Heat Transf. 136
(7) (2014), https://doi.org/10.1115/1.4026808.
Navsing is offline   Reply With Quote

Reply

Tags
condensation, divergence, mass transfer, phase change

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
Problem reading external text data Ahmed A. Serageldin Fluent UDF and Scheme Programming 4 November 29, 2020 22:23
SU2-7.0.1 on ubuntu 18.04 hyunko SU2 Installation 7 March 16, 2020 04:37
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 06:05
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56


All times are GMT -4. The time now is 16:32.