Integrated heat storage and e-conversion asset#396
Integrated heat storage and e-conversion asset#396FJanssen-TNO wants to merge 17 commits intomainfrom
Conversation
…d using electricity
# Conflicts: # src/mesido/pycml/component_library/milp/__init__.py # src/mesido/pycml/component_library/milp/multicommodity/__init__.py
|
|
||
| # ToDo: Check if max_supply (and also elec_power_nominal) | ||
| # can be defined via hfr_charge_max. | ||
| max_supply = hfr_charge_max |
There was a problem hiding this comment.
this max_supply is the maximum heatflow
src/mesido/esdl/esdl_heat_model.py
Outdated
| for port in asset.in_ports: | ||
| if isinstance(port.carrier, esdl.ElectricityCommodity): | ||
| min_voltage = port.carrier.voltage | ||
| i_max, i_nom = self._get_connected_i_nominal_and_max(asset) |
There was a problem hiding this comment.
This part can be generalized in a function. It is used at least at two other locations.
There was a problem hiding this comment.
self._get_min_voltage(asset) function is created
src/mesido/esdl/esdl_heat_model.py
Outdated
| return HeatBuffer, modifiers | ||
| modifiers.update( | ||
| dict( | ||
| id_mapping_carrier=id_mapping, |
There was a problem hiding this comment.
Why do we need an id_mapping_carrier? I don't see a use for it.
There was a problem hiding this comment.
that is true actually. There is no need for this
src/mesido/esdl/esdl_heat_model.py
Outdated
| dict( | ||
| **self._generic_heat_modifiers(-hfr_discharge_max, hfr_charge_max, q_nominal), | ||
| ) | ||
| ) |
There was a problem hiding this comment.
try to generalize this and the above __generic_heat_modifiers. The original implementation is okay.
In case "q_nominal" is a dict instead of a float due to the asset having more ports, you could also set q_nominal to q_nominal["Q_nominal"]
There was a problem hiding this comment.
good idea. suggestion is implemented
|
|
||
| @add_variables_documentation_automatically | ||
| class HeatBuffer(_StorageComponent): | ||
| class HeatBufferModel(_StorageComponent): |
There was a problem hiding this comment.
If this class is not supposed to be used directly, rather name it something like "_HeatBufferComponent" --> the underscore informs us that this model should not be used directly in MESIDO but only as an inherited model. Rather use "Component" instead of "Model" everything is a model...
tests/test_heat.py
Outdated
| # Check heat flows into buffer coems from heat network and | ||
| # the electricity component of the buffer |
There was a problem hiding this comment.
Don't need long explanations for every check, only if it is not self explanatory, then ensure that is concise but clear, like "checking energy flows in and out of buffer".
tests/test_heat.py
Outdated
| np.testing.assert_allclose( | ||
| results["HeatStorage.Heat_buffer"], | ||
| results["HeatStorage.Heat_flow"] + results["HeatStorage.Heat_elec_charging"], | ||
| ) |
There was a problem hiding this comment.
might be good to add additional check that actually derivative of stored heat is coming from heat loss and heat_buffer. This to ensure that really heat_buffer is used to calculate stored heat and not by accident heat_flow.
There was a problem hiding this comment.
Check that derivative of stored heat is coming from heat loss and heat_buffer is added now
| The heat buffer component models heat storage in a tank. This component also incorporates the | ||
| ability to use electricity for charging this component. Like all heat storage components, | ||
| it loses heat to the surroundings, however here also an efficiency for the conversion of | ||
| electricity to heat is incorporated. Since this way of charging heat does not require water | ||
| flow through the inlet/outlet pipes, a separate variable is created to define the additional | ||
| heat charged. |
There was a problem hiding this comment.
In the description only explain what has been added in this asset.
So the ability to charge heat using electricity.
There was a problem hiding this comment.
This ESDL is more complicated than needed. Instead of a e-boiler, just the use of a generic heat producer should be okay.
Furthermore, the location of this esdl file is confusing, since in this folder I would only expect esdls with sources and sinks but no storage assets.
There was a problem hiding this comment.
e-boiler is replaced by generic heater.
esdl and csv files are moved into "tests/models/simple_buffer"
tests/test_heat.py
Outdated
|
|
||
| class TestHeat(TestCase): | ||
|
|
||
| def test_elec_heat_buffer_elec(self): |
There was a problem hiding this comment.
Seems unlogical to place this test overhere.
There was a problem hiding this comment.
test is moved into "test_multiple_in_and_out_port_components"
Start on creating an integrated heat storage asset that can be charged using electricity.
Using a heatbuffer with an additional electricity port.