Skip to content
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

chore: add power adjustment constant also for compressor trains with… #136

Merged

Conversation

olelod
Copy link
Contributor

@olelod olelod commented Aug 8, 2023

… interstage pressure

@olelod olelod changed the title chore: add power adjustment constasnt also for compressor trains with… chore: add power adjustment constant also for compressor trains with… Aug 8, 2023
@olelod olelod self-assigned this Aug 8, 2023
355.37085,
346.048583,
358.164004,
356.423481,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change is > 1 MW because there is a 0.05 power loss factor on top

Copy link
Contributor

Choose a reason for hiding this comment

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

Was this pull request not about power adjustment constants? Or power loss factor? In my head thats two different things.

Guess power adjustment constant would here be 1MW?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, but there is an additional power loss factor (0.05) in addition to the power adjustment constant (1 mw), which means 1 / 0.95 = 1.05... I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The power adjustment constant is applied to the compressor train result (or other energy function results). The power loss factor is applied to the compressor train result (or other energy function results) before making it a consumer function result. So if the MODEL has a POWER_ADJUSTMENT_CONSTANT and the CONSUMER have a POWERLOSSFACTOR, they will accumulate in the consumer results which is what we look at in the json file here.

@olelod olelod marked this pull request as ready for review August 9, 2023 07:03
@olelod olelod requested a review from a team as a code owner August 9, 2023 07:03
Copy link
Contributor

@jorgenengelsen jorgenengelsen left a comment

Choose a reason for hiding this comment

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

Looks ok. What about power usage adjustment factor? Is that not supported for compressors?

Would also like a test of this outside "all_energy_usage_models"

@@ -769,15 +769,18 @@ def evaluate_rate_ps_pint_pd(
train_results.append(compressor_train_result)

power_mw = np.array([time_step.power_megawatt for time_step in train_results])
power_mw_adjusted = np.where(
power_mw > 0, power_mw + self.data_transfer_object.energy_usage_adjustment_constant, power_mw
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
power_mw > 0, power_mw + self.data_transfer_object.energy_usage_adjustment_constant, power_mw
power_mw > 0, power_mw + self.energy_usage_adjustment_constant, power_mw

In my opinion I am not fan of the DTO layer not being contained in the initialisation of objects.

Suggest creating 'self.data_transfer_object.energy_usage_adjustment_constant' in the init method?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree, but this has been violated all over the place already ..

355.37085,
346.048583,
358.164004,
356.423481,
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this pull request not about power adjustment constants? Or power loss factor? In my head thats two different things.

Guess power adjustment constant would here be 1MW?

@@ -1044,9 +1044,9 @@
"typ": "STREAM_DAY",
"unit": "MW",
"values": [
644.62915,
Copy link
Collaborator

Choose a reason for hiding this comment

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

here the values decrease...do you know why? was that expected?

Copy link
Collaborator

Choose a reason for hiding this comment

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

as far as I can see they have all 1 MW in PAC

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the power capacity margin, which should decrease when the power increase.

@TeeeJay
Copy link
Collaborator

TeeeJay commented Aug 9, 2023

Looks good. I also guess that it does make sense to add the power loss factor AFTER the power adjustment constant (PAC), and not before... Should that be documented?

…interstage pressure

chore: update snapshots after power adjustment constant fix for compressor trains with interstage pressure

chore: add test for adjust energy usage on multiple streams and pressures compressor trains
@olelod olelod force-pushed the power-adjustment-constant-for-multiple-streams-and-pressures branch from e21a039 to 737f94b Compare August 11, 2023 10:16
@olelod olelod merged commit c8a4861 into main Aug 11, 2023
4 checks passed
@olelod olelod deleted the power-adjustment-constant-for-multiple-streams-and-pressures branch August 11, 2023 10:21
patnr added a commit to patnr/ecalc that referenced this pull request Aug 21, 2023
* up-main: (65 commits)
  chore(docs): fix equations showing twice (equinor#141)
  chore: fix spelling errors in changelog
  chore(main): release 8.3.0
  chore: add power adjustment constant also for compressor trains with interstage pressure (equinor#136)
  chore: fix typing of fluid composition
  docs: update docs and changelog for energy models (equinor#133)
  chore!: energy model type not allowed to change over time (equinor#131)
  docs: fix generic compressor example
  refactor: move NeqSimfluid creation into NeqSim wrapper
  chore: add 8.3 changelog
  chore: add fluid mixing checks
  ci: update pre-commit settings
  refactor: imrpove naming and documentation
  chore: add fluid mixing checks
  refactor: molar_mass_kg_per_mol is not used in the code
  fix: wrong standard_conditions_density when mixing two fluids
  test: add test for fluid stream mixing
  chore: merge queque
  fix: parse spaces as thousand separators from excel (equinor#107)
  refactor: NeqSim mapping (equinor#120)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants