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

UDF for Real gas model

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By Kirill-MIPT
  • 1 Post By Kirill-MIPT
  • 2 Post By Kirill-MIPT

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2017, 08:57
Default UDF for Real gas model
  #1
Member
 
Kirill-MIPT's Avatar
 
Kirill Borodin
Join Date: Mar 2016
Posts: 60
Rep Power: 10
Kirill-MIPT is on a distinguished road
Hello!

I'm trying to load my real gas model to Fluent, but I cannot even make the ideal gas equation of state work, even though I had taken the UDF for it from the User Guide (7.16.5 in the User Guide). For my problem I have P=15000 Pa, T=120 K at the inlet. The proper value of density for this model must be rho~0.436 kg/m3, but Fluent intializes it with value of rho=2.35E-5 kg/m3 in almost all cells and with value of rho~5E+7 kg/m3 in one cell. The process of calculation lasts for 0 iterations with Courant number CN=0.001, then I have:

Divergence detected - temporarily reducing Courant number to 1e-08
and trying again...

Error: Internal error at line 1596 in file '..\..\src\rp_mstage.c'.
Divergence detected in AMG solver

Error: Internal error at line 1596 in file '..\..\src\rp_mstage.c'.
Divergence detected in AMG solver
Error Object: #f


I loaded and compiled the library as it was written in the Guide. Could you please help me with this problem?

Regards, Kirill
Светлана likes this.
Kirill-MIPT is offline   Reply With Quote

Old   June 5, 2017, 02:36
Default
  #2
Senior Member
 
KaLium's Avatar
 
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9
KaLium is on a distinguished road
Did you study the limitations of that code?

Are you using mass-flow inlet?
KaLium is offline   Reply With Quote

Old   June 5, 2017, 04:07
Default
  #3
Member
 
Kirill-MIPT's Avatar
 
Kirill Borodin
Join Date: Mar 2016
Posts: 60
Rep Power: 10
Kirill-MIPT is on a distinguished road
Quote:
Originally Posted by KaLium View Post
Did you study the limitations of that code?

Are you using mass-flow inlet?
Yes, I studied all the limitations. The only boundary conditions for my problem are pressure-inlet, pressure-outlet and wall. I also used pressure-based solver.

For my problem the total pressure value is 6E7 Pa and total temperature is 1200 K. This corresponds to hypersonic flow with Mach number M~7. Could this problem type somehow influence the solution process with Pressure-based solver?

Regards

Sent from my C6903 using CFD Online Forum mobile app
Kirill-MIPT is offline   Reply With Quote

Old   June 6, 2017, 19:01
Default Try a pipe first
  #4
Senior Member
 
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 407
Rep Power: 14
Светлана is on a distinguished road
Perhaps you could try the real gas model on a simplified simulation first? For example, create a straight rectangular pipe and try the real gas model in that.
Светлана is offline   Reply With Quote

Old   June 7, 2017, 16:11
Default
  #5
Member
 
Kirill-MIPT's Avatar
 
Kirill Borodin
Join Date: Mar 2016
Posts: 60
Rep Power: 10
Kirill-MIPT is on a distinguished road
Quote:
Originally Posted by Светлана View Post
Perhaps you could try the real gas model on a simplified simulation first? For example, create a straight rectangular pipe and try the real gas model in that.
Thank you for your response! I tried a number of simple geometries (a pipe too). Using each of them gave me no results - every time the density field was initialized with inappropriate value in all cells but one (40 vs 0.43 kg/m3) and a VERY inappropriate (maybe it's a junk cell in cell/face array) value of 3e8 kg/m3. The calculation crashed on the first iteration. It seems strange, because I used the same code for ideal gas EOS as it was given in the Guide.

I also tried to run the calculation for a small number of iterations (for example 10) with the built-in ideal gas EOS and after that I turned on the real gas model (that was supposed to model the same gas with the same EOS). I monitored the evolution of static pressure, density, temperature and velocity fields. The temperature field started crashing after the very first iteration. I guess there's something wrong with energy equation? The other fields started crashing some more iterations later (I guess the crashing temperature field influenced them).

Looking forward to your response! Regards

Update: I tried this EOS on three different computers with three different versions of Fluent. There were the same problems

Sent from my C6903 using CFD Online Forum mobile app
Светлана likes this.
Kirill-MIPT is offline   Reply With Quote

Old   June 8, 2017, 14:55
Default
  #6
Member
 
Kirill-MIPT's Avatar
 
Kirill Borodin
Join Date: Mar 2016
Posts: 60
Rep Power: 10
Kirill-MIPT is on a distinguished road
Thanks to all - I used a code for real gas model for a too early version of Fluent. The code for 15th version differs from it a bit. Now the example model works

Sent from my C6903 using CFD Online Forum mobile app
Светлана and KaLium like this.
Kirill-MIPT is offline   Reply With Quote

Old   June 9, 2017, 02:24
Default
  #7
Senior Member
 
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 407
Rep Power: 14
Светлана is on a distinguished road
Congratulations, that was easy
Светлана is offline   Reply With Quote

Old   July 12, 2018, 12:37
Default pls help me
  #8
New Member
 
Songyuan Liu
Join Date: Jul 2018
Posts: 1
Rep Power: 0
liuso is on a distinguished road
hallo, i have the same Problem , can u tell me , where can i find the new code for 15th Version ?
thanks


Quote:
Originally Posted by Kirill-MIPT View Post
Thanks to all - I used a code for real gas model for a too early version of Fluent. The code for 15th version differs from it a bit. Now the example model works

Sent from my C6903 using CFD Online Forum mobile app
liuso is offline   Reply With Quote

Old   September 7, 2018, 07:16
Default
  #9
Member
 
Kirill-MIPT's Avatar
 
Kirill Borodin
Join Date: Mar 2016
Posts: 60
Rep Power: 10
Kirill-MIPT is on a distinguished road
Hello! You may find the code in the User Guide in chapter 7.6.15. The chapter name is User Defined Real Gas Model.
Kirill-MIPT 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 Multiphase euilerian model pibea FLUENT 3 April 30, 2024 01:25
UDF for improved coal devolatilization model in fluent(devolatilization ) magic0801 Fluent UDF and Scheme Programming 3 May 23, 2023 05:18
How to use the degassing UDF for VOF model in Fluent? qingyang Fluent UDF and Scheme Programming 0 July 11, 2016 12:42
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
how can i model the ideal gas law in CFX? CFX13 CFX 3 July 4, 2013 07:20


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