pandapipes icon indicating copy to clipboard operation
pandapipes copied to clipboard

Gas mixture simon

Open kbensafta opened this issue 1 year ago • 2 comments

This PR rectifies the gas mixture compressiblity calculation and merges the changes from the master branch in the kbensafta:gas_mixture_simon branch to make the latter pass the tests.

The SRK method has been implemented for the compressibility calculation (see G. Soave, Equilibrium constants from a modified Redlich-Kwong equation of state). The new function is calculate_mixture_compressibility_fact in properties_toolbox.py. Among other changes, the gas mixture compressibility takes now the temperature into account. A test has been added (test_compressibility in pandapipes/test/api/test_special_networks.py) to compare the results of the calculation with CoolProp results.

Minor changes:

  • rectification of the calculate_molar_fraction_from_mass_fraction function (also in properties_toolbox.py)
  • add critical data to the fluids text files and (critical temperature, critical pressure and acentric factor) to the Fluid class.

Note: The folder tests_gas_mix is not necessary and have to be ignored during the final PR to the develop branch. SRK_TEST.ipynb contains the script that produces the CoolProp results for the compressiblity. This could/should be saved somewhere outside of the pandapipes repository.

kbensafta avatar Jul 26 '23 08:07 kbensafta

Can you make the tests pass, e.g. by merging the current develop into this PR? (or at least delete Python 3.7 from the test pipeline)

jkisse avatar Jul 26 '23 13:07 jkisse

Codecov Report

Attention: Patch coverage is 81.93018% with 616 lines in your changes are missing coverage. Please review.

Project coverage is 83.55%. Comparing base (f9b7cb0) to head (1623ae4). Report is 67 commits behind head on gas_mixture.

:exclamation: Current head 1623ae4 differs from pull request most recent head 9a8fb85. Consider uploading reports for the commit 9a8fb85 to get more accurate results

Files Patch % Lines
pandapipes/converter/stanet/table_creation.py 66.11% 184 Missing :warning:
pandapipes/create.py 72.22% 70 Missing :warning:
pandapipes/properties/fluids.py 48.00% 65 Missing :warning:
pandapipes/converter/stanet/preparing_steps.py 81.30% 43 Missing :warning:
pandapipes/properties/properties_toolbox.py 68.61% 43 Missing :warning:
pandapipes/std_types/std_type_class.py 64.03% 41 Missing :warning:
...es/multinet/control/controller/multinet_control.py 48.14% 28 Missing :warning:
pandapipes/component_models/pump_component.py 77.27% 20 Missing :warning:
pandapipes/pf/derivative_toolbox_numba.py 25.00% 18 Missing :warning:
pandapipes/converter/stanet/stanet2pandapipes.py 78.20% 17 Missing :warning:
... and 21 more
Additional details and impacted files
@@               Coverage Diff               @@
##           gas_mixture     #550      +/-   ##
===============================================
- Coverage        87.07%   83.55%   -3.53%     
===============================================
  Files               79       93      +14     
  Lines             4681     7277    +2596     
===============================================
+ Hits              4076     6080    +2004     
- Misses             605     1197     +592     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 01 '23 11:10 codecov[bot]