Skip to content

Gaussian mixing layer#68

Merged
aefarrell merged 8 commits into
mainfrom
gaussian-mixing-layer
Jul 1, 2025
Merged

Gaussian mixing layer#68
aefarrell merged 8 commits into
mainfrom
gaussian-mixing-layer

Conversation

@aefarrell
Copy link
Copy Markdown
Owner

Gaussian plumes released beneath an inversion become trapped, leading to larger ground-level concentrations.

Mixing layer model from ISC3 user guide, volume 2 equation 1-50. Calculates the full sum, without any checking to see if it is worth continuing.
Refactor simple Gaussian plume to be more re-useable, then the mixing layer is just an extension of the existing plume solution
SimpleAtmospheres have a default mixing height calculation, which is unfortunately a function of latitude. I used the default baked into TSCREEN and ISC3 (40\deg N) but this is problematic.
Updated the docs to refer to the Gaussian Mixing Layer model
Added mixing layer model based on an infinite sum of cosines. This converges very slowly (in my testing) but is used in some places.
@aefarrell aefarrell linked an issue Jun 30, 2025 that may be closed by this pull request
@aefarrell aefarrell added this to the v0.4 milestone Jun 30, 2025
@aefarrell aefarrell added the enhancement New feature or request label Jun 30, 2025
@aefarrell aefarrell self-assigned this Jun 30, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.03%. Comparing base (6a98837) to head (44f1588).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #68      +/-   ##
==========================================
+ Coverage   95.87%   96.03%   +0.16%     
==========================================
  Files          43       46       +3     
  Lines        2712     2823     +111     
==========================================
+ Hits         2600     2711     +111     
  Misses        112      112              

☔ 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.

@aefarrell
Copy link
Copy Markdown
Owner Author

Two mistakes:

  • unit tests check an area where the mixing layer is largely irrelevant, not a good check for whether it is working!
  • there is no check for if plume-rise has injected the plume above the mixing layer, which can't happen

Added a `ProblemDomain` type and a domain check function the generalize the GaussianPlumeSolution. Previously it was ignoring the mixing layer when deciding on the domain of the problem.
Added a limiter to plume rise, forcing plume rise below the mixing layer.
Updated doc tests and unit tests to ensure better coverage, fix broken things.
Added checks to ensure simple mixing layer exits the for loop correctly, either by breaking out early if the sum has converged or by running out the loop
@aefarrell
Copy link
Copy Markdown
Owner Author

Updates followed the philosophy that this should be an extension of the existing GaussianPlumeSolution by removing hard-coded domain checks, and adding methods to update PlumeRise objects to limit plume rise above the mixing layer.

The two algorithms are checked for correctness, basically, by seeing if they get the same answer. Which they should if enough terms are included in the sums.

@aefarrell aefarrell merged commit cf87ba9 into main Jul 1, 2025
94 checks passed
@aefarrell aefarrell deleted the gaussian-mixing-layer branch July 1, 2025 00:13
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.

Gaussian mixing layer

1 participant