Skip to content

CurledWake: full divergence form for delta_u diffusion#34

Open
zanig wants to merge 1 commit into
Howland-Lab:mainfrom
zanig:fix/du-diffusion-divergence-form
Open

CurledWake: full divergence form for delta_u diffusion#34
zanig wants to merge 1 commit into
Howland-Lab:mainfrom
zanig:fix/du-diffusion-divergence-form

Conversation

@zanig

@zanig zanig commented May 12, 2026

Copy link
Copy Markdown

Replaces the Laplacian-only diffusion term nu_T * (d2u/dy2 + d2u/dz2)
with the full divergence form d/dy(nu_T du/dy) + d/dz(nu_T du/dz)
in CurledWakeWindfield._step. Also drops the now-unused second_der import.

I believe this is a leftover from previous versions where the turbulence models were a lot simpler (const $\nu_T$ or neglible gradients), since The Δk transport equation in CurledTurbulenceModel_kl.compute_dkdx uses the full divergence form already for diffusion.
A nice side effect of this fix is that with scipy_rk45, the full divergence form requires only roughly a thrid of integration steps compared to the current Laplacian-only version on example case 08, so this should also improve run time.

Impact: Taking example case 08 with the full divergence form vs. the current Laplacian-only implementation, I see the following differences in Cp:

  • Turbine 2: ~1.5%
  • Turbine 3: ~6%

You're making a pull request to a branch (probably main) of MITWindFarm. Please ensure you have done the following.

  • Request a review from other Howland Lab members who use MITWindFarm.
  • Add at least a sentence on your change to the documentation (probably the quickstart guide).
    ---> no new functionality so I assume this is not needed?
  • Add tests for your new functionality.
    ---> more of a "physical" fix so explicitly testing is difficult
  • Make sure the tests pass and the documentation notebook still runs.
  • Get approval from the folks you requested a review from.

If you want more details on best practices, please see the following guide on the Howland Lab Google Drive.

Happy merging!

  Replace the Laplacian-only diffusion term nu_T * (d2u/dy2 + d2u/dz2)
  with the full divergence form d/dy(nu_T du/dy) + d/dz(nu_T du/dz)
  in CurledWakeWindfield._step. Drops the now-unused second_der import.
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