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

Problem with using User Define Real Gas Model (UDRGM)

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By AlexanderZ
  • 1 Post By AlexanderZ
  • 1 Post By 根瘤囧

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2021, 19:54
Default Problem with using User Define Real Gas Model (UDRGM)
  #1
Member
 
Amirreza Niazmehr
Join Date: Nov 2018
Posts: 40
Rep Power: 8
Amirreza_pro is on a distinguished road
Hi guys.
We are using our data for a simulation in Fluent.
Our Data are for:
1- Cp
2- Viscosity
3- Lambda
4- Density
As you know, The user-defined real gas model (UDRGM) has been developed to allow you to write your own custom real gas model to fit your particular modeling needs.
The point is that, when we use our data for
1- Cp
2- Viscosity
3- Lambda
and we use this formulation for density according to Redlich-Kwong Equation of State for Real Gas Modeling:

we do not have any problem and our solution will converge.
But when we use our data for density and use this:
double Air_density(cell_t cell, Thread *thread, cxboolean vapor_phase, double temp, double density, double press, double yi[])
{
real mix = 0;
return CalcGasAblation(&rhoA, &rhoB, &rhoC, &rhoD, &rhoMixPoints, &rhoPressPoints, &rhoTempPoints, rhoNumMixPoints, rhoNumPressPoints, rhoNumTempPoints, mix, Air_pressure(temp, density), temp, rhoEquidistant);

In this case we are using interpolation function for our data of density.
the solution would diverge as you see in this picture
[IMG][/IMG]


That means we only can not use our data for density (our interpolation function for density).

In attachment you can find codes for converged and diverged codes.
our data for density you can download with this link:
https://we.tl/t-aSC30jrbtP

Can someone please help me and say where is the problem? I really stuck in this problem.
Thanks in advance
Attached Files
File Type: c Converged.c (26.1 KB, 16 views)
File Type: c Diverged.c (26.3 KB, 14 views)
Amirreza_pro is offline   Reply With Quote

Old   January 15, 2021, 02:33
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
so looks like problem is inside interpolation function
I think, you should check carefully values, which your interpolation function generates

also the difference between 2 codes are in value type you are applying for density
in convergence case it is double
non-convergence - real

however, real is double if you are running fluent in double precision regime.

check carefully, what could happen if your input values for interpolation function are out of borders, cause fluent may extrapolate there
Amirreza_pro likes this.
__________________
best regards


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

Old   January 15, 2021, 03:22
Default
  #3
Member
 
Amirreza Niazmehr
Join Date: Nov 2018
Posts: 40
Rep Power: 8
Amirreza_pro is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
so looks like problem is inside interpolation function
I think, you should check carefully values, which your interpolation function generates

also the difference between 2 codes are in value type you are applying for density
in convergence case it is double
non-convergence - real

however, real is double if you are running fluent in double precision regime.

check carefully, what could happen if your input values for interpolation function are out of borders, cause fluent may extrapolate there
Thanks alot dear Alexander.
Yes i did not care about this real and double definition. I will correct it.
Just one more question, you said:
Mybe ''the input values for interpolation function are out of borders''
How can I check it? Can you explain it more.
Again thanks alot for your help.
Amirreza_pro is offline   Reply With Quote

Old   January 15, 2021, 04:07
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
I didn't go deep into your code
it could be a case where you've defined density for temperature range from 300 to 3000K, but which value will be applied for 290, 250 K ?

that is what I was trying t say
Amirreza_pro likes this.
__________________
best regards


******************************
press LIKE if this message was helpful

Last edited by AlexanderZ; January 15, 2021 at 06:10.
AlexanderZ is offline   Reply With Quote

Old   January 15, 2021, 04:40
Default
  #5
Member
 
Amirreza Niazmehr
Join Date: Nov 2018
Posts: 40
Rep Power: 8
Amirreza_pro is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
I didn't go deep into your code
it could be a case where you've defined density for temperature range from 300 to 3000K, but what value will be applied for 290, 250 K ?

that is what I was trying t say
OK, I got it.
Thanks alot.
Amirreza_pro is offline   Reply With Quote

Old   June 26, 2021, 09:57
Default
  #6
New Member
 
wangyang
Join Date: Jun 2021
Posts: 3
Rep Power: 5
根瘤囧 is on a distinguished road
Your article about UDRGM was very helpful for me, but it is uneasy to understand via the table files are unknown. Therefore, I sinerely hope you can sent the table files to me. Thank you very much.
Address:384117102@qq.com
根瘤囧 is offline   Reply With Quote

Old   July 1, 2021, 22:57
Default
  #7
New Member
 
wangyang
Join Date: Jun 2021
Posts: 3
Rep Power: 5
根瘤囧 is on a distinguished road
I studied the UDRGM carefully these days and I found that the reason why your code for density did not work.
double Air_density(cell_t cell, Thread *thread, cxboolean vapor_phase, double temp, double density, double press, double yi[])
{
real mix = 0;
return CalcGasAblation(&rhoA, &rhoB, &rhoC, &rhoD, &rhoMixPoints, &rhoPressPoints, &rhoTempPoints, rhoNumMixPoints, rhoNumPressPoints, rhoNumTempPoints, mix, 101325, temp, rhoEquidistant);
}
I think you should get rid of the "double density" in parentheses.
AlexanderZ likes this.
根瘤囧 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
HEM with Fluent: Use NIST Real Gas Model in 2-phase region c_023 FLUENT 2 April 13, 2022 07:26
Domain Reference Pressure and mass flow inlet boundary AdidaKK CFX 75 August 20, 2018 06:37
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 06:21
Constant velocity of the material Sas CFX 15 July 13, 2010 09:56
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 13:24


All times are GMT -4. The time now is 13:38.