How to generate and setup RGP-Tables for CFX multiphase flow simulations

  • 513 Views
  • Last Post 3 days ago
Seryoga posted this 24 April 2018

Hello everyone!

I have to set up a RGP-Table based simulation in CFX. The task is to simulate the cooling effect of throttled parahydrogen. Therefore I have to create a RGP-Table.

Is somebody aware of a tool which creates such a table using the REFPROP NIST Database?

Do I have to create a RGP-Table for liquid- and separately for the vapor-phase combining the two to a binary mixture or is Ansys able to separate the phases by just using only one RGP-Table?

Thank you for any advice or help!

Greetings

 

Order By: Standard | Newest | Votes
raul.raghav posted this 24 April 2018

Do you have access to RefProp? If you do, it's quite straightforward to create the RGP file. Attached is a zip file which has a program and a pdf explaining the procedure to create the RGP file from the NIST data.

You can either (i) create a separate RGP file for the liquid and gas phases and define the saturation properties; or (ii) create a single RGP file with all the properties along with the saturation properties, since a single RGP file can hold all these information.

 

Rahul

Attached Files

  • Liked by
  • Seryoga
Seryoga posted this 26 April 2018

Hello Rahul!

First of all thanks a lot for your fast answer and the provided software!

I have tried to compile the RGP GEN from GitHub but encountered several issues. After compiling on Windows 10 64bit, I'm getting the Error "Out of memory" as soon as I start the RGP-table generation. No matter of the table size, RAM and adminrights. It also seems for me that there is a mistake in the code since the program is linked with (fortran-) datafiles that are no longer provided by the REFPROP 9.1 version. On Linux the compiled Generator refuses even to start. 

If you have a working version I would be really thankful if you could provide me the compiled Generator. I also have access to RefProp.

I also tried the ZipFile, thanks! Everything works just fine except the organisation of the collums (picture).

Maybe someone has experienced something similar and has a easy solution for this type of bug.

But thanks a lot so far for everything!

Cheers!

 

raul.raghav posted this 26 April 2018

Seryoga, I personally have not used GitHub RGP GEN and it was suggested by a friend who used it in CFX 14.5.

But the zip file should work as it is the tool provided Ansys for generating RGP files. Could you share the RGP file that you generated? You might have to zip the RGP file and attach in your post.

Rahul

Seryoga posted this 26 April 2018

Sure!

I just reduced the size of the tables for a smaller file.

The other settings are untouched. Tested on Windows 7 and Windows 10. Unfortunately same bug.

Thanks for the support!

Greetings,

Sergjo

Attached Files

raul.raghav posted this 30 April 2018

Seryoga, sorry for the late response. I checked your RGP file. I don’t think the organization of the columns would affect anything. I tried inputting the RGP file and i was able to create the homogeneous binary mixture of N2 and N2VAP. The only problem i had was with the saturation properties. Once i made a few changes to your RGP file according to the “Organization of an .rgp file” link I had posted earlier, it seemed to work for me. Did you figure out a way to solve your problem?

Rahul

  • Liked by
  • Seryoga
Seryoga posted this 04 May 2018

Hello Raul!

Thank you for your answer.

"sorry for the late response" - No worries!

"Once i made a few changes to your RGP file according to the “Organization of an .rgp file”" - You're right! I missed to add the line;

SAT_TABLE
  10      4       9

Since the SAT_TABLE is the same as for the vapour phase, I don't have to copy it in the RGP file for the N2VAP right?

Furthermore I have a question belonging to the ANSYS RGP TOOL. Is it possible to generate the RGP files for other components than the ones which are listed in the dat.txt? I tried to change the fluids (names/formulas) in the collum but it didnt work for me...(using names of the components in the fluids folder).

To save time I'm currently working with an untested rgp-tool (beta version) which was made by the company I work for. The organisation and the values of the RGP file look very promising/right. As I'm not very experienced with ANSYS CFX Multiphase I started to simulate a simple heated pipe of water before starting to work on my actual and more complex thesis.

The target is also to achieve a phase change.

- I took the water.rgp file with waterLIQ/waterVAP values inside and created two seperate new materials:

   waterLIQ with the thermodynamic state "liquid" using the water.rgp.

   waterVAP with the thermodynamic state "gas" using the same water.rgp.

- Created a new material: Water combining the two materials waterLIQ and waterVAP into a homogenous binary mixture while still using the same water.rgp file for the Saturation Properties with the right Component Name for the SAT_TABLE.

Now after setting up the simulation, I'm facing a really annoying problem. Ansys refuses to start with the initial conditions I set up before. The initial static temperature on the Inlet of the heated pipe is set to 300K but however Ansys is starting at 398K. After ~200 iterations and a converging deviation the solver suddenly realizes the right initial temperature/pressure and also the right density. Around 50 iterations later the simulations starts to diverge and crashes.

Unfortunately I'm running out of ideas since I doulechecked everything. Have you ever experienced something similar?

Pipewalls are smooth. No Slip Wall. Inlet is subsonic. waterLIQ mass fraction is set 1.0 at the inlet.

 

Thanks for the help so far!

Sergjo

 

 

raul.raghav posted this 04 May 2018

To create RGP files of other fluids, you can copy the contents of your fluid.fld to NITROGEN.fld (in the "fluids" folder) and edit the dat.txt file with the appropriate table size, Tmax, Tmin, Pmax and Pmin data. So the component names of your RGP files would still be N2 and N2VAP but it would hold information of your fluid fluidVAP .

Your setup of Materials with RGP file in CFX-Pre sounds right to me.

Sometimes increasing the superheated range rectifies a lot of errors but I can't say for sure why or what the errors are in your case. If you could post a few images of the errors you're facing, I can get back to you with something.

Rahul

  • Liked by
  • Seryoga
Seryoga posted this 07 May 2018

Hello Raul!

To create RGP files of other fluids, you can copy the contents of your fluid.fld to NITROGEN.fld (in the "fluids" folder) and edit the dat.txt file with the appropriate table size, Tmax, Tmin, Pmax and Pmin data. So the component names of your RGP files would still be N2 and N2VAP but it would hold information of your fluid fluidVAP .

Worked out fine for me! Big Thanks!!!

I'll try to make the setup of the simulation as transparent as possible for you;

  • Heated Pipe 45x500 [mm] with monitoring points IN/PRE/MID/AFTER/OUT (as seen in the upper picure in yellow)
  • Fluid:
    • water.rgp as a homogenous binary mixture
    • T: 274 [K] - 600 [K]
    • P: 0.1 [bar] - 100[bar]
    • Heat Transfer: Total Energy Incl. Viscous Work Term
    • Turbulence: Shear Stress Transport
    • Component Models: waterLIQ - Equilibrium Fraction /// waterVAP - Equilibrium Constraint
  • Inlet:
    • Subsonic
    • Static Pressure 2 [bar]
    • Flow Direction: Zero Gradient
    • Turbulence: Medium (Intensity = 5%)
    • Heat Transfer: Static Temperature 320 [K]
    • Component Details: waterLIQ mass fraction 1.0
  • Outlet:
    • Subsonic
    • Average Static Pressure Over Whole Outlet 1.8 [bar]
  •  Fluid Wall/Boundary:
    • No Slip Wall
    • Smooth Wall
    • Heat Flux
  • Mesh:
    •    Sweep Method


As described in the previous post, the solver is not starting with the given initial values (temperature & density). There are no errors in the first couple of iterations.



After a couple of iterations, the solver starts to converge and accepts the initial values. But as soon as this is happening the following warning occurs

A couple of iterations later I'm getting 'clipping-warnings' all over the values. Later as the solver is moving into the right direction of temperature and density values of the other monitoring points (as seen in the picture of the density graphs), the simulation diverges and crashes.


Double Precision is activated. Changing the time scale factor did not help. I'll also attach the water.rgp file at the end of this post (The table size is only 30x30 since I got the same deviation with bigger ones like 200x200).

Hope these Information are sufficient. If not, let me know!

Thanks a lot so far!

Sergjo    

Attached Files

Moosarreza posted this 12 May 2018

Hi!
I'm absolutely thankful for the way you shared for rgp file generating;
but I have a question:
for generating data for another fluids what change should be done?
hope to hear soon;
Best regards.

raul.raghav posted this 12 May 2018

Sergjo, I don't think I'd be able to help you with the errors. But here are a few suggestions that I'd follow if I were you.

1. Perform an ideal gas simulation and get a converged solution. Now use this converged solution as the initial condition for your real gas simulation.

2. Try increasing the size of your table. Try with 300, 500 points etc. and see if things get any better or get solved.

Rahul

  • Liked by
  • Seryoga
raul.raghav posted this 12 May 2018

Moosarreza, I posted the following in an earlier comment. Hope this helps!

 

To create RGP files of other fluids, you can copy the contents of your fluid.fld to NITROGEN.fld (in the "fluids" folder) and edit the dat.txt file with the appropriate table size, Tmax, Tmin, Pmax and Pmin data. So the component names of your RGP files would still be N2 and N2VAP but it would hold information of your fluid fluidVAP .

Your setup of Materials with RGP file in CFX-Pre sounds right to me.

Sometimes increasing the superheated range rectifies a lot of errors but I can't say for sure why or what the errors are in your case. If you could post a few images of the errors you're facing, I can get back to you with something.

Rahul

Moosarreza posted this 16 May 2018

Thanks alot;
best regards for you;

Seryoga posted this 07 June 2018

Hello Rahul,

Thank you for your advice. Unfortunately I'm still struggling with the simulation. I managed to start the Simulation with the initial conditions. But as soon as the Temperature/Pressure is reaching the boilingpoint of water I'm getting the following warning:

The Total Pressure becomes negative and causes other variables to clip. As a result the simulation is not converging.

I think I will open a new thread since this topic is very underexplained in the ansys documentary and has nothing to do with the creation of an RGP file anymore.

I also tested the RGP file with a single Phase simulation. Everything went very well and converged.

Best regards,

Sergjo

gonzix94 posted this 18 July 2018

 Hi,

I am currently performing the design of a centrifugal compressor working with supercritical CO2 and I wanted to know if the NISTtoRGP application it was posted before can be used for generating the properties table in that state.

I have tried to get values from 1 MPa to 30 MPa (Pcrit=7.37MPa), but it is a bit strange because while creating the tables this message appears:

TPRHO failed so extrapolating 2D data.

P/Pc=(increasing factor until reaching the critical pressure)

I have seen that this does not happen if I just go beyond the critical point.

Can anybody help with this? How can I create a look-up table that include two-phase and supercritical states?

In addition, when I run a simulation with the rgp file I am attaching and my simulation quickly "converges" after like 4 iterations after clipping a lot of variables and putting a lot of walls in the outflow region to avoid reverse flow!!! A total non-sense... Any guesses what is going on?

My inlet conditions are the following ones, just in case it helps:

P=7.69 MPa

T=305K

m=3.06 kg/s

V=25.67 m/s

N=75000 rpm

Thanks!!

abbas posted this 27 August 2018

Hello everybody,

 

I am trying to create two different RGP tables in CFX, which one of them is fluid and another one is vapor. Should I define two different saturate line too for both phases? I simulate a co2 two phases flow and I need both phases. Does anyone have this experience or similar?

 

Thanks

Abbas

abenhadj posted this 28 August 2018

Hi,

You will need both materials as you need to account for phase changes or at least the flow of this two aggregate states in one simulation. Actually there is a more elegant way to get the RGP tables out of the shipped NIST property files which come with the Fluent. This way involves the usage of AIM im batch. 

Best regards,

Amine

Stoki posted this 06 September 2018

Hi,abenhadj,

I'm very interested in the "more elegant way" to get RGP file by AIM. Would it  be possible to give more details or some examples?

Thanks.

Stoki

 

abenhadj posted this 06 September 2018

 Please contact your ASC at your university who might check there with local support. The approach is via the AFD solver (AIM) where the NIST materials are translated to RGP files.

Best regards,

Amine

  • Liked by
  • abbas
abbas posted this 4 weeks ago

Thanks, dear abenhadj. 

So, based on your suggestion, I don't need to generate the RGP table for CFX and I can use AFD solver. My question is: my work is in two phases of CO2 simulation. So, according to AFD solver, both phases will be generated? Could you give me some references about how I can use AFD solver and etc.?

Best regards

abbas posted this 4 weeks ago

I have generated the RGP table for both liquid and vapor CO2. I should define both liquid and vapor saturation line because I have two phases but when I use the Homogenous Binary Mixture to introduce both materials, I am facing with saturation properties. Does anyone have the experience of generating RGP table for liquid and vapor phases?

Best regards 

abbas posted this 3 days ago

Hi Seryoga,

 

When you created two fluid(liquid and vapor) water with RGP table, how do you use Homogenous Binary Mixture. Because in the saturation properties I must put again the saturation table. How do you do that because I already add the saturation table in RGP table.

Best regards

Abbas

Close