Synthetic turbulence#1548
Conversation
Claude Code ReviewHead SHA: dafeef6 Files changed:
Findings1. Wrong density used for force scaling in multi-fluid cases (correctness)File: rho_local = q_prim_vf(eqn_idx%cont%beg)%sf(j, k, l)
f_scale = rho_local*(synth_U_inf/synth_L(turb_idx, 1))*G_norm
The existing body-force path avoids this by using the precomputed 2. Non-perpendicular solenoidal direction in 3-D degenerate branch (physics correctness)File: ! k nearly parallel to z; cross with x-hat instead k_hat x x_hat = (0, -kz, k_y)/norm (normalised)
synthetic_ex(m_global) = 0._wp
synthetic_ey(m_global) = -kz/max(sqrt(kz*kz + (k_mag*sin(rn1))**2), 1e-10_wp)
synthetic_ez(m_global) = (k_mag*sin(rn1))/max(sqrt(kz*kz + (k_mag*sin(rn1))**2), 1e-10_wp)
so Fix: replace both occurrences of synthetic_ey(m_global) = -kz/max(sqrt(kz*kz + (r_xy*sin(rn1))**2), 1e-10_wp)
synthetic_ez(m_global) = (r_xy*sin(rn1))/max(sqrt(kz*kz + (r_xy*sin(rn1))**2), 1e-10_wp)This only affects 3-D runs where some wave vectors are nearly parallel to z (|kz| ≥ 0.9). |
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