-
-
March 24, 2021 at 1:21 pm
Navsing
SubscriberHi,nnI 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.nnHowever 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.nnAlthough 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:n#include udf.hnnDEFINE_MASS_TRANSFER(liq_gas_source, cell, thread, from_index,from_species_index, to_index, to_species_index)n{nreal m_lg;nreal T_SAT = 373.15;nThread *gas = THREAD_SUB_THREAD(thread, from_index);nThread *liq = THREAD_SUB_THREAD(thread, to_index);nreal delta_t;ndelta_t = CURRENT_TIMESTEP;nreal lc = C_H(cell,gas)-C_H(cell,liq)nnm_lg = 0.;nif (C_T(cell, liq) >= T_SAT)n{nm_lg = (1./lc)*C_VOF(cell,liq)*(C_R(cell,liq)*C_CP(cell,liq)* fabs(T_SAT-C_T(cell,liq))/delta_t);n}nelse if ((m_lg == 0. ) && (C_T(cell,gas) <= T_SAT))n{nm_lg = (1./lc)*C_VOF(cell,gas)*(C_R(cell,gas)*C_CP(cell,gas)* fabs(T_SAT-C_T(cell,gas))/delta_t);n}nnreturn (m_lg);n}nnAny ideas of what could be causing this?.Many thanks!n -
March 24, 2021 at 1:31 pm
YasserSelima
SubscriberHello,nI am not sure if this is right or not, but I just noticed that m_lg is positive in both cases .. I believe that one case should be negative.nYassern -
March 24, 2021 at 2:26 pm
Navsing
SubscriberHello YassernYeah I didn't set this as I will only have condensation. But I did try to set m_lg for condensation negative and it still crashed at roughly the same amount of iterations. -
March 24, 2021 at 2:50 pm
YasserSelima
SubscriberI believe this is expected because of using high coefficient 1 ... Not sure how you can solve the problem but you can try decreasing the timestep, decreasing the under-relaxtaion factors and increasing the number of iterations in every timestepn -
March 24, 2021 at 3:50 pm
Navsing
SubscriberI have tried to decrease the timestep, relaxation factors and increase the iterations per timestep, still have the same problem.nWhat do you mean by using the high coeffficeint 1? Should I re-write the equation?n -
March 24, 2021 at 4:27 pm
YasserSelima
SubscriberI mean this 1nm_lg = ( 1. /lc)*C_VOF(cell,liq)*(C_R(cell,liq)*C_CP(cell,liq)* fabs(T_SAT-C_T(cell,liq))/delta_t);nnthe solver will keep transferring almost all the liquid to vapour in one iteration, then all the vapour to liquid in the next .... the solution is something in between n -
March 24, 2021 at 5:34 pm
-
March 24, 2021 at 8:16 pm
YasserSelima
Subscriberyes, I do understand the equation ... but what happens is when you have all the liquid in the cell evaporating, the temperature decreases ... this causes the solver to re-apply the equation and condenses all the vapour ... the temperature in the cell increases ... and so on. In addition to having energy balance between the cells, this becomes a a tough process for the solver to reach solution.nWhat happens in reality is ... the temperature increases, then part of the liquid evaporates until the temperature reaches saturation ... not all the liquid. So, the coefficient should not be 1 ... The default value is 0.1 .. you can increase it to 0.2 .. 0.5 ... but 1 will end up with numerical instability n
-
Viewing 7 reply threads
- You must be logged in to reply to this topic.
Ansys Innovation Space

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
Trending discussions
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
Top Contributors
-
2524
-
2066
-
1279
-
1096
-
459
Top Rated Tags
© 2023 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.