Two aligned wind turbine example case - #313
Open
ia267 wants to merge 21 commits into
Open
Conversation
ia267
force-pushed
the
309_two_aligned_wind_turbines_examples
branch
from
June 9, 2026 08:28
7933e0b to
0b7249a
Compare
ia267
force-pushed
the
309_two_aligned_wind_turbines_examples
branch
2 times, most recently
from
June 23, 2026 14:32
d2d578a to
fb3db44
Compare
ia267
force-pushed
the
309_two_aligned_wind_turbines_examples
branch
from
July 7, 2026 20:07
fb3db44 to
c29a3b2
Compare
ia267
force-pushed
the
309_two_aligned_wind_turbines_examples
branch
from
August 12, 2026 14:17
c29a3b2 to
dc072f2
Compare
ia267
marked this pull request as ready for review
August 13, 2026 14:17
Add turbine model lifecycle hooks for scalar output, checkpoint state, and finalisation. Register the wind-turbine model with the I/O manager, persist ADM restart-critical state, and write per-disc ADM diagnostic series. Also extend the ADM unit test to cover running means and scalar-output columns.
- add inlet_noise to wind_turbine namelist/config - generate noisy inlet fields once per substep in define_BC - apply inlet BC via field_set_face_from_field for u/v/w - remove old scalar outflow BC path to avoid inconsistent BC updates
Previously U_disc was only evaluated when recompute_forces is true (first substage), leaving substages 2 and 3 applying thrust based on stale velocity. Move the disc-averaging outside the recompute_forces guard so the force remains consistent with each RK substage velocity. On the first substage the time filter is advanced and U_disc_filt is used for thrust; on subsequent substages the instantaneous U_disc is used directly.
…ise reproducible - Release persistent inflow-BC planes in base_case%case_finalise so cylinder, wind_turbine and future cases are cleaned up in one place. - Rebuild the wind_turbine inlet plane only when inlet_noise is non-zero; a noise-free inlet is built once and reused. - Seed the RNG deterministically, offset by rank, so inlet-noise runs are reproducible for a fixed decomposition.
The sponge was only needed as a crutch for the under-resolved high-Re runs. The dimensional (effective LES Re) case holds machine-precision divergence without it, and no shipped example or test exercised it. Removing the sponge_* config params and the init_sponge/apply_sponge machinery keeps the ADM case focused on the disc model.
The shipped example was the non-dimensional Re=45000 AB3 config, which is under-resolved and blows up (NaN ~t=2). Replace it with the dimensional effective-LES-Re setup (Re=450, RK3, dt=0.2, D=126m discs) that runs cleanly to t=800 with machine-precision divergence and a developing turbulent wake. Also updates discs.ad to the matching dimensional disc geometry.
- Add a Wind Turbine Parameters section covering the wind_turbine_nml block (init_noise, inlet_noise, bc_start_*, iturbine, iturboutput, adm_coords, rho_air, T_relax), the ADM thrust/power model, the .ad file format, and the disc<N>.adm diagnostics. - Update the Q-criterion formula to the general second-invariant form now used in the code. - Reword the iturbine=1 description in plain terms (not yet implemented). - Refer to Incompact3d by name instead of 'legacy' in code comments.
Fix line-length and indentation to satisfy fprettify: split the long wind_turbine_nml namelist and the ADM stats_start/stats_freq assignments, reformat the compute_qcriterion continuation, and lay out the ADM output column names one per line.
…ehavior Commit fcfe416 made project_forces recompute U_disc (and the thrust) from each RK substage velocity, but test_adm was written for the earlier freeze-and-reuse behavior and was never updated, so it asserted U_disc = 10 after the velocity changed to 20 at a repeated substage. Update the block to expect the recomputed U_disc = 20 and the corresponding thrust, and fix the stale 'reuse the resulting thrust' comment in update_adm.
Drop the unverified NREL-5MW label, make the Reynolds-number comment self-contained instead of referencing the non-dimensional case, and reword the init_noise and iSVV comments for clarity.
ia267
force-pushed
the
309_two_aligned_wind_turbines_examples
branch
from
August 27, 2026 12:00
e254fc6 to
ec7c800
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created the flow case for the wind turbine example, including an interface for the turbine models (currently only the Actuator Disc Model)
changes
turbine_model_t- abstract interface for turbine forcing models, with methodsinit,update,project_forces,write_output. Ships with a no-op dummy (turbine_dummy_t, also theiturbine=0model) so the case runs before any real model exists.wind_turbinecase - uniform inflow / convective outflow in x, using a polymorphicturbine_model_t. The case owns the turbine object and is the only place theiturbineswitch appears (at allocation time); after that it calls the polymorphic turbine with no branching.c_nuandnu0_nufor thecompact6-hyperviscousscheme. This is the implicit LES the two_turbines case uses ( Incompact3djles=4) - implicit numerical dissipation, not an explicit SGS model (the explicit Smagorinsky LES issue is Add Smagorinsky LES with wall damping #321). These params are optional.src/turbine/adm.f90) - super-Gaussian force smearing (King et al. 2017), local (Calaf) thrust coefficientC_T' = C_T/(1-a)^2, optionalT_relaxvelocity filter, per-discdisc<N>.admdiagnostics, and restart-safe checkpoint state. This is a close representation of Incompact3d's ADM. The projected force divided byrho_airso it's a true acceleration (identical to Incompact3d whenrho_air=1). Read from a.addisc-coordinates fileOther changes
Not part of the disc model, but needed for the case.
cylinder.f90averaged the inflow/outflow mass flux over the localny*nz(with a NOTE admitting this was wrong under y/z decomposition). Now uses the global plane size viaget_global_dims. Unchanged on a single-rank, only fixes decomposed runscompute_qcriterion(CUDA + OMP) now uses the full second invariant; the previous form dropped the0.5*(div u)^2term. Zero for divergence-free flow, but more accurate on the discerete fieldslice_max_summin. The outflow BC reproduces Incompact3d'soutflow+pre_correc, which needs two new backend capabilities.slice_max_sumgains an optional signedmin_val(for the convective speedcx = 0.5*(uxmax + uxmin) * gdt/dx), and a newfield_add_const_x_face(abstract + CUDA + OMP) for the exact outlet mass correction (bxxn = bxxn - ut + ut1). Without the mass correction, an under-resolved wake reaching the outflow injects boundary divergence; with it the example holds machine-precision divergence at the outlet. This is used for the wind turbine case's boundary treatmentSupporting cases
inlet_noise /= 0; RNG seeded deterministically (rank-offset) for reproducible runs at a fixed decomposition.base_case:finalise_case_specifichook,append-on-restart formonitoring.csvand central release of the persistent inflow-BC planeswind_turbine_mlparams (inlet_noise,adm_coords,rho_air,T_relax)input_file.rstdocumentswind_turbine_nml, the ADM, the.adformat and the corrected Q-criterionThe example uses a dimensional (effective LES Re = 450) setup rather than Incompact3d's non-dimensional Re=45000, which is under-resolved at affordable cost and blows up; the dimensional formulation resolves the wake and runs cleanly to t=800.
Closes #309
Closes #311
Example case visualisations:
https://github.com/user-attachments/assets/f7b88c46-9b2a-43b8-9cc1-8921e9595fe2