processpi 0.2.0.3__tar.gz → 0.2.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {processpi-0.2.0.3 → processpi-0.2.0.4}/PKG-INFO +1 -1
- processpi-0.2.0.4/processpi/integration/__init__.py +5 -0
- processpi-0.2.0.4/processpi/integration/flowsheet.py +150 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi.egg-info/PKG-INFO +1 -1
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi.egg-info/SOURCES.txt +2 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/pyproject.toml +2 -1
- {processpi-0.2.0.3 → processpi-0.2.0.4}/LICENSE +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/README.md +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/base.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/engine.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/flow_type.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/friction_factor_colebrookwhite.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/optimium_pipe_dia.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/pressure_drop_darcy.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/pressure_drop_fanning.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/pressure_drop_hazen_williams.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/pump_power.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/reynolds_number.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/velocity.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/biot.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/boiling_chen.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/combined_modes.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/condensation.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/condensation_dropwise.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/condensation_nusselt.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/conduction_heat_loss.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/convection_heat_loss.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/crossflow_tube.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/fourier.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/fourierlaw.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/grashof.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/heat_exchanger_area.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/lmtd.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/newton_cooling.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/ntu.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/nusselt.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/overall_u.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/peclet.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/prandtl.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radial_cylinder.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radiation_blackbody.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radiation_exchange.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radiation_greybody.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radiation_viewfactor.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/resistance.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/reyleigh.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/rohsenow_boiling.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/stefan_boltzmann.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/mass_transfer/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/mass_transfer/distillation_stage_count.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/mass_transfer/drying_rate.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/reaction_engineering/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/reaction_engineering/catalyst_activity.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/reaction_engineering/reaction_rate.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/reaction_engineering/residence_time.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/thermodynamics/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/thermodynamics/enthalpy_change.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/thermodynamics/entropy_change.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/thermodynamics/heat_of_vaporization.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/aceticacid.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/acetone.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/acrylicacid.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/air.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/ammonia.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/base.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/benzene.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/benzoicacid.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/bromine.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/butane.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/carbondioxide.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/carbonmonoxide.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/carbontetrachloride.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/chlorine.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/chlorobenzene.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/chloroform.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/chloromethane.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/constants.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/cyanogen.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/cyclohexene.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/ethane.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/ethanol.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/ethylacetate.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/ethylene.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/fluorine.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/fluorobenzene.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/formicacid.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/gas.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/inorganic_liquid.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/methanol.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/oil.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/organic_liquid.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/steam.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/toluene.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/vapor.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/components/water.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/constants.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/absorber.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/base.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/batch.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/compressor.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/cstr.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/decanter.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/distillation.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/flash.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heater_cooler.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/base.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/examples.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/basic_params.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/bell_method.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/classification.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/condenser.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/double_pipe.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/evaporator.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/kern_method.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/reboiler.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/shell_tube.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/simulation.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/standards.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/utils.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers_.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/mixer.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/pfr.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/pumps.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/splitter.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/stripper.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/turbine.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/valves.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/base.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/design_rules.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/engine.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/equipment.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/fittings.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/insulation.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/materials.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/network.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/nozzle.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/pipelineresults.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/pipes.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/piping_costs.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/pumps.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/selection.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/standards.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/pipelines/vessel.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/streams/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/streams/energy.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/streams/material.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/__init__.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/area.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/base.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/density.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/diameter.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/dimensionless.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/heat_flow.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/heat_flux.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/heat_of_vaporization.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/heat_transfer_coefficient.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/length.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/mass.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/mass_flowrate.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/molar_flowrate.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/power.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/pressure.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/specific_heat.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/strings.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/temperature.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/thermal_conductivity.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/thermal_resistance.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/velocity.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/viscosity.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/volume.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/units/volumetric_flowrate.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi.egg-info/dependency_links.txt +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi.egg-info/requires.txt +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/processpi.egg-info/top_level.txt +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/setup.cfg +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/setup.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/tests/test_engine_network.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/tests/test_network.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/tests/test_pipeline_network.py +0 -0
- {processpi-0.2.0.3 → processpi-0.2.0.4}/tests/test_variables.py +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# processpi/flowsheet.py
|
|
2
|
+
|
|
3
|
+
from typing import List, Dict, Union
|
|
4
|
+
from ..equipment.base import Equipment
|
|
5
|
+
from ..streams.material import MaterialStream
|
|
6
|
+
from ..streams.energy import EnergyStream
|
|
7
|
+
from collections import defaultdict, deque
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Flowsheet:
|
|
11
|
+
"""
|
|
12
|
+
A flowsheet manager for sequential simulation.
|
|
13
|
+
|
|
14
|
+
Responsibilities:
|
|
15
|
+
- Hold equipment + streams
|
|
16
|
+
- Define explicit connections
|
|
17
|
+
- Auto-build execution order from connections
|
|
18
|
+
- Run equipment automatically
|
|
19
|
+
- Collect results for summary
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
def __init__(self, name: str):
|
|
23
|
+
self.name = name
|
|
24
|
+
self.equipment: List[Equipment] = []
|
|
25
|
+
self.material_streams: List[MaterialStream] = []
|
|
26
|
+
self.energy_streams: List[EnergyStream] = []
|
|
27
|
+
self.connections: List[Dict[str, Union[Equipment, MaterialStream, EnergyStream]]] = []
|
|
28
|
+
|
|
29
|
+
# --------------------------
|
|
30
|
+
# Add units + streams
|
|
31
|
+
# --------------------------
|
|
32
|
+
def add_equipment(self, unit: Equipment):
|
|
33
|
+
self.equipment.append(unit)
|
|
34
|
+
# Auto-register EnergyStream if present
|
|
35
|
+
if hasattr(unit, "energy_stream") and unit.energy_stream is not None:
|
|
36
|
+
if unit.energy_stream not in self.energy_streams:
|
|
37
|
+
self.energy_streams.append(unit.energy_stream)
|
|
38
|
+
|
|
39
|
+
def add_material_stream(self, stream: MaterialStream):
|
|
40
|
+
self.material_streams.append(stream)
|
|
41
|
+
|
|
42
|
+
def add_energy_stream(self, stream: EnergyStream):
|
|
43
|
+
self.energy_streams.append(stream)
|
|
44
|
+
|
|
45
|
+
# --------------------------
|
|
46
|
+
# Connections
|
|
47
|
+
# --------------------------
|
|
48
|
+
def connect(self, src, dst, port: str):
|
|
49
|
+
"""
|
|
50
|
+
Connect equipment and streams via named ports.
|
|
51
|
+
|
|
52
|
+
- (Stream → Equipment, port="inlet1" or "energy_in1")
|
|
53
|
+
- (Equipment → Stream, port="outlet1" or "energy_out1")
|
|
54
|
+
- (Equipment → Equipment, port="inletX" or "energy_inX")
|
|
55
|
+
"""
|
|
56
|
+
if isinstance(src, MaterialStream) and isinstance(dst, Equipment):
|
|
57
|
+
dst.inlets[port] = src
|
|
58
|
+
self.connections.append({"from": src, "to": dst, "port": port})
|
|
59
|
+
|
|
60
|
+
elif isinstance(src, EnergyStream) and isinstance(dst, Equipment):
|
|
61
|
+
dst.energy_in[port] = src
|
|
62
|
+
self.connections.append({"from": src, "to": dst, "port": port})
|
|
63
|
+
|
|
64
|
+
elif isinstance(src, Equipment) and isinstance(dst, MaterialStream):
|
|
65
|
+
src.outlets[port] = dst
|
|
66
|
+
self.connections.append({"from": src, "to": dst, "port": port})
|
|
67
|
+
|
|
68
|
+
elif isinstance(src, Equipment) and isinstance(dst, EnergyStream):
|
|
69
|
+
src.energy_out[port] = dst
|
|
70
|
+
self.connections.append({"from": src, "to": dst, "port": port})
|
|
71
|
+
|
|
72
|
+
elif isinstance(src, Equipment) and isinstance(dst, Equipment):
|
|
73
|
+
# Infer correct connection based on port prefix
|
|
74
|
+
if port.startswith("inlet"):
|
|
75
|
+
dst.inlets[port] = list(src.outlets.values())[0] # take first outlet
|
|
76
|
+
elif port.startswith("energy_in"):
|
|
77
|
+
dst.energy_in[port] = list(src.energy_out.values())[0] # take first energy outlet
|
|
78
|
+
else:
|
|
79
|
+
raise ValueError("Invalid port name for Equipment → Equipment connection.")
|
|
80
|
+
self.connections.append({"from": src, "to": dst, "port": port})
|
|
81
|
+
|
|
82
|
+
else:
|
|
83
|
+
raise ValueError("Unsupported connection type")
|
|
84
|
+
|
|
85
|
+
# --------------------------
|
|
86
|
+
# Dependency graph
|
|
87
|
+
# --------------------------
|
|
88
|
+
def _build_dependency_graph(self):
|
|
89
|
+
"""Build graph of unit dependencies based on connections"""
|
|
90
|
+
graph = defaultdict(list)
|
|
91
|
+
indegree = {u.name: 0 for u in self.equipment}
|
|
92
|
+
|
|
93
|
+
for conn in self.connections:
|
|
94
|
+
src, dst = conn["from"], conn["to"]
|
|
95
|
+
|
|
96
|
+
if isinstance(src, Equipment) and isinstance(dst, Equipment):
|
|
97
|
+
graph[src.name].append(dst.name)
|
|
98
|
+
indegree[dst.name] += 1
|
|
99
|
+
|
|
100
|
+
elif isinstance(src, (MaterialStream, EnergyStream)) and isinstance(dst, Equipment):
|
|
101
|
+
# Stream → Equipment (dependency comes from its producer)
|
|
102
|
+
pass
|
|
103
|
+
|
|
104
|
+
elif isinstance(src, Equipment) and isinstance(dst, (MaterialStream, EnergyStream)):
|
|
105
|
+
# Equipment → Stream (stream is not an executable unit)
|
|
106
|
+
pass
|
|
107
|
+
|
|
108
|
+
return graph, indegree
|
|
109
|
+
|
|
110
|
+
def _topological_order(self):
|
|
111
|
+
"""Return equipment execution order"""
|
|
112
|
+
graph, indegree = self._build_dependency_graph()
|
|
113
|
+
queue = deque([u.name for u in self.equipment if indegree[u.name] == 0])
|
|
114
|
+
order = []
|
|
115
|
+
|
|
116
|
+
while queue:
|
|
117
|
+
u = queue.popleft()
|
|
118
|
+
order.append(u)
|
|
119
|
+
for v in graph[u]:
|
|
120
|
+
indegree[v] -= 1
|
|
121
|
+
if indegree[v] == 0:
|
|
122
|
+
queue.append(v)
|
|
123
|
+
|
|
124
|
+
if len(order) != len(self.equipment):
|
|
125
|
+
raise RuntimeError("Cyclic dependency detected!")
|
|
126
|
+
|
|
127
|
+
return order
|
|
128
|
+
|
|
129
|
+
# --------------------------
|
|
130
|
+
# Simulation
|
|
131
|
+
# --------------------------
|
|
132
|
+
def run(self):
|
|
133
|
+
order = self._topological_order()
|
|
134
|
+
name_to_unit = {u.name: u for u in self.equipment}
|
|
135
|
+
|
|
136
|
+
for uname in order:
|
|
137
|
+
unit = name_to_unit[uname]
|
|
138
|
+
print(f"➡️ Running {unit.name} ({unit.__class__.__name__})")
|
|
139
|
+
result = unit.simulate()
|
|
140
|
+
unit.data = result
|
|
141
|
+
|
|
142
|
+
def summary(self):
|
|
143
|
+
print(f"\nFlowsheet: {self.name}")
|
|
144
|
+
print("=" * 40)
|
|
145
|
+
for unit in self.equipment:
|
|
146
|
+
print(f"{unit.name} ({unit.__class__.__name__})")
|
|
147
|
+
if hasattr(unit, "data"):
|
|
148
|
+
for k, v in unit.data.items():
|
|
149
|
+
print(f" {k}: {v}")
|
|
150
|
+
print("-" * 30)
|
|
@@ -135,6 +135,8 @@ processpi/equipment/heatexchangers/mechanical/evaporator.py
|
|
|
135
135
|
processpi/equipment/heatexchangers/mechanical/kern_method.py
|
|
136
136
|
processpi/equipment/heatexchangers/mechanical/reboiler.py
|
|
137
137
|
processpi/equipment/heatexchangers/mechanical/shell_tube.py
|
|
138
|
+
processpi/integration/__init__.py
|
|
139
|
+
processpi/integration/flowsheet.py
|
|
138
140
|
processpi/pipelines/__init__.py
|
|
139
141
|
processpi/pipelines/base.py
|
|
140
142
|
processpi/pipelines/design_rules.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "processpi"
|
|
7
|
-
version = "0.2.0.
|
|
7
|
+
version = "0.2.0.4"
|
|
8
8
|
description = "Python toolkit for chemical engineering simulations, equipment design, and unit conversions"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -35,3 +35,4 @@ IssueTracker = "https://github.com/varma666/ProcessPi/issues"
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/pressure_drop_darcy.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/fluids/pressure_drop_fanning.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/boiling_chen.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/combined_modes.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/condensation.py
RENAMED
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/condensation_nusselt.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/conduction_heat_loss.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/convection_heat_loss.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/crossflow_tube.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/heat_exchanger_area.py
RENAMED
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/newton_cooling.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radial_cylinder.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radiation_blackbody.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radiation_exchange.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radiation_greybody.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/radiation_viewfactor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/rohsenow_boiling.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/heat_transfer/stefan_boltzmann.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/reaction_engineering/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/reaction_engineering/reaction_rate.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/thermodynamics/enthalpy_change.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/calculations/thermodynamics/entropy_change.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/bell_method.py
RENAMED
|
File without changes
|
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/condenser.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/double_pipe.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/evaporator.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/kern_method.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/reboiler.py
RENAMED
|
File without changes
|
{processpi-0.2.0.3 → processpi-0.2.0.4}/processpi/equipment/heatexchangers/mechanical/shell_tube.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|