Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas mixture simon #550

Open
wants to merge 552 commits into
base: gas_mixture
Choose a base branch
from
Open

Conversation

kbensafta
Copy link
Contributor

@kbensafta kbensafta commented Jul 26, 2023

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.

sdrauz and others added 30 commits January 4, 2023 21:40
- stanet_nr is now -999 instead of NA (if applicable)
- remove xfails and unused imports
- fail safe if no layers available
- fail safe if slider diameter = 0
remove redundant entry about flow control
extended stanet converter documentation
added a test with two ext grids for flow control
dlohmeier and others added 28 commits September 6, 2023 09:28
- added "components" dict of arrays to pit
- every component can create its own internal array if needed (create_component_array in base_component.py)
- moved PRESSURE_RATIO and STD_TYPE from branch_idx.py to internal arrays of pumps and compressors, as they are only needed right there
- rename internal to only_active
- made component_type interchangeable ("brach" / "node")
# Conflicts:
#	pandapipes/__init__.py
#	pandapipes/component_models/abstract_models/base_component.py
#	pandapipes/component_models/abstract_models/branch_models.py
#	pandapipes/component_models/abstract_models/branch_w_internals_models.py
#	pandapipes/component_models/abstract_models/branch_wo_internals_models.py
#	pandapipes/component_models/abstract_models/branch_wzerolength_models.py
#	pandapipes/component_models/abstract_models/circulation_pump.py
#	pandapipes/component_models/abstract_models/const_flow_models.py
#	pandapipes/component_models/abstract_models/node_element_models.py
#	pandapipes/component_models/abstract_models/node_models.py
#	pandapipes/component_models/circulation_pump_mass_component.py
#	pandapipes/component_models/circulation_pump_pressure_component.py
#	pandapipes/component_models/component_toolbox.py
#	pandapipes/component_models/compressor_component.py
#	pandapipes/component_models/ext_grid_component.py
#	pandapipes/component_models/heat_exchanger_component.py
#	pandapipes/component_models/junction_component.py
#	pandapipes/component_models/pipe_component.py
#	pandapipes/component_models/pressure_control_component.py
#	pandapipes/component_models/pump_component.py
#	pandapipes/component_models/sink_component.py
#	pandapipes/component_models/source_component.py
#	pandapipes/component_models/valve_component.py
#	pandapipes/create.py
#	pandapipes/idx_branch.py
#	pandapipes/idx_node.py
#	pandapipes/io/convert_format.py
#	pandapipes/io/io_utils.py
#	pandapipes/multinet/control/controller/multinet_control.py
#	pandapipes/multinet/control/run_control_multinet.py
#	pandapipes/multinet/create_multinet.py
#	pandapipes/multinet/multinet.py
#	pandapipes/multinet/timeseries/run_time_series_multinet.py
#	pandapipes/networks/simple_gas_networks.py
#	pandapipes/networks/simple_heat_transfer_networks.py
#	pandapipes/networks/simple_water_networks.py
#	pandapipes/pandapipes_net.py
#	pandapipes/pf/pipeflow_setup.py
#	pandapipes/pf/result_extraction.py
#	pandapipes/pipeflow.py
#	pandapipes/plotting/collections.py
#	pandapipes/plotting/generic_geodata.py
#	pandapipes/plotting/simple_plot.py
#	pandapipes/properties/fluids.py
#	pandapipes/std_types/std_types.py
#	pandapipes/test/api/release_cycle/release_control_test_network.py
#	pandapipes/test/api/test_components/test_ext_grid.py
#	pandapipes/test/api/test_special_networks.py
#	pandapipes/test/multinet/test_control_multinet.py
#	pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py
#	pandapipes/test/openmodelica_comparison/test_heat_transfer_openmodelica.py
#	pandapipes/test/openmodelica_comparison/test_water_openmodelica.py
#	pandapipes/test/pipeflow_internals/test_inservice.py
#	pandapipes/test/pipeflow_internals/test_time_series.py
#	pandapipes/test/pipeflow_internals/test_update_matrix.py
#	pandapipes/test/properties/test_fluid_specials.py
#	pandapipes/test/run_tests.py
#	pandapipes/test/stanet_comparison/pipeflow_stanet_comparison.py
#	pandapipes/test/stanet_comparison/test_gas_stanet.py
#	pandapipes/test/stanet_comparison/test_water_stanet.py
#	pandapipes/timeseries/run_time_series.py
#	pandapipes/toolbox.py
#	pandapipes/topology/create_graph.py
#	setup.py
@codecov
Copy link

codecov bot commented Oct 1, 2023

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.

❗ 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 ⚠️
pandapipes/create.py 72.22% 70 Missing ⚠️
pandapipes/properties/fluids.py 48.00% 65 Missing ⚠️
pandapipes/converter/stanet/preparing_steps.py 81.30% 43 Missing ⚠️
pandapipes/properties/properties_toolbox.py 68.61% 43 Missing ⚠️
pandapipes/std_types/std_type_class.py 64.03% 41 Missing ⚠️
...es/multinet/control/controller/multinet_control.py 48.14% 28 Missing ⚠️
pandapipes/component_models/pump_component.py 77.27% 20 Missing ⚠️
pandapipes/pf/derivative_toolbox_numba.py 25.00% 18 Missing ⚠️
pandapipes/converter/stanet/stanet2pandapipes.py 78.20% 17 Missing ⚠️
... 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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants