Package: realtpl
What isrealtpl?realtpl(real gas thermodynamic python library) computes the density (rho),
heat capacity (cp), speed of sound (sound), viscosity (visc) and heat
conductivity (lambda) using a thermodynamic model based on cubic equations of
state (EoS) and compares it with reference data from the open source libraryCoolProp. The cubic EoS are the well-known Soave-Redlich-Kwong (SRK) and
Peng-Robinson (PR) EoS and the more sophisticated three-parameter
Redlich-Kwong-Peng-Robinson (RKPR) EoS. The latter employs the critical compressibility
factor for the EoS parameters, for details see referenceTrummler et al.. The
current implementation is primarily designed to evaluate results over a temperature range
(with defined number of temperature steps) for a given pressure level. The data
is displayed graphically and can also be exported tocsvfiles for further
processing. The only mandatory input is the fluid name, the temperature range
and the pressure. Moreover, there is the additional feature to evaluate the data
over a desired temperature and pressure range aiming to support table generations.Fluid properties, such as mass, critical pressure etc., are directly extracted
fromCoolProp. This data is also saved to the output directory (specified in
the configuration file) as<fluidname>.out. For the calculation of the heat
capacity a reference value has to be evaluated, which is done using the NASA 7
or 9 coefficient polynomials. Therefore, the corresponding coefficients have to be provided.
For selected fluids, we have already generated a database in the
corresponding file -nasa_7.yamlornasa_9.yaml. More data can be found in
the references provided in the header of these files.A special feature ofrealtplis that all calculations with the suggested
thermodynamic model are vectorized, making them very fast.Motivation and targeted audiencerealtplis open-source software (under GNU GPL License) for physicists,
engineers, scientists, technicians and anyone interested in real gas
thermodynamics. It runs on all operating systems which support Python, is quick
to install, free of charge and designed to be easy to use. The indented use is
to run the executable and modify the configuration files only.realtplhas been specifically designed to be used for CFD
simulations. Checking the accuracy of a thermodynamic model in advance is a
central step before conducting CFD simulations. For different fluids as well as
different pressure and temperature ranges, such an evaluation can be complicated
and especially time-consuming. To this end, we have writtenrealtplto easily
compare the results obtained with a thermodynamic model based on cubic EoS. For more details
see referenceTrummler et al..Installationrealtplis available as a Python package. Usingpipyou can simply install
it with:pipinstallrealtplAdditionally,realtplis also available on githubhttps://github.com/ttrummler/realtpl. Clone the latest version with:gitclonehttps://github.com/ttrummler/realtplAnd proceed to install (use the-eoption for an editable installation):cdrealtpl
pipinstall.After installation, you will have an executable namedrealtpl, which you can
run anywhere.TestingTesting is configured usingtox. If not already installed, installtoxusing pippipinstalltoxThen, you can simply enter thetoxand the tests will automatically be executedtoxNotethat it might not run for all tested python versions (py38, py39,
py310) on your OS.RunningrealtplTo run the test example userealtpl--config/path/to/tests/example/config.yamlIn the configuration file everything for the computation is specified.Configuration fileSeetests/example/for example configuration files.
A minimum working example for the configuration file reads:fluid_name:nHexanepressure_Pa:6.0e+06temperature_start_K:300temperature_end_K:600Note that pressure and temperature input has to be in the SI units Kelvin and
Pascal, as also indicated in the parameter names.Additional optional configuration parameters are:fluid_name:nHexaneeos_list:[SRK,PR,RKPR]# optional; default: SRK, PR, RKPR;include_ref_data:true# optional; default: truepressure_Pa:6.0e+06temperature_start_K:300temperature_end_K:600temperature_step_K:1# optional; default: 1n_nasa_coeff:7# optional; default: 7output_dir:results# optional; default: resultssave_data_to_csv:true# optional;show_plots:false# optional; default: truesave_plots:true# optional; default: falseshow_deviation:true# optional; default: falsesave_deviation:true# optional; default: falseperformance_tracking:true# optional; default: falseApart from that, also evaluations for a pressure and temperature range are
possible. However, then no graphical output can be activated.fluid_name:nHexaneeos_list:[SRK,PR,RKPR]include_ref_data:truepressure_start_Pa:4.0e+06pressure_end_Pa:8.0e+06pressure_step_Pa:1.0e+06temperature_start_K:300temperature_end_K:600temperature_step_K:100n_nasa_coeff:7output_dir:resultssave_data_to_csv:trueshow_plots:falsesave_plots:falseThe configuration data used for the calculation is written out to the output
directory toconfig_data.out.The selection of fluids (fluid_name) is limited by the availability of
corresponding NASA coefficients in the data filesnasa_X.yaml. Currently
available fluids are listed at the end of this description.Latest source codeThe latest development version ofrealtplcan be obtained athttps://github.com/ttrummler/realtplBug reportsTo report bugs, please userealtpl’s Bug Tracker at:https://github.com/ttrummler/realtplLicense informationSee LICENSE for information on the terms & conditions for usage of this
software, and a DISCLAIMER OF ALL WARRANTIES.Citerealtplif used in your work or to generate data required for your
work. Cite as:Trummler, T., Glatzle, M., Doehring, A., Urban, N., Klein, M.,
Thermodynamic modeling for numerical simulations based on the generalized cubic
equation of state.NOTEthe license for the included database of the 7 coefficient NASA
polynomials used for the calculation of the caloric properties. Using this
data requires proper citation to be included in the pertinent publications.
Cite:Goos, E., Burcat, A., Ruscic, B.. New NASA Thermodynamic Polynomials Database
With Active Thermochemical Tables updates. Report ANL 05/20 TAE 960.CitationTo citerealtplin publications use:Trummler, T., Glatzle, M., Doehring, A., Urban, N., Klein, M., Thermodynamic
modeling for numerical simulations based on the generalized cubic equation of state.Available fluidsThe selection of fluids (fluid_name) is limited by the availability of
corresponding NASA coefficients in the data filesnasa_X.yaml. Extensions
are possible at any time and can be achieved by simply adding the correct data
in the filenasa_7.yamlornasa_9.yaml. The currently available fluids are
listed below. Please pay attention to the identical spelling of the fluid
names in the configuration file.NASA 7 coefficient polynomials (n_nasa_coeff: 7):NitrogennDodecanenHexaneCyclohexaneCyclopentaneMethaneMethanolEthanolPropaneButanenPentaneCarbonDioxideNASA 9 coefficient polynomials (n_nasa_coeff: 9):NitrogenHydrogennDodecanenHexaneCyclopentaneCyclohexanePropaneMethaneCarbonDioxideMethanolEthanol