CFD Online Logo CFD Online URL
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

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

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


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 14:12.