Repository navigation
Conversation
This branch has not been deployed
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.
Proposed Changes
Three fixes in the SA source terms (
turb_sources.hpp), found by checking each source term against the published model and its Jacobian against the derivative of the code's own residual, at 50 significant digits.1. SA-Edwards strain measure.
Omega::Edwsubtracted 2/3 Σ(∂u_i/∂x_i)², the sum of the squared normal gradients, instead of 2/3 (∂u_k/∂x_k)², the square of the divergence (TMR, SA-Edwards). The two differ by (4/3)(u_x v_y + u_x w_z + v_y w_z), which is not zero in incompressible flow either, so S was underestimated wherever there is normal strain.2. SA-Edwards Jacobian of r.
r::Edwoverwrotevar.rwith tanh(r0)/tanh(1) and then used1 - tanh(var.r)^2for the chain rule, i.e. it differentiated at the wrong argument. It now uses r0, and setsd_r = 0where r0 is clipped at 10, asr::Bsldoes.3. Rough-wall
d_fv2.fv2 = 1 - nue/(nu + nue fv1)uses nue/nu, but its derivative usedJi = nue/nu + cr1 ks/d, which includes the roughness shift. For rough walls this gave a wrong value and sometimes the wrong sign (e.g. +5824 instead of −8449 at chi = 1.25, Ji = 4.72). Smooth walls are unaffected (Ji = nue/nu).1 changes the residual; 2 and 3 only change the Jacobian.
Results
RAE2822, SA-Edwards (
turb_SA_EDW_RAE2822.cfg, run to the config'sCONV_RESIDUAL_MINVAL= -8), current develop before and after:Before, the SA equation is barely converged when the run stops; with the corrected Jacobian it converges with the flow.
rough_flatplate_incomp.cfg(rough SA) converges in the same 3242 iterations with the same CD before and after, so fix 3 is neutral there.Regression tests
Updated, values computed locally with 2 ranks (parallel) and serially; with develop the same setup reproduces all stored values exactly:
turbmod_sa_edw_rae2822,turbmod_sa_comp_edw_rae2822(parallel): fixes 1 and 2.inc_flatplate_pb(serial and parallel): fix 3.turbmod_sa_bsl_rae2822andturbmod_sa_neg_rae2822are unchanged.Related Work
The EDDES vortex-tilting trace in
CTurbSAVariable.cpphas a similar issue (only the diagonal of the strain tensor in tr(S²)); #2150 already fixes it, so it is not touched here.PR Checklist
pre-commit run --allto format old commits.