|
[Sponsors] |
June 13, 2021, 03:36 |
UDF of saturation temperature
|
#1 |
New Member
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 9 |
Hi there,
I am trying to simulate condensation in the building environment, using the evaporation-condensation model in Fluent. Mixture multiphase model was used, with the primary phase as water liquid and a mixture of water vapour and air as a secondary phase. I understand I need a UDF to describe the relationship between saturation temperature and water vapour pressure. The UDF I used is listed below: #include "udf.h" DEFINE_PROPERTY(saturation_temp,c,t) { real sat_t; real vapor_p; real static_p = C_P(c,t); real operating_p = RP_Get_Real ("operating-pressure"); vapor_p = static_p + operating_p; // absolute pressure = static pressure + operating pressure sat_t = (1723.6425/(8.05573-((double)log10((double)vapor_p/133.322)))-233.08)+273.15; // Pressure in Pa to mmHg (Yaws) return sat_t; } A transient model is used and the results diverged after 5 iterations. The error is shown as below: Experiencing convergence difficulties - temporarily relaxing and trying again... Experiencing convergence difficulties - temporarily relaxing and trying again... Experiencing convergence difficulties - temporarily relaxing and trying again... Experiencing convergence difficulties - temporarily relaxing and trying again... Stabilizing pres sure coupled to enhance linear solver robustness. Stabilizing pressure coupled using GMRES to enhance linear solver robustness. Experiencing convergence difficulties - temporarily relaxing and trying again... Divergence detected in AMG solver: pressure coupled Stabilizing phase-2-species-0 to enhance linear solver robustness. Stabilizing phase-2-species-0 using GMRES to enhance linear solver robustness. Stabilizing temperature to enhance linear solver robustness. Stabilizing temperature using GMRES to enhance linear solver robustness. temperature limited to 1.000000e+00 in 751264 cells on zone 10 in domain 1 temperature limited to 5.000000e+03 in 399712 cells on zone 10 in domain 1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: pressure coupled Error at host: floating point exception Error at Node 0: floating point exception Error at Node 1: floating point exception Error at Node 2: floating point exception Error at Node 3: floating point exception ===============Message from the Cortex Process================================ Compute processes interrupted. Processing can be resumed. ================================================== ============================ Interrupting client... Done. Registering Udf, ("H:\rail humid_files\dp4\FLU\Fluent\sattemp1.txt") Calculation complete. It is really killing me, somebody please help me!!! Thank you so much. Last edited by stanlee8; June 13, 2021 at 03:37. Reason: the color is annoying |
|
June 13, 2021, 03:48 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Does the same happen if you vaatwanden the relevant line to
Code:
sat_t = 300;
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
June 13, 2021, 07:41 |
|
#3 |
New Member
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 9 |
Hi Pakk,
I am not sure if I have got you right, but I have tried the follows code: #include "udf.h" DEFINE_PROPERTY(saturation_temp,c,t) { return (real)373.1545154; } which works well. |
|
June 13, 2021, 08:07 |
|
#4 | ||
New Member
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 9 |
Hi Pakk,
yes, I just replaced Quote:
Quote:
|
|||
June 13, 2021, 14:00 |
|
#5 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
OK, then the problem is in that equation.
Is the pressure in your simulation within the range where that equation is valid?
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
June 15, 2021, 00:22 |
|
#6 |
New Member
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 9 |
Hi Pakk,
Yes, I guess so. May I ask what static_p = C_P(c,t) represent? Cuz I copy the code from somewhere else and not quite familiar with it. |
|
June 15, 2021, 00:30 |
|
#7 |
New Member
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 9 |
If C_P(c,t) is the static pressure of the mixture, then I think the above UDF is wrong.
Cuz the saturation temperature is a function of partial vapour pressure but not the static pressure of the mixture, am I right? |
|
June 16, 2021, 05:01 |
|
#8 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The UDF implements a certain equation from physics. You have to say which equation should be implemented.
If you tell Fluent to use the wrong equation, then you will get the wrong results. I can not tell you if the equation is wrong: you are the one who is doing the simulation, you are the one who decided that a certain equation should be used. So you are the one who should know how the equation should look like.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
June 27, 2021, 08:12 |
|
#9 |
New Member
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 9 |
HI Pakk,
Thanks, I think I have already solved it! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for saturation temperature for Lee's Condensation model | Boo85 | Fluent UDF and Scheme Programming | 1 | August 21, 2021 17:05 |
How to give the temperature condition by using the temperature of next cell in UDF? | JuBong | Fluent UDF and Scheme Programming | 6 | February 19, 2018 07:09 |
how can I access to static temperature in UDF? | milmil | FLUENT | 0 | September 19, 2017 09:29 |
UDF problem- time dependent temperature at inlet | kaeran | FLUENT | 1 | June 16, 2015 22:48 |
UDF slip and temperature jump from IFRT | abir | Fluent UDF and Scheme Programming | 1 | July 30, 2012 06:44 |