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

Convergence problems - UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 20, 2021, 05:24
Default Convergence problems - UDF
  #1
New Member
 
Tomás Freitas Rocha
Join Date: Mar 2021
Posts: 4
Rep Power: 5
tomasfreitasrocha is on a distinguished road
Hello everyone,

I am trying to implement a real-gas model for a CO2 ejector. My properties are interpolated from lookup tables, and this is working well for thermal conductivity, specific heat and viscosity. As for density, the simulation converges when I use an ideal-gas model; however, when I switch to my UDF, the simulation does not converge. Even if I write a UDF for density that replicates the ideal gas model, I have problems.

I would appreciate any help.

Thank you.
tomasfreitasrocha is offline   Reply With Quote

Old   May 20, 2021, 18:44
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
well, if you have problems with UDF, you should show it, at least
show the error log as well, show compilation log
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   May 21, 2021, 04:39
Default
  #3
New Member
 
Tomás Freitas Rocha
Join Date: Mar 2021
Posts: 4
Rep Power: 5
tomasfreitasrocha is on a distinguished road
Yes, of course.

Here it is:

#include "udf.h"
#include "mem.h"
#include "external.h"

DEFINE_PROPERTY(property_density,c,t)
{
float density;

density = C_P(c,t)/(69.29*C_T(c,t));

return density;
}

The molecular weight of my fluid is 120 kg/kmol.

When I use this UDF, I get negative pressure values.
tomasfreitasrocha is offline   Reply With Quote

Old   May 22, 2021, 04:16
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
C_P is gauge pressure, you have to add the reference pressure.
__________________
"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   May 22, 2021, 05:09
Default
  #5
New Member
 
Tomás Freitas Rocha
Join Date: Mar 2021
Posts: 4
Rep Power: 5
tomasfreitasrocha is on a distinguished road
Thank you for your reply.

I have set my operating pressure at 0. Also, I get no compilation or loading errors! All the other UDFs work.
tomasfreitasrocha is offline   Reply With Quote

Old   May 22, 2021, 09:56
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
If you initialize it at e.g. 5 Pa, 300 K, don't iterate, and plot density, does it make sense?

(I don't know what is causing your problem, but this might give some information to help solve the problem.)
__________________
"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   May 22, 2021, 10:07
Default
  #7
New Member
 
Tomás Freitas Rocha
Join Date: Mar 2021
Posts: 4
Rep Power: 5
tomasfreitasrocha is on a distinguished road
Yes it does! Which adds to my confusion...
tomasfreitasrocha 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
Running Fluent from Python: UDF Compilation problems Ames Fluent UDF and Scheme Programming 5 November 16, 2020 06:12
Compressor Endface Leakage - Convergence Problems liying02 FLUENT 0 October 11, 2019 01:45
force convergence problems in CFX 6DOF rigid body solver ajay_ks CFX 8 March 25, 2013 04:02
Convergence UDF L3munoz Fluent UDF and Scheme Programming 2 January 4, 2011 08:04
convergence in unstedy problems hedge FLUENT 0 November 27, 2007 09:24


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