jfreissmann / heatpumps

Collection of TESPy heat pump models and additional Streamlit dashboard.
MIT License
19 stars 5 forks source link

Generalised offdesign parametrization #30

Closed bilwint closed 2 months ago

bilwint commented 3 months ago

11

Todo

jfreissmann commented 2 months ago

Hey @bilwint,

thank you for your work. I think, you found an elegant way to generalize the components offdesign parametrization. In my opinion, your PR looks mostly great. Some smaller remarks before we can merge:

As far as I can tell, if you could refer to the points above and clear those up, there is nothing else in the way towards merging your PR.

Best regards.

bilwint commented 2 months ago

Hey @jfreissmann

  1. offdesign_simulation for the case of HeatPumpEconIHX, is just a mistake
  2. Regarding mass flow rate, you are right. Always sets the mass flow rate of cycle A in off-design. I did it because to make the code clear when it comes to the cascade cycle.
  3. Third point also you are right.
  4. For transcritical model, the pressure in the transcritical heat exchanger will remain same but the evaporator pressure will change when there is variation in the source temperature, am I right ?.
jfreissmann commented 2 months ago

I agree with your second point. The advantage of the previous implementation was, that every heat pump class has the same attribute, that contains the design mass flow in the 'A'-cycle and only that. But this uniformity is broken with things like self.wf vs. self.wf1 + self.wf2 etc. anyway, so maybe it is non really needed.

Regarding the changes of some of the get_pressure_levels method: we use it mostly to get good starting values for the initial design simulation or for calculating the correct intermediate pressure. The former usage sould not affect the offdesign simulation, but for the latter case it makes sense, that changing the source temperature from outside the get_pressure_levels method should result in a differrent intermediate pressure. I am not 100% sure, if we correctly do that right now in all models depending on an intermediate pressure though.

bilwint commented 2 months ago

Sorry I misunderstood the fourth question regarding the get_pressure_levels for trans models.

The get_pressure_levels function had to adjust to implement generalized off-design. Because in the previous case there was no arguments in get_pressure_levels(self, wf=None). So it was not convenient to find intermediate states (p/T). That's why I implemented arguments to the get_pressure_levels(self, T_evap, wf=None) of trans models.

Is that was your question?

jfreissmann commented 2 months ago

Yes, that does answer my question. When you adjust the other open points from my initial comment, we can merge the PR.