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

RGP Files

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2023, 08:52
Default RGP Files
  #1
New Member
 
Tahmineh
Join Date: Apr 2022
Posts: 8
Rep Power: 4
TahminehAd is on a distinguished road
Hello everyone, I am using Python to create a RGP file, I am using the following commands that have been suggested by ANSYS to create such file. But I get the error: No module named pyExt.RefProp. I have installed all the pip packages in Python but I still get this error. Can anyone help me to understand how I can solve this problem?

Python commands:

import pyExt.RefProp as arp
fluidsPath = arp.getFluidsPath()
mat = arp.RefPropLib()

fluidList = ['fluids/water.fld']
mat.setup(fluidsPath, fluidList)

interpError = 1.0e-3
Tmin = 300.0
Tmax = 700.0
Pmin = 100000.0
Pmax = 25000000.0

# Generate both the liquid and vapor components, independent settings possible
h2ollow = arp.RGPLiquid("H2OL", Tmin, Tmax, Pmin, Pmax, interpError)
h2ollow.setMetastable(False)
h2ovlow = arp.RGPVapor("H2OV", Tmin, Tmax, Pmin, Pmax, interpError)
h2ovlow.setMetastable(False)
arp.generateRGPfile("H2O-low.rgp", h2ollow, h2ovlow)

# Generate both the liquid and vapor components in the RGP file in one go
h2omed = arp.RGPSettings("H2O", Tmin, Tmax, Pmin, Pmax, 1.0e-4, arp.ADAPT_AUTO_TP)
arp.generateRGPfile("H2O-med.rgp", h2omed)

# Generate just the vapor component in the RGP file, for entire range
h2ovapor = arp.RGPVapor("H2OV", interpError)
arp.generateRGPfile("H2O-vapor.rgp", h2ovapor)
TahminehAd is offline   Reply With Quote

Old   May 15, 2023, 10:07
Default
  #2
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,167
Rep Power: 23
evcelica is on a distinguished road
What ANSYS Version are you using? I have this working for v21.2, and I believe it may be different for different ANSYS versions.
This output a 1399 kB .rgp file names Water.rgp. My version includes no metastable properties.

Paste this into command prompt: Make sure you change the paths and file names in the second part to match where your python script is, saved as a .py file.
My python file name is "genRGPnometa.py" your may be different.
"C:\Program Files\ANSYS Inc\v212\SystemCoupling\bin\systemcoupling" -R "C:\My Programs\RGP_generator\genRGPnometa\genRGPnometa.p y"

Here is what is in my python file, with the stuff I don't need commented out:
Change the last uncommented line to the path where you want your rgp file written.

import pyExt.RefProp as arp
fluidsPath = arp.getFluidsPath()
mat = arp.RefPropLib()

fluidList = ['fluids/Water.fld'] # Change the REFPROP fluid here~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mat.setup(fluidsPath, fluidList)

interpError = 1e-3 # Change accuracy/file size here, units for T,P are [K] and [Pa]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tmin = 300
Tmax = 700
Pmin = 100000.0
Pmax = 25000000.0
fluid_name = 'Water' #This is the Fluid Name, which will be followed by L or V for the Phase~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
# Component names for Liq, Vap and Mix are NameL, NameV, and NameL

# Generate both the liquid and vapor components in the RGP file in one go

fluid = arp.RGPSettings(fluid_name, Tmin, Tmax, Pmin, Pmax, interpError, arp.ADAPT_AUTO_TP)
print(dir(fluid))
# fluid.setMetastable(False) # For version 202 and before

# Uncomment below for 212 version
fluid_liq = fluid.getLiquid()
fluid_liq.setMetastable(False)
fluid_vap = fluid.getVapor()
fluid_vap.setMetastable(False)

arp.generateRGPfile("C:\My Programs\RGP_generator\genRGPnometa\Water.rgp", fluid) # Provide Output path and filename here~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~

# Generate both the liquid and vapor components, independent settings possible
##h2ollow = arp.RGPLiquid("H2OL", Tmin, Tmax, Pmin, Pmax, interpError)
##h2ollow.setMetastable(False)
##h2ovlow = arp.RGPVapor("H2OV", Tmin, Tmax, Pmin, Pmax, interpError)
##h2ovlow.setMetastable(False)
##arp.generateRGPfile("H2O-low.rgp", h2ollow, h2ovlow)


# Generate just the vapor component in the RGP file, for entire range
##h2ovapor = arp.RGPVapor("H2OV", interpError)
##arp.generateRGPfile("H2O-vapor.rgp", h2ovapor)
evcelica is offline   Reply With Quote

Old   May 16, 2023, 04:52
Default
  #3
New Member
 
Tahmineh
Join Date: Apr 2022
Posts: 8
Rep Power: 4
TahminehAd is on a distinguished road
Thank you for your response. I am using ANSYS V22.2 and I do exactly what you said. But the issue is that the command "import pyExt.RefProp as arp" gives me the error. Even though I installed all the packages but still it says " No module named 'pyExt' ". I am wondering if I need to install something else or if the folder RefProp needs to be changed? or anything else I should do?
TahminehAd is offline   Reply With Quote

Old   May 16, 2023, 05:51
Default
  #4
New Member
 
Tahmineh
Join Date: Apr 2022
Posts: 8
Rep Power: 4
TahminehAd is on a distinguished road
Or if someone could just give me the RGP table for water liquid in normal pressure (ambient pressure 1-1.5Mpa), I would appreciate it a lot.
TahminehAd is offline   Reply With Quote

Old   May 16, 2023, 14:04
Default
  #5
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,167
Rep Power: 23
evcelica is on a distinguished road
For water, you can just use the built in IAWPS library data (If you are using CFX) I don't know if fluent has one?
Otherwise, PM me your email and I'll send you the file I generated using your inputs.

Actually, I just did this with v222, worked perfectly.
Change the path and name file to where the python script is on your machine.
Your path and python name are definitely different than what I have in Bold. Also get rid of the space between p and y, I don't know why it does that here?
"C:\Program Files\ANSYS Inc\v222\SystemCoupling\bin\systemcoupling" -R "C:\My Programs\RGP_generator\genRGPnometa\genRGPnometa.p y"

Make sure you change all the paths to folders on your machine, including where to write the output file.
evcelica is offline   Reply With Quote

Old   August 1, 2023, 12:38
Default
  #6
New Member
 
Join Date: Jul 2023
Posts: 5
Rep Power: 2
Bak16 is on a distinguished road
Thank you very much for your help. I tried running the code in Command Console as ANSYS User guide says. Specifically on Command prompt I type
> cd C:\Program Files\ANSYS Inc\v222\SystemCoupling\bin
> systemcoupling.bat
After that I call evcelica's code in a file which I have named RGPGeneration.py with the following command:
exec(open('C:/Users/Documents/RGPGeneration.py').read())

They following are printed on the screen and no .rgp file is generated inside the chosen folder. How can I fix this?

Selecting adapation option for component WaterL
Relative error is 0.001000
Adapting using the automatic option.
Adapting including the saturation boundary.
Number of temperature seed points = 3
Number of pressure seed points = 3
Building tables for component WaterL
Tmin = 3.000000e+02 K
Tmax = 7.000000e+02 K
Pmin = 1.000000e+05 Pa
Pmax = 2.500000e+07 Pa
Viscosity Tmin = 3.000000e+02 K
Viscosity Tmax = 7.000000e+02 K
Viscosity Pmax = 2.500000e+07 Pa
Conductivity Tmin = 3.000000e+02 K
Conductivity Tmax = 7.000000e+02 K
Conductivity Pmax = 2.500000e+07 Pa
Metastable extrapolation deactivated
Property nT nP Spinodal Failures (7.00e-01) Superheat Failures
Enthalpy 24 81 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Sound speed 21 21 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Volume 73 75 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Cv 18 25 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Cp 41 45 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
dP/dV_T 36 47 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Entropy 25 85 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Viscosity 29 28 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Conductivity 27 26 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Saturation
Pmin = 1.000000e+05 Pa
Pmax = 2.500000e+07 Pa
Tmin = 3.727559e+02 K
Tmax = 6.470960e+02 K
Surface tension
Liquid saturation properties.
Vapor saturation properties.

Selecting adapation option for component WaterV
Relative error is 0.001000
Adapting using the automatic option.
Adapting including the saturation boundary.
Number of temperature seed points = 3
Number of pressure seed points = 3
Building tables for component WaterV
Tmin = 3.000000e+02 K
Tmax = 7.000000e+02 K
Pmin = 1.000000e+05 Pa
Pmax = 2.500000e+07 Pa
Viscosity Tmin = 3.000000e+02 K
Viscosity Tmax = 7.000000e+02 K
Viscosity Pmax = 2.500000e+07 Pa
Conductivity Tmin = 3.000000e+02 K
Conductivity Tmax = 7.000000e+02 K
Conductivity Pmax = 2.500000e+07 Pa
Metastable extrapolation deactivated
Property nT nP Spinodal Failures (6.00e-01) Superheat Failures
Enthalpy 51 127 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Sound speed 19 22 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Volume 187 97 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Cv 21 23 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Cp 48 52 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
dP/dV_T 90 47 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Entropy 30 84 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Viscosity 17 23 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Conductivity 35 40 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Saturation
Pmin = 1.000000e+05 Pa
Pmax = 2.500000e+07 Pa
Tmin = 3.727559e+02 K
Tmax = 6.470960e+02 K
Surface tension
Liquid saturation properties.
Vapor saturation properties.

Writing file...
Writing header information...
Writing tables...
Writing WaterL 2D tables...
Writing WaterL saturation tables...
Writing WaterV 2D tables...
Writing WaterV saturation tables...
Bak16 is offline   Reply With Quote

Old   August 1, 2023, 16:38
Default
  #7
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,167
Rep Power: 23
evcelica is on a distinguished road
Did you change the output path to a valid path on your machine:
It's on this line:
arp.generateRGPfile("C:\My Programs\RGP_generator\genRGPnometa\Water.rgp", fluid) # Provide Output path and filename here~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~


I just open command prompt, change to C:, then paste in:
"C:\Program Files\ANSYS Inc\v222\SystemCoupling\bin\systemcoupling" -R "C:\My Programs\RGP_generator\genRGPnometa\genRGPnometa.p y" with the quotes, and get rid of the space between p and y. Change the path and file names of course in this as well as the .py file.



CMD Outputs:

Microsoft Windows [Version 10.0.19045.3208]
(c) Microsoft Corporation. All rights reserved.

U:\>C:

C:\>"C:\Program Files\ANSYS Inc\v222\SystemCoupling\bin\systemcoupling" -R "C:\My Programs\RGP_generator\genRGPnometa\genRGPnometa.p y"

Ansys(R) System Coupling

Executing from: C:\PROGRA~1\ANSYSI~1\v222\SYSTEM~1\bin\systemcoupl ing.bat

2022 R2

Point Releases and Patches installed:

ANSYS, Inc. License Manager 2022 R2
Autodyn 2022 R2
SpaceClaim 2022 R2
LS-DYNA 2022 R2
CFD-Post only 2022 R2
CFX (includes CFD-Post) 2022 R2
FENSAP-ICE 2022 R2
Fluent (includes CFD-Post) 2022 R2
Polyflow (includes CFD-Post) 2022 R2
Forte (includes EnSight) 2022 R2
TurboGrid 2022 R2
ICEM CFD 2022 R2
Aqwa 2022 R2
Customization Files for User Programmable Features 2022 R2
Mechanical Products 2022 R2
Remote Solve Manager Standalone Services 2022 R2
Viewer 2022 R2
ACIS Geometry Interface 2022 R2
AutoCAD Geometry Interface 2022 R2
Catia, Version 4 Geometry Interface 2022 R2
Catia, Version 5 Geometry Interface 2022 R2
Catia, Version 6 Geometry Interface 2022 R2
Creo Elements/Direct Modeling Geometry Interface 2022 R2
Creo Parametric Geometry Interface 2022 R2
Inventor Geometry Interface 2022 R2
JTOpen Geometry Interface 2022 R2
NX Geometry Interface 2022 R2
Parasolid Geometry Interface 2022 R2
Solid Edge Geometry Interface 2022 R2
SOLIDWORKS Geometry Interface 2022 R2

(c) 2014-2022 ANSYS, Inc. All rights reserved. Unauthorized use, distribution
or duplication is prohibited. This product is subject to U.S. laws governing
export and re-export. For full Legal Notice, see documentation.

executing script 'C:\My Programs\RGP_generator\genRGPnometa\genRGPnometa.p y'
Found REFPROP fluids files at C:\PROGRA~1\ANSYSI~1\v222\SYSTEM~1\runTime\winx64\ etc\RefProp\refprop10
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__swig_destroy__', '__weakref__', 'getLiquid', 'getVapor', 'limitsProvided', 'matName', 'this', 'thisown']
Generating RGP file C:\My Programs\RGP_generator\genRGPnometa\Water.rgp
Selecting adapation option for component WaterL
Relative error is 0.001000
Adapting using the automatic option.
Adapting including the saturation boundary.
Number of temperature seed points = 3
Number of pressure seed points = 3
Building tables for component WaterL
Tmin = 3.000000e+02 K
Tmax = 7.000000e+02 K
Pmin = 1.000000e+05 Pa
Pmax = 2.500000e+07 Pa
Viscosity Tmin = 3.000000e+02 K
Viscosity Tmax = 7.000000e+02 K
Viscosity Pmax = 2.500000e+07 Pa
Conductivity Tmin = 3.000000e+02 K
Conductivity Tmax = 7.000000e+02 K
Conductivity Pmax = 2.500000e+07 Pa
Metastable extrapolation deactivated
Property nT nP Spinodal Failures (7.00e-01) Superheat Failures
Enthalpy 24 81 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Sound speed 21 21 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Volume 73 75 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Cv 18 25 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Cp 41 45 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
dP/dV_T 36 47 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Entropy 25 85 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Viscosity 29 28 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Conductivity 27 26 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Saturation
Pmin = 1.000000e+05 Pa
Pmax = 2.500000e+07 Pa
Tmin = 3.727559e+02 K
Tmax = 6.470960e+02 K
Surface tension
Liquid saturation properties.
Vapor saturation properties.

Selecting adapation option for component WaterV
Relative error is 0.001000
Adapting using the automatic option.
Adapting including the saturation boundary.
Number of temperature seed points = 3
Number of pressure seed points = 3
Building tables for component WaterV
Tmin = 3.000000e+02 K
Tmax = 7.000000e+02 K
Pmin = 1.000000e+05 Pa
Pmax = 2.500000e+07 Pa
Viscosity Tmin = 3.000000e+02 K
Viscosity Tmax = 7.000000e+02 K
Viscosity Pmax = 2.500000e+07 Pa
Conductivity Tmin = 3.000000e+02 K
Conductivity Tmax = 7.000000e+02 K
Conductivity Pmax = 2.500000e+07 Pa
Metastable extrapolation deactivated
Property nT nP Spinodal Failures (6.00e-01) Superheat Failures
Enthalpy 51 127 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Sound speed 19 22 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Volume 187 97 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Cv 21 23 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Cp 48 52 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
dP/dV_T 90 47 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Entropy 30 84 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Viscosity 17 23 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Conductivity 35 40 0 0.00% 0 0.00% 0 0.00% | 0 0.00% 0 0.00% 0 0.00%
Saturation
Pmin = 1.000000e+05 Pa
Pmax = 2.500000e+07 Pa
Tmin = 3.727559e+02 K
Tmax = 6.470960e+02 K
Surface tension
Liquid saturation properties.
Vapor saturation properties.

Writing file...
Writing header information...
Writing tables...
Writing WaterL 2D tables...
Writing WaterL saturation tables...
Writing WaterV 2D tables...
Writing WaterV saturation tables...
evcelica is offline   Reply With Quote

Old   August 1, 2023, 17:01
Default
  #8
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,167
Rep Power: 23
evcelica is on a distinguished road
Why don't you just make a folder C:/temp and put everything there, including your py file and write your output there as well. Then we can see that your paths are set up correctly.
Right now we can't see what you are doing and where you are writing to.
evcelica is offline   Reply With Quote

Old   August 2, 2023, 10:33
Default
  #9
New Member
 
Join Date: Jul 2023
Posts: 5
Rep Power: 2
Bak16 is on a distinguished road
It worked! Thank you so much!
Bak16 is offline   Reply With Quote

Reply

Tags
ansys fluent 2019r3, python module, rgp file


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
[ICEM] Import multi-block files Adrian_chaves ANSYS Meshing & Geometry 1 February 1, 2021 11:09
problem compiling with header files jreiter164 Fluent UDF and Scheme Programming 2 August 14, 2015 17:31
attaching trn files hossein_sml CFX 1 August 5, 2015 19:17
Problem Reading Fluent Files. Spy-k14 Tecplot 1 April 29, 2015 08:17
Writing Case and Data Files Using Journal/Scheme Files svp Fluent UDF and Scheme Programming 0 April 5, 2011 11:04


All times are GMT -4. The time now is 22:46.