Skip to content

PLUME-66: Export CSV file with power output per wind turbine#5

Merged
antons-it merged 12 commits into
developfrom
feature/wind_turbine_output
May 15, 2026
Merged

PLUME-66: Export CSV file with power output per wind turbine#5
antons-it merged 12 commits into
developfrom
feature/wind_turbine_output

Conversation

@antons-it
Copy link
Copy Markdown
Collaborator

Description

This pull request introduces a new feature to export per-turbine wind power output to CSV files, alongside several related refactorings.

Export of per-turbine power output:

  • Added a new configuration option export_wind_turbine_power (default false) in both the documentation (config/README.md) and the example config (config/plume-config.yml.in) to control exporting per-turbine power output. [1] [2]
  • Implemented logic in WindFarmPluginCore to compute, aggregate, and export per-turbine power values to CSV files when the option is enabled, including filename handling and output format. [1] [2] [3] [4] [5] [6]

Data structure and API extensions:

  • Introduced the LatLonValue class (in src/point.h) to represent a lat/lon point with an associated value, used for per-turbine power output.
  • Extended the wind farm model interface (WFPModel and its implementations JensenModel and NoWake) to provide a computePowerByTurbine method returning per-turbine power values. [1] [2] [3] [4] [5] [6] [7]
  • Added a corresponding method computePowerPerTurbine to the WindFarm class to expose the new API. [1] [2]

Refactoring and cleanup:

  • Refactored power computation in wind farm models to use the new per-turbine API, removing now-unnecessary local computation methods. [1] [2] [3]
  • Updated file includes and minor code organization for clarity and consistency. [1] [2] [3] [4]

Testing:

  • Added a new test to run the wind farm plugin with the emulator using the updated configuration.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

@antons-it antons-it requested review from cducher and dsarmany April 28, 2026 16:23
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 28, 2026

Codecov Report

❌ Patch coverage is 87.76978% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.98%. Comparing base (7111b9b) to head (b1c0bbd).

Files with missing lines Patch % Lines
src/plugin.cc 80.43% 9 Missing ⚠️
src/utils.cc 81.48% 5 Missing ⚠️
src/wind_farm.cc 77.77% 2 Missing ⚠️
src/wfp_models/no_wake.cc 96.29% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop       #5      +/-   ##
===========================================
+ Coverage    85.53%   90.98%   +5.44%     
===========================================
  Files           28       28              
  Lines          726      832     +106     
  Branches        60       75      +15     
===========================================
+ Hits           621      757     +136     
+ Misses         105       75      -30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an optional CSV export of per-wind-turbine power output and extends the wind farm model API to provide per-turbine power values, updating the plugin, utilities, and tests accordingly.

Changes:

  • Add export_wind_turbine_power configuration option and document it.
  • Extend wind-farm model interface with per-turbine power computation and implement it in Jensen/NoWake models.
  • Add CSV export utility + update plugin runtime logic and tests (including an emulator-driven test).

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_wind_farm.cc Adds assertions for per-turbine power output consistency with total power.
tests/data/test-plume-config.yml.in Enables per-turbine export in test config and sets wind_field_height.
tests/data/emulator-config.yml Adds new emulator config used by the new integration-style test.
tests/data/CMakeLists.txt Adjusts test config generation (minor formatting).
tests/CMakeLists.txt Adds a new test invoking the emulator runner.
src/wind_farm.h Adds computePowerPerTurbine() API declaration and docs.
src/wind_farm.cc Implements computePowerPerTurbine() delegating to the model.
src/wfp_models/wfp_model.h Extends model interface with computePowerByTurbine().
src/wfp_models/no_wake.h Declares computePowerByTurbine() override.
src/wfp_models/no_wake.cc Implements per-turbine power computation + refactors total power to sum per-turbine results.
src/wfp_models/jensen.h Declares computePowerByTurbine() override.
src/wfp_models/jensen.cc Implements per-turbine power computation + refactors total power to sum per-turbine results.
src/utils.h Declares exportWindTurbinePowers() utility.
src/utils.cc Implements per-turbine power CSV export helper.
src/point.h Introduces LatLonValue (lat/lon point with an associated scalar value).
src/plugin.h Adds filename helper + flags and prefix for per-turbine export.
src/plugin.cc Adds config flags, computes per-turbine powers, exports CSV, refactors filename building.
config/plume-config.yml.in Adds export_wind_turbine_power example option.
config/README.md Documents export_wind_turbine_power in the configuration table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/plugin.cc
Comment thread tests/CMakeLists.txt Outdated
Comment thread src/plugin.h Outdated
Comment thread src/wind_farm.h Outdated
Comment thread src/wfp_models/wfp_model.h
Comment thread src/plugin.cc Outdated
Comment thread src/wfp_models/no_wake.cc
Comment thread src/wfp_models/jensen.cc
Comment thread src/plugin.cc
Comment thread src/plugin.cc Outdated
Comment thread src/wind_farm.cc
Comment thread src/utils.cc Outdated
Comment thread src/wind_farm.cc
Comment thread src/wind_farm.cc Outdated
Comment thread src/wind_farm.h Outdated
Comment thread tests/data/emulator-config.yml
@antons-it antons-it marked this pull request as ready for review May 12, 2026 17:45
@cducher cducher self-requested a review May 15, 2026 14:46
@antons-it antons-it merged commit 11a10db into develop May 15, 2026
126 checks passed
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.

4 participants