AMReX-Astro / AMReX-Astro/Castro
`riemann_solvers.H`: multigroup radiation state storage overwrites `QRAD` instead of writing `QRAD+g`
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 340
- Forks
- 105
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 8
Description
Location
Source/hydro/riemann_solvers.H:174-176
Problem
In compute_flux_q(..., store_full_state=true) under #ifdef RADIATION, the loop over groups writes:
for (int g = 0; g < NGROUPS; g++) {
qgdnv(i,j,k,QRAD) = qint.er[g];
}
This overwrites the same component (QRAD) every iteration, leaving only the last group value and not populating QRAD+1... components.
Impact
- Incorrect full-state Godunov interface data for multigroup radiation.
- Derived quantities / diagnostics / downstream logic reading
QRAD+gcan see corrupted or stale values.
Steps to Reproduce
- Run with
RADIATIONenabled andNGROUPS > 1. - Trigger path where
store_full_stateistrue. - Inspect
qgdnv(i,j,k,QRAD+g)components. - Observe only
QRADis updated repeatedly; higher groups are not written correctly.
Expected Behavior
Each radiation group should be stored in its own component.
Actual Behavior
All groups are written to QRAD only.
Proposed Fix
for (int g = 0; g < NGROUPS; g++) {
qgdnv(i,j,k,QRAD+g) = qint.er[g];
}
Prepared by Codex
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Source/hydro/riemann_solvers.H:174-176 in compute_flux_q(..., store_full_state=true) under RADIATION, and inspect how the loop over groups populates qgdnv. Confirm that each group is stored in its corresponding QRAD+g component, then validate with RADIATION enabled and NGROUPS greater than one by inspecting the full-state interface data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100