Repository navigation
Fix issues #207, #217, #227, #250 - #261
Merged
Merged
Conversation
Both the Smagorinsky and Sigma models compute (C*Delta)^2 * |S|, a kinematic eddy viscosity nu_t, but getViscosity adds it directly to IAMR's dynamic viscosity mu. For variable or non-unit density the subgrid viscosity was therefore wrong by a factor 1/rho. Multiply by the face-averaged density so mu_t = rho*nu_t, and document this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Rho on level>0 with ref_ratio > 2 On level > 0, getViscTerms divides the coarse data of a Laplacian_SoverRho scalar by crse_ns.get_rho(time), where time is a fine-level time. get_rho only supports the coarse old/half/new times, which match a fine time only for ref ratio 2: ratio 4 dereferences a null rho_qtime/rho_tqtime and ratio 3 fails with "bad time". Abort with a clear message instead when the ref ratio exceeds 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r helpers Nothing in Source/, Exec/ or Tutorials/ calls read_binary, read_csv, read_file or locate (Source/Utilities), or VectorMax/VectorMin/ VectorMaxAbs (NS_util.cpp); they were only compiled, and the readers had latent overruns and a declaration/definition mismatch under USE_FLOAT. Remove Source/Utilities and NS_util.cpp, drop them from Exec/Make.IAMR and Source/Make.package, and remove the now-unneeded includes. NS_util.H is kept for convertToDeviceVector, which NavierStokesBase.cpp uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ks, update README The eleven inputs_* decks and six probin_* namelists in Exec/run2d/test_grids predate the C++ problem setup: none sets prob.probtype, the probin files are never read (AMREX_NO_PROBINIT), and several also abort on RZ-with-viscosity or temp_cond_coef without do_temp. Nothing references them. Remove them and keep the fixed_grids_N and plt0000_N files, which are still valid. Rewrite the README to describe each grid configuration with the domain, max_level, ref_ratio (and max_grid_size) it needs, and how to use it from an existing 2D inputs file via amr.regrid_file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
asalmgren
approved these changes
Oct 9, 2026
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.
Fixes #207,
fixes #217,
fixes #227,
fixes #250.
Issues addressed
#207: the LES eddy viscosity is kinematic (
nu_t), but it is added to the dynamic viscositymu. Both the Smagorinsky and Sigma models compute (C·Δ)²·|S| = ν_t, andgetViscosityadded that directly to IAMR's dynamic μ. So wherever ρ ≠ 1 the eddy viscosity was off by 1/ρ.calc_mut_LESnow fills ρ with one ghost cell at the same time and multiplies both models by the face-averaged density, so μ_t = ρ·ν_t. The LES section ofAlgorithmOptions.rstnow says this. Any run withns.do_LES=1and ρ ≠ 1 will give different results, includingTutorials/HotSpot/inputs.3d.LES_hotspot.#217:
getViscTermson level > 0 callscrse_ns.get_rho(time)at a fine-substep time. ForLaplacian_SoverRhoscalars (ns.do_cons_trac=1),get_rhoonly handles the coarse old/half/new times. Ratio 4 dereferences a nullrho_qtime, and ratio 3 fails with "bad time". This combination now aborts with a clear message when the ref ratio to the coarser level is > 2. Ratio 2 is unchanged.#227: unused
Source/UtilitiesandNS_util.cppvector helpers. Nothing calledread_binary,read_csv,read_file,locate,VectorMax,VectorMinorVectorMaxAbs. This PR removesSource/Utilities/andNS_util.cpp, drops them fromExec/Make.IAMRandSource/Make.package, and removes the includes that are no longer needed.NS_util.Hstays forconvertToDeviceVector, whichNavierStokesBase.cppuses.#250: the
Exec/run2d/test_gridsdecks abort at startup. This removes the 11inputs_*decks and the 6probin_*files, which nothing references. Thefixed_grids_Nandplt0000_Nfiles are kept. The README now describes each grid configuration with then_cell,prob_hi,max_levelandref_ratioit needs (plusmax_grid_sizefor configuration 1), and explains how to use it throughamr.regrid_filefrom an existing 2D inputs file.Testing
Source/,Source/prob/) compile in the 3D GNU+MPI build. The full link couldn't be checked locally because the AMReX-Hydro checkout here is missinghydro_slopes_K.H, which is unrelated to this PR.NavierStokesBase::calc_mut_LES: the Smagorinsky/Sigma eddy viscosity is kinematic (nu_t) but is added to the dynamic viscositymu#207). The other changes don't affect numerical results.🤖 Generated with Claude Code