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

  • 129 Views
  • Last Post 2 weeks ago
Seryoga posted this 5 weeks ago

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 5 weeks ago

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.

If you want to explore other options, there is an RGP generator that you get here: Real Gas Property File Generator for ANSYS CFX

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.

Refer to the following links for more information:

Ansys CFX: Using Real Gas Property (.rgp) table files

Ansys CFX: Real Gas Property (RGP) File Format

Ansys CFX: Organization of an .rgp File

Ansys CFX: Homogeneous Binary Mixture

Ansys CFX: Material properties Tables

 

Rahul

Attached Files

  • Liked by
  • Seryoga
Seryoga posted this 4 weeks ago

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 4 weeks ago

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 4 weeks ago

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 4 weeks ago

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 3 weeks ago

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 3 weeks ago

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 3 weeks ago

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 2 weeks ago

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 2 weeks ago

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

raul.raghav posted this 2 weeks ago

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 2 weeks ago

Thanks alot;
best regards for you;

Close