|
[Sponsors] |
When I use the following phase change code, the fluent give the following errors, who |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 5, 2020, 13:57 |
When I use the following phase change code, the fluent give the following errors, who
|
#1 |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 10 |
When I use the following phase change code,I use a gradient of the volume fraction, I do not know whether it is right. When I import it into the fluent, it does not have any error. But when it run, the fluent give the following errors, who can help me find the problem and revise it, thank you.
The below is the error note: Divergence detected in AMG solver: pressure correction Error at host: floating point exception Error at Node 0: floating point exception Error: floating point exception The codes: #include "udf.h" #include"sg_mphase.h" #define LAT_HT 193260 #define C1 0.1 #define MW 0.018 #define RR 8.314 #define PI 3.1415926 #define T_SAT 293.15 DEFINE_SOURCE(liq_src, cell, sec_th, dS, eqn) { Thread *mix_th, *pri_th; real m_dot_l; real pp; mix_th = THREAD_SUPER_THREAD(sec_th); pri_th = THREAD_SUB_THREAD(mix_th, 0); if(C_T(cell, mix_th)>=T_SAT) { m_dot_l = -2*C1/(2-C1)*sqrt(MW/2/PI/RR)*(C_R(cell, pri_th)*LAT_HT*fabs(T_SAT-C_T(cell,sec_th)))/pow(T_SAT,1.5)*abs(C_VOF_G(cell, pri_th)); dS[eqn] = -2*C1/(2-C1)*sqrt(MW/2/PI/RR)*(C_R(cell, pri_th)*LAT_HT*fabs(T_SAT-C_T(cell,sec_th)))/pow(T_SAT,1.5); } else { m_dot_l = 2*C1/(2-C1)*sqrt(MW/2/PI/RR)*(C_R(cell, pri_th)*LAT_HT*fabs(T_SAT-C_T(cell,mix_th)))/pow(T_SAT,1.5)*abs(C_VOF_G(cell, pri_th)); dS[eqn] = 0.; } return m_dot_l; } DEFINE_SOURCE(vap_src, cell, pri_th, dS, eqn) { Thread * mix_th, *sec_th; real m_dot_v; real pp; mix_th = THREAD_SUPER_THREAD(pri_th); sec_th = THREAD_SUB_THREAD(mix_th, 1); if(C_T(cell, mix_th)>=T_SAT) { m_dot_v = 2*C1/(2-C1)*sqrt(MW/2/PI/RR)*(C_R(cell, pri_th)*LAT_HT*fabs(T_SAT-C_T(cell,mix_th)))/pow(T_SAT,1.5)*abs(C_VOF_G(cell, pri_th)); dS[eqn] = 0.; } else { m_dot_v = -2*C1/(2-C1)*sqrt(MW/2/PI/RR)*(C_R(cell, pri_th)*LAT_HT*fabs(T_SAT-C_T(cell,mix_th)))/pow(T_SAT,1.5)*abs(C_VOF_G(cell, pri_th)); dS[eqn] = -2*C1/(2-C1)*sqrt(MW/2/PI/RR)*(C_R(cell, pri_th)*LAT_HT*fabs(T_SAT-C_T(cell,mix_th)))/pow(T_SAT,1.5); } return m_dot_v; } DEFINE_SOURCE(enrg_src, cell, mix_th, dS, eqn) { Thread *pri_th, *sec_th; real m_dot; real pp; pri_th = THREAD_SUB_THREAD(mix_th, 0); sec_th = THREAD_SUB_THREAD(mix_th, 1); if(C_T(cell, mix_th)>=T_SAT) { m_dot= -2*C1/(2-C1)*sqrt(MW/2/PI/RR)*(C_R(cell, pri_th)*LAT_HT*fabs(T_SAT-C_T(cell,sec_th)))/pow(T_SAT,1.5)*abs(C_VOF_G(cell, pri_th)); dS[eqn] = -2*C1/(2-C1)*sqrt(MW/2/PI/RR)*C_R(cell, pri_th)*LAT_HT/pow(T_SAT,1.5)*abs(C_VOF_G(cell, pri_th)); } else { m_dot = 2*C1/(2-C1)*sqrt(MW/2/PI/RR)*(C_R(cell, pri_th)*LAT_HT*fabs(T_SAT-C_T(cell,mix_th)))/pow(T_SAT,1.5)*abs(C_VOF_G(cell, pri_th)); dS[eqn] =-2*C1/(2-C1)*sqrt(MW/2/PI/RR)*C_R(cell, pri_th)*LAT_HT/pow(T_SAT,1.5); } return LAT_HT*m_dot; } |
|
December 7, 2020, 00:39 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
most likely you have division by zero somewhere in your code
also C_VOF_G is a vector, it has C_VOF_G[0], C_VOF_G[1], C_VOF_G[2] components to get ist's magnitude you wanna use NV_MAG(C_VOF_G()) macro
__________________
best regards ****************************** press LIKE if this message was helpful |
|
December 7, 2020, 10:11 |
Hi,Alexander, thank you so much for your help. You mean I should use NV_MAG(C_VOF_G(c
|
#3 | |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 10 |
Quote:
NV_MAG(C_VOF_G(c,0)) to replace C_VOF_G(cell, pri_th),and use NV_MAG(C_VOF_G(c,1)) to replace C_VOF_G(cell, sec_th).Is that right? Thank you so much for you help. Hope you have a good weekday. |
||
December 8, 2020, 01:39 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
yes, I think so. But you should test it
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
courant number increases to rather large values | 6863523 | OpenFOAM Running, Solving & CFD | 22 | July 6, 2023 00:48 |
When the fluent runs, it abruptly give the errors below, and I cannot run afterwards, | hitzhwan | FLUENT | 7 | March 4, 2020 04:34 |
Multiple floating objects | CKH | OpenFOAM Running, Solving & CFD | 14 | February 20, 2019 10:08 |
p_rgh initial residual no change with different settings | manuc | OpenFOAM Running, Solving & CFD | 3 | June 26, 2018 16:53 |
Stuck in a Rut- interDyMFoam! | xoitx | OpenFOAM Running, Solving & CFD | 14 | March 25, 2016 08:09 |