Skip to content

Outdoor air concentration improvements - #1504

Open
kldjonge wants to merge 6 commits into
open-ideas:masterfrom
kldjonge:OutdoorAirImprovements
Open

kldjonge wants to merge 6 commits into
open-ideas:masterfrom
kldjonge:OutdoorAirImprovements

Conversation

@kldjonge

Copy link
Copy Markdown
Contributor

This pull request introduces support for reading outdoor air pollutant concentrations from a file and propagating these concentrations to the outsideair model used within the buildings components. It also improves angle wrapping logic for wind pressure calculations, resulting in more robust and efficient code. The most important changes are grouped below by theme.

Outdoor Air Pollution File Support:

  • Added new package OutdoorAirPollution and model ReaderOutdoorAirPollution to read pollutant concentrations from a user-specified file (e.g. outsideAir_simple.csv), with parameters for the number of tracers and file selection. [1] [2] [3] [4]
  • Updated PartialSimInfoManager to support optional pollutant schedule reading: added parameters (usePollutantSchedule, outdoorFileName, nC), conditional instantiation of the reader, and a new output C_outdoor for pollutant concentrations. [1] [2] [3]
  • Modified OutsideAir source model to use C_outdoor from the simulation manager when pollutant scheduling is enabled, ensuring pollutant concentrations are correctly used in simulations.
  • Added a new example model OutsideAirFile [1] [2]

Wind Pressure Angle Wrapping Improvements:

  • Refactored angle wrapping logic in both windPressureLowRise and OutsideAir models to use a more robust, branchless formula, improving numerical performance and reliability when the provided profile is not symmetric. [1] [2]

These changes make it possible to include time-varying outdoor pollutant concentrations and improve the maintainability and accuracy of wind pressure calculations.

Reworked `aR` wrapping in `windPressureLowRise.mo` to use a floor-based modulo expression (`alpha - floor(alpha/pi2)*pi2`) instead of sign-flip + conditional reduction. This correctly handles negative and large angles for non-symmetrical profiles and simplifies the algorithm.
Introduce configurable outdoor pollutant inputs in `PartialSimInfoManager` with a new `usePollutantSchedule` flag, file path, tracer count, and conditional `ReaderOutdoorAirPollution` component.
Simple constant outdoor air concentration schedule of 400ppm used for testing
Introduces a new `IDEAS.Fluid.Sources.Examples.OutsideAirFile` example that configures `OutsideAir` with an air medium including CO2 and an `inner SimInfoManager` reading outdoor pollution data from `outsideAir_simple.csv`.
OutsideAir now wraps `u` directly into `[0, 2*pi]` using a floor-based modulo expression, removing the previous sign-flip and partial range constraint logic. It also updates `C_in_internal` to use `sim.CEnv.y` only when no pollutant schedule is active, and `sim.C_outdoor` when `sim.usePollutantSchedule` is enabled.
@kldjonge

Copy link
Copy Markdown
Contributor Author

I am thinking of annotating the file format used in outsideAir_simple.csv. This would give the user the ability to store some meta-information in the header-lines (e.g. location, datasource, timing, headers).

This would change the outsideAir_simple.csv and the readerOutdoorAirPollution (ignoring a certain amount of lines in the provided file)

Do you agree?

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.

1 participant