Skip to content

Implement complex CHP template#3

Draft
sstroemer wants to merge 7 commits intomainfrom
create-chp-template
Draft

Implement complex CHP template#3
sstroemer wants to merge 7 commits intomainfrom
create-chp-template

Conversation

@sstroemer
Copy link
Member

This is motivated by / linked to ait-energy/IESopt.jl#101 (which it will fix after being completed).

@sstroemer sstroemer self-assigned this Jun 27, 2025
@sstroemer sstroemer added the enhancement New feature or request label Jun 27, 2025
@sstroemer sstroemer requested a review from Villyes June 30, 2025 06:39
@sstroemer
Copy link
Member Author

Some notes on the first draft:

  • It's missing a lot of validation checks, I've focused on the core functionality first.
  • We need to discuss whether this makes sense at all since I got the feeling that this is getting too "large" for being in the YAML itself (compared to an actual Julia file with syntax highlighting, etc.).
  • I've added a few future parameters as comments, currently only the mandatory base set of parameters is implemented.

@@ -0,0 +1,221 @@
parameters:
mode: ~ # operation mode: extraction, condensing, backpressure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mode: ~ # operation mode: extraction, condensing, backpressure
mode: ~ # operation mode: extraction (full characteristic field), condensing (power only), backpressure (acc. to power ratio line)

I would like that but maybe too crowded then.

power_at_heat_max: ~ # electricity output at maximum heat output
power_ratio: 0.55 # electricity per heat in backpressure operation
power_loss_ratio: 0.20 # electricity lost per heat extracted along an isofuel line
efficiency_condensing: ~ # electricity per fuel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
efficiency_condensing: ~ # electricity per fuel
efficiency_condensing: ~ # electricity per fuel (in condensing mode)

power_ratio: 0.55 # electricity per heat in backpressure operation
power_loss_ratio: 0.20 # electricity lost per heat extracted along an isofuel line
efficiency_condensing: ~ # electricity per fuel
efficiency_backpressure: ~ # electricity+heat per fuel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this now the combined efficiency? maybe use that term?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
efficiency_backpressure: ~ # electricity+heat per fuel
efficiency_backpressure: ~ # electricity+heat per fuel (combined efficiency)

Comment on lines +119 to +122
if isnothing(cm)
cm = p_max / h_max
this.set("power_ratio", cm)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being super picky (or will you prevent the input-combination 'cm+h_max+p_at_h_max' in the validate section):

Suggested change
if isnothing(cm)
cm = p_max / h_max
this.set("power_ratio", cm)
end
p_at_h_max= this.get("power_at_heat_max")
if isnothing(p_at_h_max)
p_at_h_max=p_max
end
if isnothing(cm)
cm = p_at_h_max / h_max
this.set("power_ratio", cm)
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion => we do not want want to allow over-specification, therefore we check for that in the validate, and then do not need to care about any over-specified combinations.

node_to: <power_to>
lb: 0

# TODO: discuss that these functions get really hard to read/maintain when they grow larger (since in a YAML)
Copy link
Contributor

@Villyes Villyes Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, the confusing part is the lack of conversions at the units. Could we reference the lines as a comment or is this stupid?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much overhead is it to include individual units (e.g., one additional one for backpressure because the modeling via combined efficiency is different anyhow?) Then we could also have the backpressure calculation with the extraction-calculation-method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much overhead is it to include individual units (e.g., one additional one for backpressure because the modeling via combined efficiency is different anyhow?) Then we could also have the backpressure calculation with the extraction-calculation-method.

We'll do that sounds helpful!

cm = this.get("power_ratio")
cv = this.get("power_loss_ratio")

if isnothing(p_max)
Copy link
Contributor

@Villyes Villyes Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusing to me. Isn´t p_max one of the required inputs. Why wouldn´t you have this one.

h_max = isnothing(p_at_h_max) ? (p_max / (cm + cv)) : (p_at_h_max / cm)
this.set("heat_max", h_max)
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if isnothing(p_at_h_max)
p_at_h_max=p_max
end

if !isnothing(eta_cd) && isnothing(eta_bp)
eta_p = eta_cd
elseif isnothing(eta_cd) && !isnothing(eta_bp)
eta_p = eta_bp / (1.0 + cm)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check. I arrive at:

Suggested change
eta_p = eta_bp / (1.0 + cm)
eta_p = eta_bp * cm / (1.0 + cm)

Copy link
Contributor

@Villyes Villyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one major comment in line 180.

Did not review validate-section. Maybe we need to talk about what combination of inputs are ok.

Otherwise: I like it. Took me however a significant amount of time to understand and that although I already know the topic. Still think it´s worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants