-
Notifications
You must be signed in to change notification settings - Fork 3
Heat buffer efficiency #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1220e6f
ccf8a94
2035f7f
5f08353
6d790f4
a115894
87da386
67b4739
b2ad759
0a67d4d
5a7200a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -551,12 +551,20 @@ def convert_heat_buffer(self, asset: Asset) -> Tuple[Type[HeatBuffer], MODIFIERS | |||||
| else 10.0e6 | ||||||
| ) | ||||||
|
|
||||||
| # The asset attribute "dischargeEfficiency" represents the fraction of stored heat | ||||||
| # that is lost per day. | ||||||
| heat_loss_coefficient = ( | ||||||
| asset.attributes.get("dischargeEfficiency") / (24.0 * 3600.0) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't do this suggestion, appearantly efficiencies are now always fractions in esdl. Lets atleast in our own code be clear and name it fraction/coefficient etc.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I renamed "heat_loss_efficiency " as "heat_loss_coefficient". Hence, this aligns with the definition of efficiency attributes used in esdl |
||||||
| if asset.attributes.get("dischargeEfficiency") | ||||||
| else 0.01 / (24.0 * 3600.0) | ||||||
| ) | ||||||
|
|
||||||
| q_nominal = self._get_connected_q_nominal(asset) | ||||||
|
|
||||||
| modifiers = dict( | ||||||
| height=r, | ||||||
| radius=r, | ||||||
| heat_transfer_coeff=1.0, | ||||||
| heat_loss_coefficient=heat_loss_coefficient, | ||||||
| min_fraction_tank_volume=min_fraction_tank_volume, | ||||||
| Stored_heat=dict(min=min_heat, max=max_heat), | ||||||
| Heat_buffer=dict(min=-hfr_discharge_max, max=hfr_charge_max), | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,11 +32,15 @@ def __init__(self, name, **modifiers): | |
|
|
||
| self.component_type = "heat_buffer" | ||
|
|
||
| self.heat_transfer_coeff = 1.0 | ||
| self.height = 5.0 | ||
| self.radius = 10.0 | ||
| self.volume = math.pi * self.radius**2 * self.height | ||
| self.heat_loss_coeff = 2 * self.heat_transfer_coeff / (self.radius * self.rho * self.cp) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe keep this old line as commented code as in the future we might want to use a heat transfer coefficient together with its dimensions.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. old definition of "heat_loss_coefficient" is added back again as a comment |
||
| self.heat_loss_coefficient = nan | ||
| # self.heat_transfer_coeff = 1.0 | ||
| # self.heat_loss_coefficient = ( | ||
| # 2 * self.heat_transfer_coeff / (self.radius * self.rho * self.cp) | ||
| # ) | ||
|
|
||
| # The hot/cold tank can have a lower bound on its volume. | ||
| # Meaning that they might always be, for e.g., 5% full. | ||
| self.min_fraction_tank_volume = 0.05 | ||
|
|
@@ -78,7 +82,9 @@ def __init__(self, name, **modifiers): | |
| # 10.0, we aim for a state vector entry of ~0.1 (instead of 1.0) | ||
| self._heat_loss_error_to_state_factor = 10.0 | ||
| self._nominal_heat_loss = ( | ||
| self._nominal_stored_heat * self.heat_loss_coeff * self._heat_loss_error_to_state_factor | ||
| self._nominal_stored_heat | ||
| * self.heat_loss_coefficient | ||
| * self._heat_loss_error_to_state_factor | ||
| ) | ||
|
|
||
| self.add_variable(Variable, "Heat_loss", min=0.0, nominal=self._nominal_heat_loss) | ||
|
|
@@ -91,7 +97,8 @@ def __init__(self, name, **modifiers): | |
| / self._heat_loss_eq_nominal_buf | ||
| ) | ||
| self.add_equation( | ||
| (self.Heat_loss - self.Stored_heat * self.heat_loss_coeff) / self._nominal_heat_loss | ||
| (self.Heat_loss - self.Stored_heat * self.heat_loss_coefficient) | ||
| / self._nominal_heat_loss | ||
| ) | ||
|
|
||
| self.add_equation((self.Heat_flow - self.Heat_buffer) / self.Heat_nominal) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two name conventions conflict
I would expect that if I put in 98%, that only 2% is lost during the day.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"heat_loss_efficiency " is renamed as "heat_loss_coefficient". With this naming, we are aligned with the "efficiency attribute" definitions of esdl. Besides, using heat_loss_coefficienct looks more logical now