### TESPy Connection Setup and Assignment (Python) Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/sankey.ipynb Defines the connections between the previously defined components, establishing the flow paths within the network. It also assigns initial parameters and fluid properties to these connections, crucial for the simulation's starting point. ```python c11 = Connection(air_in, "out1", air_hx, "in1", label="11") c12 = Connection(air_hx, "out1", air_out, "in1", label="12") c21 = Connection(air_hx, "out2", comp1, "in1", label="21") c22 = Connection(comp1, "out1", ihx, "in1", label="22") c22c = Connection(ihx, "out1", cc1, "in1", label="22c") c23 = Connection(cc1, "out1", valve1, "in1", label="23") c24 = Connection(valve1, "out1", air_hx, "in2", label="24") c31 = Connection(ihx, "out2", comp2, "in1", label="31") c32 = Connection(comp2, "out1", steam_gen, "in1", label="32") c32c = Connection(steam_gen, "out1", cc2, "in1", label="32c") c33 = Connection(cc2, "out1", valve2, "in1", label="33") c34 = Connection(valve2, "out1", ihx, "in2", label="34") c41 = Connection(water_in, "out1", steam_gen, "in2", label="41") c42 = Connection(steam_gen, "out2", water_out, "in1", label="42") nw.add_conns(c21, c22, c22c, c23, c24) nw.add_conns(c11, c12) nw.add_conns(c31, c32, c32c, c33, c34) nw.add_conns(c41, c42) ``` -------------------------------- ### TESPy Convergence Assertion and Parameter Setup (Python) Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/sankey.ipynb Asserts the convergence of the TESPy simulation to ensure the results are reliable. It also sets up ambient conditions (pressure and temperature) and defines economic parameters like electricity price and full load hours for potential cost analysis. ```python # assert convergence of calculation nw.assert_convergence() # ambient conditions p0 = c11.p.val * 1e5 T0 = c11.T.val + 273.15 # economic parameters # Define the CEPCI values for cost correction. CEPCI_2013 = 567.3 CEPCI_2023 = 797.9 CEPCI_factor = CEPCI_2023 / CEPCI_2013 # Define default values for electricity price and full load hours. default_elec_price = 40.0 # cent/kWh default_tau = 5500 # hours/year ``` -------------------------------- ### Install Exerpy Developer Version and Sync with Upstream Source: https://github.com/oemof/exerpy/blob/main/docs/contribute.rst Instructions for cloning the Exerpy repository, installing development dependencies, and synchronizing your local repository with the upstream 'oemof/exerpy' repository. This setup is crucial for development and staying updated with the main project. ```bash git clone https://github.com/YOUR_GITHUB_USERNAME/exerpy.git cd exerpy pip install -e .[dev] git remote add upstream https://github.com/oemof/exerpy.git git fetch upstream git pull upstream dev --rebase ``` -------------------------------- ### Install ExerPy using pip Source: https://github.com/oemof/exerpy/blob/main/docs/introduction.rst This command installs the latest version of the ExerPy library using the pip package installer. Ensure you have Python and pip set up in your environment. ```bash pip install exerpy ``` -------------------------------- ### TESPy Simulation: Initial Values and Design Solve (Python) Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/sankey.ipynb Sets initial or starting values for connections and component attributes, including fluid properties, temperature, pressure, and enthalpy. Subsequently, it performs an initial simulation run using the 'design' method to obtain preliminary results. ```python # Simulation with starting values c11.set_attr(fluid={"Ar": 0.0129, "CO2": 0.0005, "N2": 0.7552, "O2": 0.2314}, T=20, p=1.013) c12.set_attr(T=Ref(c11, 1, -5)) c21.set_attr(fluid={"R245FA": 1}, h=417) c22.set_attr(p=6.4) c23.set_attr(h=290) c24.set_attr(p=0.823) c31.set_attr(fluid={"R1233zdE": 1}, h=451) c32.set_attr(p=17.5) c33.set_attr(h=364) c34.set_attr(p=4.1) c41.set_attr(fluid={"water": 1}, p=2, x=0, m=1) c42.set_attr(h=2706) comp1.set_attr(eta_s=0.8) comp2.set_attr(eta_s=0.8) steam_gen.set_attr(pr1=0.95, pr2=1) air_hx.set_attr(pr1=1, pr2=0.95) ihx.set_attr(pr1=0.95, pr2=0.95) # nw.solve("design") ``` -------------------------------- ### Initialize TESPy Network and Components Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/plots/cylce-diagrams.ipynb Sets up the TESPy network with specified units and instantiates various thermodynamic components like sources, sinks, heat exchangers, compressors, and valves. Connections are then defined between these components. ```python nw = Network(T_unit="C", p_unit="bar", h_unit="kJ / kg", m_unit="kg / s", s_unit="kJ / kgK", iterinfo=False) air_in = Source("air inlet") air_out = Sink("air outlet") water_in = Source("water inlet") water_out = Sink("water outlet") air_hx = HeatExchanger("AIR_HX") comp1 = Compressor("COMP1") valve1 = Valve("VAL1") cc1 = CycleCloser("cc") ihx = HeatExchanger("IHX") steam_gen = HeatExchanger("STEAM_GEN") comp2 = Compressor("COMP2") valve2 = Valve("VAL2") cc2 = CycleCloser("cc2") c11 = Connection(air_in, "out1", air_hx, "in1", label="11") c12 = Connection(air_hx, "out1", air_out, "in1", label="12") c21 = Connection(air_hx, "out2", comp1, "in1", label="21") c22 = Connection(comp1, "out1", ihx, "in1", label="22") c22c = Connection(ihx, "out1", cc1, "in1", label="23") c23 = Connection(cc1, "out1", valve1, "in1", label="23c") c24 = Connection(valve1, "out1", air_hx, "in2", label="24") c31 = Connection(ihx, "out2", comp2, "in1", label="31") c32 = Connection(comp2, "out1", steam_gen, "in1", label="32") c32c = Connection(steam_gen, "out1", cc2, "in1", label="33") c33 = Connection(cc2, "out1", valve2, "in1", label="33c") c34 = Connection(valve2, "out1", ihx, "in2", label="34") c41 = Connection(water_in, "out1", steam_gen, "in2", label="41") c42 = Connection(steam_gen, "out2", water_out, "in1", label="42") nw.add_conns(c21, c22, c22c, c23, c24) nw.add_conns(c11, c12) nw.add_conns(c31, c32, c32c, c33, c34) nw.add_conns(c41, c42) ``` -------------------------------- ### Tespy CGAM Model Setup Source: https://github.com/oemof/exerpy/blob/main/docs/examples/cgam.rst This code block contains the setup for the CGAM process model using the tespy library. It is intended to be run within the tespy environment for simulation and analysis. ```python import numpy as np from tespy.tools.characteristics import load_csv from tespy.helpers import mpl్రహ్ from tespy.networks import Network from tespy.tools.logger import log # init log log.basic_filter(level='INFO') # ----- model parameters ----- # system parameters # fluid properties fluid_list = ['water', 'steam', 'air'] # network n = Network(p='bar') # ----- component parameters ----- # components # Parameters for the burner # Parameters for the heat exchanger # Parameters for the gas turbine # Parameters for the steam turbine # Parameters for the condenser # Parameters for the pump # Parameters for the reformer # Parameters for the gasifier # Parameters for the cooler # Parameters for the electric generator # Parameters for the electric heater # Parameters for the CO2 compressor # Parameters for the CO2 cooler # Parameters for the CO2 expander # Parameters for the CO2 heat exchanger # Parameters for the CO2 pump # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler # Parameters for the CO2 pump # Parameters for the CO2 heat exchanger # Parameters for the CO2 expander # Parameters for the CO2 separator # Parameters for the CO2 evaporator # Parameters for the CO2 condenser # Parameters for the CO2 cooler ``` -------------------------------- ### Full Example: Ebsilon Exergy Analysis with ExerPy Source: https://github.com/oemof/exerpy/blob/main/docs/examples/ccpp.rst Combines all steps for performing an exergy analysis on an Ebsilon model using ExerPy. This includes importing the library, initializing the analysis object, defining exergy streams, running the analysis, and displaying the results. ```python from exerpy import ExergyAnalysis model_path = 'ccpp.ebs' ean = ExergyAnalysis.from_ebsilon(model_path, chemExLib='Ahrendts', split_physical_exergy=False) fuel = { "inputs": ['1', '3'], "outputs": [] } product = { "inputs": ['ETOT', 'H1'], "outputs": [] } loss = { "inputs": ['8', '15'], "outputs": ['14'] } ean.analyse(E_F=fuel, E_P=product, E_L=loss) ean.exergy_results() ``` -------------------------------- ### Set Initial Simulation Parameters and Run Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/plots/cylce-diagrams.ipynb Defines initial fluid properties, temperatures, pressures, and component efficiencies for the simulation. It then runs the initial 'design' simulation and proceeds to set fixed values for a second 'design' simulation. ```python # Simulation with starting values c11.set_attr(fluid={"Ar": 0.0129, "CO2": 0.0005, "N2": 0.7552, "O2": 0.2314}, T=20, p=1.013) c12.set_attr(T=15) c21.set_attr(fluid={"R245FA": 1}, h=417) c22.set_attr(p=6.4) c23.set_attr(h=290) c24.set_attr(p=0.823) c31.set_attr(fluid={"R1233zdE": 1}, h=451) c32.set_attr(p=17.5) c33.set_attr(h=364) c34.set_attr(p=4.1) c41.set_attr(fluid={"water": 1}, T=120, x=0, m=1) c42.set_attr(h=2706) comp1.set_attr(eta_s=0.8) comp2.set_attr(eta_s=0.8) steam_gen.set_attr(pr1=1, pr2=1) air_hx.set_attr(pr1=1, pr2=1) ihx.set_attr(pr1=1, pr2=1) nw.solve("design") # Simulation with fixed values c21.set_attr(h=None, Td_bp=5) c22.set_attr(p=None) c23.set_attr(h=None, Td_bp=-5) c24.set_attr(p=None) c31.set_attr(h=None, Td_bp=5) c32.set_attr(p=None) c33.set_attr(h=None, x=0) c34.set_attr(p=None, T=60) c42.set_attr(h=None, x=1) air_hx.set_attr(ttd_l=5) ihx.set_attr(ttd_l=5) steam_gen.set_attr(ttd_l=5) power_input = Bus("power input") power_input.add_comps( {"comp": comp1, "base": "bus", "char": 0.985}, {"comp": comp2, "base": "bus", "char": 0.985} ) nw.add_busses(power_input) nw.solve("design") nw.print_results() ``` -------------------------------- ### Import TESPy Components and Network Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/plots/cylce-diagrams.ipynb Imports necessary classes from the TESPy library for building thermodynamic networks. This includes components like Compressors, HeatExchangers, and utilities like Bus and Network. ```python from tespy.components import Compressor, CycleCloser, Sink, Source, Valve from tespy.components import MovingBoundaryHeatExchanger as HeatExchanger from tespy.connections import Bus, Connection from tespy.networks import Network ``` -------------------------------- ### TESPy Network Initialization and Component Definition (Python) Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/sankey.ipynb Initializes a TESPy network with specified units and defines various components, including sources, sinks, compressors, valves, and heat exchangers. These components form the building blocks of the thermodynamic system. ```python from tespy.components import Compressor, CycleCloser, Sink, Source, Valve from tespy.components import MovingBoundaryHeatExchanger as HeatExchanger from tespy.connections import Bus, Connection, Ref from tespy.networks import Network nw = Network(T_unit="C", p_unit="bar", h_unit="kJ / kg", m_unit="kg / s") air_in = Source("air inlet") air_out = Sink("air outlet") water_in = Source("water inlet") water_out = Sink("water outlet") air_hx = HeatExchanger("AIR_HX") comp1 = Compressor("COMP1") valve1 = Valve("VAL1") cc1 = CycleCloser("cc") ihx = HeatExchanger("IHX") steam_gen = HeatExchanger("STEAM_GEN") comp2 = Compressor("COMP2") valve2 = Valve("VAL2") cc2 = CycleCloser("cc2") ``` -------------------------------- ### ExerPy JSON Configuration Options Source: https://github.com/oemof/exerpy/blob/main/docs/examples/json.rst Illustrates specific JSON parameters to control exergy analysis features like splitting physical exergy or using chemical exergy libraries. ```json { "components": { ... }, "connections": { ... }, "ambient_conditions": { ... }, "split_physical_exergy": true, "chemExLib": "Ahrendts" } ``` -------------------------------- ### Example: Ebsilon vs Aspen Comparison Source: https://github.com/oemof/exerpy/blob/main/examples/ccpp/validation.ipynb This code snippet demonstrates how to use the `diff_between_simulators` function to compare exergy analysis results between Ebsilon and Aspen. It defines a test case dictionary mapping simulator names to their respective JSON output files and then calls the comparison function. ```python testcase = { "ebsilon": "ccpp_ebs.json", "aspen": "ccpp_aspen.json" } diff_between_simulators(testcase) ``` -------------------------------- ### Analyze Custom JSON Input with ExerPy Source: https://github.com/oemof/exerpy/blob/main/docs/examples.rst Demonstrates how to perform exergy analysis using ExerPy with system data provided in a custom JSON format. This is useful for integrating results from other modeling software. The input JSON should contain 'components', 'connections', 'ambient_conditions', and 'settings'. ```json { "components": { ... }, "connections": { ... }, "ambient_conditions": { ... }, "settings": { ... } } ``` -------------------------------- ### Example: Ebsilon vs TESPy Comparison Source: https://github.com/oemof/exerpy/blob/main/examples/ccpp/validation.ipynb This code snippet demonstrates how to use the `diff_between_simulators` function to compare exergy analysis results between Ebsilon and TESPy. It defines a test case dictionary mapping simulator names to their respective JSON output files and then calls the comparison function. ```python testcase = { "ebsilon": "ccpp_ebs.json", "tespy": "ccpp_tespy.json" } diff_between_simulators(testcase) ``` -------------------------------- ### Example: TESPy vs Aspen Comparison Source: https://github.com/oemof/exerpy/blob/main/examples/ccpp/validation.ipynb This code snippet demonstrates how to use the `diff_between_simulators` function to compare exergy analysis results between TESPy and Aspen. It defines a test case dictionary mapping simulator names to their respective JSON output files and then calls the comparison function. ```python testcase = { "tespy": "ccpp_tespy.json", "aspen": "ccpp_aspen.json" } diff_between_simulators(testcase) ``` -------------------------------- ### TESPy Bus Definition and Final Solve (Python) Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/sankey.ipynb Defines a 'power input' bus to aggregate the power consumption of compressors. This bus is then added to the network, and the simulation is solved again to incorporate the power bus into the overall system performance calculations. ```python power_input = Bus("power input") power_input.add_comps( {"comp": comp1, "base": "bus", "char": 0.985}, {"comp": comp2, "base": "bus", "char": 0.985} ) nw.add_busses(power_input) nw.solve("design") ``` -------------------------------- ### Import Libraries for Data Handling Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/sankey.ipynb Imports the numpy and pandas libraries, which are essential for numerical operations and data manipulation in Python. These are common first steps in many data analysis and scientific computing tasks. ```python import numpy as np import pandas as pd ``` -------------------------------- ### Define Economic Parameters and Component Structures (Python) Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/sankey.ipynb This snippet defines key economic parameters such as cost elevation rate, interest rate, and number of years. It also defines dictionary structures for 'fuel', 'product', and 'loss' components, specifying their inputs and outputs. ```python # Define economic parameters. r_n = 0.02 # Cost elevation rate i_eff = 0.08 # Interest rate n = 20 # Number of years omc_relative = 0.03 # Relative operation and maintenance costs (compared to PEC) fuel = { "inputs": [ 'power input__motor_of_COMP1', 'power input__motor_of_COMP2' ], "outputs": [] } product = { "inputs": ['42'], "outputs": ['41'] } loss = { "inputs": ['12'], "outputs": ['11'] } ``` -------------------------------- ### Initialize and Configure FluidPropertyDiagram (Python) Source: https://github.com/oemof/exerpy/blob/main/examples/hp_cascade/plots/cylce-diagrams.ipynb Initializes a FluidPropertyDiagram object for a specified fluid (e.g., R245FA, R1233zdE), sets the unit system for thermodynamic properties, and defines subcritical isolines. This prepares the diagram for subsequent calculations and plotting. ```python import numpy as np from fluprodia import FluidPropertyDiagram R245fa = FluidPropertyDiagram("R245FA") R245fa.set_unit_system(T="°C", p="bar", h="kJ/kg", s="kJ/kgK") R245fa.set_isolines_subcritical(0, 180) R245fa.set_isolines(s=np.array([1.25, 1.5, 1.75, 2.0])) R245fa.calc_isolines() R1233zdE = FluidPropertyDiagram("R1233zdE") R1233zdE.set_unit_system(T="°C", p="bar", h="kJ/kg", s="kJ/kgK") R1233zdE.set_isolines_subcritical(0, 180) R1233zdE.set_isolines(s=np.array([1.25, 1.5, 1.75, 2.0])) R1233zdE.calc_isolines() ```