Closed hangtianzhang closed 4 years ago
Thank you for your question. Right now, a Bus component can only work with one commodity. So it is the same commodity at the inlet and the outlet. We can think of it as a natural gas pipeline or an electrical transmission line. However, the variable names at the inlet and the outlet must be different. E.g., see the second example in the documentation:
heat_bus = ar.Bus(
ensys=es, name='heat_bus',
inlet=ar.Flow('Heat', var_name='Heat_inlet'),
outlet=ar.Flow('Heat', var_name='Heat_outlet'))
You can easily connect multiple components to the same inlet and outlet of a Bus. E.g.,:
ar.Source(ensys=es, name='source_1', outlet=ar.Flow('Heat', link='heat_bus'), [...])
ar.Conversion(ensys=es, name='conversion_1', outlet=ar.Flow('Heat', link='heat_bus'), [...])
If more than one commodity should be transferred from one site to another, you would probably want to add multiple Bus components. I hope this answers your questions.
Thank you very much for your answers, but I still have a few small questions,
power_bus = ar.Bus( ensys=es, name='power_bus', inlet=[ar.Flow('P_mt', var_name='P_mt',link='power_source'), ar.Flow('Power',var_name='Power',link='power_source')], outlet=[ar.Flow('P_ec', var_name='P_ec',link='EC'), ar.Flow('P_eb',var_name='P_eb',link='EB'), ar.Flow('demand_power',var_name='demand_power',link='power_sink')])
,Among them, ‘mt’ stands for gas turbine; ‘ec’ stands for electric refrigerator; ‘eb’ stands for electric boilerI don't know if I fully understand the question. Yes, you can have multiple inlet and outlet connections. The "link" argument of the Flow instances is used on the source, destination, or both sides to tell aristopy about the component connection.
bus = ar.Bus(es, 'bus',
inlet=[
ar.Flow(commodity='P', link='elec_source', var_name='P_in'),
ar.Flow(commodity='P', link='gas_turbine', var_name='P_in')],
outlet=[
ar.Flow(commodity='P', link='elec_demand', var_name='P_out'),
ar.Flow(commodity='P', link='elec_heater', var_name='P_out')])
However, a Bus can only transport one commodity (e.g., electricity). If you have multiple commodities, you will need multiple Bus instances.
In the example of creating an energy system, the bus outlet and entrance can only be one commodity, and the same commodity can only use the same commodity name. If you are using a more complex bus (multiple input and multiple output):