CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF of saturation temperature

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 13, 2021, 02:36
Default UDF of saturation temperature
  #1
New Member
 
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 8
stanlee8 is on a distinguished road
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 02:37. Reason: the color is annoying
stanlee8 is offline   Reply With Quote

Old   June 13, 2021, 02:48
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   June 13, 2021, 06:41
Default
  #3
New Member
 
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 8
stanlee8 is on a distinguished road
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.
stanlee8 is offline   Reply With Quote

Old   June 13, 2021, 07:07
Default
  #4
New Member
 
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 8
stanlee8 is on a distinguished road
Hi Pakk,

yes, I just replaced
Quote:
sat_t = (1723.6425/(8.05573-((double)log10((double)vapor_p/133.322)))-233.08)+273.15;
with
Quote:
sat_t = 300;
and it works fine.
stanlee8 is offline   Reply With Quote

Old   June 13, 2021, 13:00
Default
  #5
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   June 14, 2021, 23:22
Default
  #6
New Member
 
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 8
stanlee8 is on a distinguished road
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.
stanlee8 is offline   Reply With Quote

Old   June 14, 2021, 23:30
Default
  #7
New Member
 
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 8
stanlee8 is on a distinguished road
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?
stanlee8 is offline   Reply With Quote

Old   June 16, 2021, 04:01
Default
  #8
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   June 27, 2021, 07:12
Default
  #9
New Member
 
Stanlee
Join Date: Aug 2017
Location: New Zealand
Posts: 19
Rep Power: 8
stanlee8 is on a distinguished road
HI Pakk,

Thanks, I think I have already solved it!
stanlee8 is offline   Reply With Quote

Reply


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
UDF for saturation temperature for Lee's Condensation model Boo85 Fluent UDF and Scheme Programming 1 August 21, 2021 16: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 06:09
how can I access to static temperature in UDF? milmil FLUENT 0 September 19, 2017 08:29
UDF problem- time dependent temperature at inlet kaeran FLUENT 1 June 16, 2015 21:48
UDF slip and temperature jump from IFRT abir Fluent UDF and Scheme Programming 1 July 30, 2012 05:44


All times are GMT -4. The time now is 20:56.