Skip to content

Conversation

@agdestein
Copy link
Owner

@agdestein agdestein commented May 17, 2025

This PR has some breaking changes.
Now the user can choose the force (add body force, closure terms etc.).
By default, it is just decaying turbulence (convection + diffusion).

Breaking changes

  • Setup now expects a viscosity visc instead of Reynolds number Re.
    Do Setup(; ..., visc = 1e-3) instead of Setup(; ..., Re = 1e3).
    This is more transparent, as the Reynolds number cannot be prescribed when u is changing during the simulation, but the viscosity is constant.
  • The right hand side is now flexible. In solve_unsteady, it defaults to navierstokes! without temperature equation, and boussinesq! with temperature equation. This can be overridden by doing solve_unsteady(; force! = custom_force!, ...).
  • solve_unsteady should now be solve_unsteady(; start, ...) instead of solve_unsteady(; ustart, tempstart, ...), where start is either start = (; u) or start = (; u, temp). The force! acts on a state state = (; u) or state = (; u, temp), and writes the forces to a second state containing the forces for u and temp respectively.
  • Body forces and closure models are applied in a user-provided force! function to the solver, and not hard-coded in the Setup function. See the examples folder for examples.

Other changes

A new fast spectral-like Poisson solver psolver_transform is available, that uses DCT in addition to FFT. This allows for periodic directions and walls.

@codecov
Copy link

codecov bot commented May 17, 2025

Codecov Report

Attention: Patch coverage is 75.69989% with 217 lines in your changes missing coverage. Please review.

Project coverage is 62.79%. Comparing base (a9ecfb0) to head (0b303f6).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/eddyviscosity.jl 0.00% 82 Missing ⚠️
src/operators.jl 82.88% 57 Missing ⚠️
src/solver.jl 53.22% 29 Missing ⚠️
src/pressure.jl 82.35% 12 Missing ⚠️
src/matrices.jl 86.84% 10 Missing ⚠️
src/initializers.jl 55.55% 8 Missing ⚠️
src/processors.jl 66.66% 7 Missing ⚠️
src/precompile.jl 0.00% 3 Missing ⚠️
ext/MakieExt.jl 50.00% 2 Missing ⚠️
src/utils.jl 97.36% 2 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
+ Coverage   59.08%   62.79%   +3.70%     
==========================================
  Files          26       22       -4     
  Lines        3556     2857     -699     
==========================================
- Hits         2101     1794     -307     
+ Misses       1455     1063     -392     

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

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.

2 participants