Synthetic turbulence#1548
Conversation
|
Claude Code Review Head SHA: 69cf365 Files changed:
Findings:
|
|
Merged current master into this branch to resolve the conflict from #1550 (named parameter values / params codegen). One conflict in Two pre-existing items will still fail CI, flagging so they're not a surprise:
Both are quick fixes on your side. Also FYI: enumerated case parameters now accept named values ( |
Resolves conflicts with the generated-declarations/broadcast refactor: - sim m_global_parameters: synthetic-turbulence namelist scalars are now declared by generated_decls.fpp (registry in toolchain/mfc/params/ definitions.py); their GPU_DECLARE lines move to m_global_parameters_common (declare directives must live in the declaring module). The namelist arrays (synth_n_waves_per_shell, synth_k_shell, synth_amp_shell, turb_pos, synth_L) keep manual declarations; defaults stay manual. fft_wrt default now comes from s_assign_common_defaults. - sim m_mpi_proxy: scalar broadcasts (incl. synthetic_turbulence, synth_seed, synth_n_shells, num_turbulent_sources, synth_U_inf, nv_uvm_*) come from generated_bcast.fpp; only the five synth array broadcasts stay in the manual residue
|
I've pushed a merge of
I verified the generated output directly: all five scalars get declarations + broadcasts, all five arrays appear in the generated namelist, and the scalars are correctly absent from the manual residue. For future parameters on this branch: registration in |
|
Hi @danieljvickers @sbryngelson, you may already know, but I implemented a synthetic turbulence generator in One key difference would be my implementation runs only in the pre_process, because I targeted a temporal mixing layer, not a spatial one, while this PR is for a spatial configuration so the turbulence should be seeded at the inflow boundary over the simulation time. Given that, I believe it would be better to put them together in a unified framework, if possible, in terms of DIY principles or at least for maintainability. Let me know if there's anything I can help you with. |
|
it certainly is a mess right now, and having a turbulence generator that's specific to a configuration (mixing layer) is niche |
…sity in synthetic forcing
|
@hyeoksu-lee - folded your generator in as the shared basis here.
Left the call sites separate - yours is a pre_process IC with Reynolds-stress anisotropy, this is per-step inflow forcing. The spectrum/anisotropy layer could be unified later if worth it. |
# Conflicts: # toolchain/mfc/test/cases.py
|
Pushed two things to this branch and ran a validation pass on the synthetic-turbulence forcing (all on real MFC output, batch runs on hpcfund CPU). Housekeeping pushed to the branch
The two earlier Claude review findings are already fixedBoth were real at the reviewed SHA (
Validation results
One thing for the writeupIn the developed run, isotropy degrades (0.74 → 0.35; Happy to help wire up a larger isotropy/intensity study if useful. |
69cf365 to
36fed96
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1548 +/- ##
==========================================
+ Coverage 60.88% 61.09% +0.20%
==========================================
Files 83 83
Lines 19836 20078 +242
Branches 2953 3002 +49
==========================================
+ Hits 12077 12266 +189
- Misses 5767 5783 +16
- Partials 1992 2029 +37 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The synthetic_turbulence feature (m_body_forces) had no automated coverage: its only example (2D_synthetic_turbulence) is in casesToSkip because the moving-airfoil-IB forced run is FP-marginal across compilers. Add a stable golden instead: a 24^3 triply-periodic uniform single-fluid box driven by the deterministic (compiler-independent) 2-shell solenoidal random-Fourier-mode forcing. Run only 3 steps -- forced turbulence is chaotic, so tiny cross-compiler libm differences (cos/exp) amplify to O(field) within ~20 steps (measured: a 50-step golden diverged 1e-2 abs on the GNU CI lane; 25 steps still 4e-4). At 3 steps the solution is still ~dt*F, the deterministic forcing itself, so the golden holds across CI compilers while fully exercising mode generation (s_initialize_body_forces_module, incl. the 3-D solenoidal construction) and application (s_compute_synthetic_forces_rhs). Trace: 3D -> synthetic_turbulence (CB853530). Generated + verified on CPU.
36fed96 to
bfef557
Compare
Description
This branch includes the ability to inject synthetic turbulence in a Gaussian forcing region as described in
Tangermann, E. & Klein, M. (2020). "Controlled Synthetic Freestream Turbulence Intensity Introduced by a Local Volume Force." Fluids 5(3), 130. https://doi.org/10.3390/fluids5030130
Type of change (delete unused ones)
Testing
I ran 2D and 3D synthetically injected turbulence over an airfoil IB.
I still need to do an analysis of the energy distribution to validate the model and show that it was implemented correctly. This is why it is still a draft PR.
Checklist
See the developer guide for full coding standards.
GPU changes (expand if you modified
src/simulation/)AI code reviews
Reviews are not retriggered automatically. To request a review, comment on the PR:
@claude full review— Claude full review (also triggers on PR open/reopen/ready)claude-full-review— Claude full review via label