|
[Sponsors] |
March 24, 2021, 08:15 |
DEFINE_MASS_TRANSFER udf divergence problem
|
#1 |
New Member
Navdeep
Join Date: Mar 2021
Posts: 5
Rep Power: 5 |
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! |
|
November 8, 2021, 04:08 |
|
#2 |
New Member
Jun
Join Date: Aug 2021
Posts: 3
Rep Power: 5 |
Hi,I want to know what formula your m_lg is based on? Thanks
|
|
November 18, 2021, 11:11 |
|
#3 |
New Member
mohammad reza
Join Date: Apr 2014
Location: Iran-Isfahan
Posts: 10
Rep Power: 12 |
Is your problem solved? I have a similar problem.
|
|
December 10, 2021, 16:49 |
|
#4 |
New Member
Chris
Join Date: Mar 2021
Posts: 23
Rep Power: 5 |
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)
|
|
December 11, 2021, 10:51 |
|
#5 |
New Member
Navdeep
Join Date: Mar 2021
Posts: 5
Rep Power: 5 |
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.
|
|
December 11, 2021, 14:58 |
|
#6 | |
New Member
Navdeep
Join Date: Mar 2021
Posts: 5
Rep Power: 5 |
Quote:
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. |
||
Tags |
condensation, divergence, mass transfer, phase change |
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |