Pass the edge length, not its square, to the coarse NEMO viscous Jacobian - #2883
Pass the edge length, not its square, to the coarse NEMO viscous Jacobian#2883bellonarts wants to merge 3 commits into
Conversation
…bian CAvgGrad_NEMO::ComputeResidual assigned the squared norm of the edge vector to dist_ij and passed it to GetViscousProjJacs, which expects the distance. Take the square root, as CAvgGradCorrected_NEMO already does. Only the analytic viscous Jacobian changes; the residual is untouched. CDriver.cpp uses CAvgGrad_NEMO for the interior viscous term on every coarse multigrid level and for the boundary viscous term on every level including MESH_0, where it is consumed only by BC_Far_Field, BC_Supersonic_Inlet and the inherited BC_Fluid_Interface (the NEMO wall routines build their own fluxes). The defect therefore reaches every NEMO Navier-Stokes run that uses multigrid, a far-field or supersonic-inlet marker, or a fluid interface. Add a commented finite-difference unit test on a 2-D AIR-5 edge (NEMOViscousFixture) that fails on develop (8/75) and passes with this change (8/15), and rebaseline the regression vectors that move as a consequence: the machine-zero species columns of visc_cone (serial and parallel) and super_cat (parallel), and the physical residual columns rms[Rho_0..5] and rms[RhoE] of ion_gy (parallel), which shift by up to 1.05e-2 because that case has no identically-zero species. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pcarruscag
left a comment
There was a problem hiding this comment.
This looks like a good find, but just to be sure. Have you run two cases to convergence to further verify that this makes things better?
There was a problem hiding this comment.
I don't want tests that duplicate a ton of code to prove something that is trivial to prove correct by inspection. Make this substantially simpler or revert.
| su2double dist_ij_2[MAXNDIM] = {0.0}; | ||
| GeometryToolbox::Distance(nDim, Coord_j, Coord_i, dist_ij_2); | ||
| dist_ij = GeometryToolbox::SquaredNorm(nDim, dist_ij_2); | ||
| dist_ij = sqrt(GeometryToolbox::SquaredNorm(nDim, dist_ij_2)); |
Use GeometryToolbox::Norm directly and remove the 179-line NEMO fixture/test at maintainer request. The affected public NEMO regression cases retain path coverage. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Update the serial and two-rank viscous-cone aarch64 expectations from GitHub Actions run 33998938091 at exact pre-update head ab76f7f. Artifact digest: sha256:279e65a52098a2829127441d352dd4d88d0979ae7fdb8870a9c779d076a537e6. No x86 expectation or solver source changes.
Reseal PRs su2code#2883-su2code#2885 at heads b8504d8, 2925b4a, and 8bfba2f, switch their NEMO jobs from harvest to strict vector verification, and apply the public regression drivers' 1e-5 default when tol remains unset. S2/S3 stay harvest-only because they preserve the pre-vector-update cumulative stages.
|
@pcarruscag Yes. I ran Mach 2 and 2.5 cold starts on the same sphere mesh, comparing this PR with its base. Both used AIR5, 6 Pa, T=Tve=220 K, CFL1, MG1 with the default coarse CFL ratio of 0.25, and two MPI ranks per arm. The patch converged naturally in 1,341 and 1,243 recorded rows, with zero nonphysical points. The controls were deliberately stopped by the nonphysical point guard after 34 and 23 rows, with maxima of 4 and 9 nonphysical points. Counts include row zero. Both patched runs passed all ten log10 RMS limits ≤−6 and all three absolute 100-window CD/CL/HF Cauchy limits <1e−6. Each final field also passed an MG0 residual audit. These are two conditions on one geometry and show improved robustness under these settings. I also switched to Evidence ZIP: configs, mesh, logs, results, plots and reproduction instructions. |
Use
GeometryToolbox::Norminstead ofSquaredNormwhen passing edge distance to the NEMO approximate viscous Jacobian. This changes one production line; the physical flux calculation is unchanged. The duplicated fixture was removed, and the existing serial and parallel regression vectors were updated, including thevisc_coneaarch64 values.I compared head
b8504d8against base07aa46bat Mach 2 and 2.5 on the same 37,192 point sphere mesh. Each pair used identical settings and cold starts: AIR5, 6 Pa, T=Tve=220 K, first order AUSM, implicit Euler, an adiabatic noncatalytic wall, CFL1, MG1 with the default coarse CFL ratio of 0.25, and two MPI ranks per arm.Counts include row zero. Both patched runs met all ten log10 RMS residual limits ≤−6 and all three absolute 100-window CD/CL/HF Cauchy limits <1e−6, with clean natural exits before the 10,000 row cap. Each saved final field also passed a separate MG0 residual audit on the same mesh. Independent verification passed.
The controls were deliberately stopped by the nonphysical point guard. These are two operating conditions on one geometry and show improved robustness under these settings, without establishing a speedup or improved physical accuracy.
Evidence ZIP with configs, mesh, logs, results, plots and reproduction instructions. Reply to Pedro.