Skip to content

Commit a1e0ff9

Browse files
authored
Merge branch 'development' into av/thermalconduction-amr2
2 parents ed77c91 + b47bb38 commit a1e0ff9

42 files changed

Lines changed: 1093 additions & 1605 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/mhd.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ jobs:
9999
working-directory: ${{github.workspace}}/tests
100100
shell: bash
101101
run: |
102-
${{runner.workspace}}/build/src/problems/FastWave/FastWave \
102+
${{runner.workspace}}/build/src/problems/FastWaveConvergence/FastWaveConvergence \
103103
../inputs/FastWave.toml \
104104
amr.max_grid_size_x=32 \
105105
amr.blocking_factor_x=16 \
106106
mhd.emf_compute_scheme=FelkerStone2017 \
107+
mhd.emf_averaging_scheme=LondrilloDelZanna2004 \
107108
amrex.init_snan=1 \
108109
amrex.fpe_trap_invalid=1 \
109110
amrex.fpe_trap_overflow=1 \
@@ -113,7 +114,7 @@ jobs:
113114
- name: Test
114115
working-directory: ${{runner.workspace}}/build
115116
shell: bash
116-
# Execute the MHD tests while skipping the slow HydroWave case
117+
# Execute the MHD tests while skipping the slow HydroWaveConvergence case
117118
run: canary run --output-on-failure --workers=2 -k 'MHD and not HydroWaveConvergence' .
118119

119120
- name: ccache stats

docs/markdown/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
- [Magnetohydrodynamics (beta)](mhd_module.md)
1616
- [Star Formation and Feedback (beta)](particles.md)
17+
- [Photoionization](photoionization.md)
1718
- [Dust Module (beta)](dust_module.md)
1819

1920
# Simulation Gallery

docs/markdown/components.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,16 @@ Here, `Dust` refers to the dedicated dust dynamics module enabled with `Physics_
4848

4949
This matrix covers hydro, MHD, radiation, cooling, chemistry, particles, and the dedicated dust module. It does not include self-gravity.
5050

51-
| Module | Hydro | MHD | Radiation | Cooling | Chemistry | Particles | Dust |
52-
| ------ |:-----:|:---:|:---------:|:-------:|:---------:|:---------:|:----:|
53-
| Hydro | - |||||||
54-
| MHD | - | - ||| ⚠️ || ⚠️ |
55-
| Radiation | - | - | - | ⚠️ | || |
56-
| Cooling | - | - | - | - | ⚠️ || |
57-
| Chemistry | - | - | - | - | - | | |
58-
| Particles | - | - | - | - | - | - | |
59-
| Dust | - | - | - | - | - | - | - |
51+
| Module | Hydro | MHD | Radiation | Cooling | Photoionization | Chemistry | Particles | Dust |
52+
| ------ |:-----:|:---:|:---------:|:-------:|:---------------:|:---------:|:---------:|:----:|
53+
| Hydro | - ||||||||
54+
| MHD | - | - ||| ⚠️ | ⚠️ || ⚠️ |
55+
| Radiation | - | - | - | ⚠️ || || |
56+
| Cooling | - | - | - | - || ⚠️ || |
57+
| Photoionization | - | - | - | - | - | | ⚠️ | |
58+
| Chemistry | - | - | - | - | - | - | | |
59+
| Particles | - | - | - | - | - | - | - | |
60+
| Dust | - | - | - | - | - | - | - | - |
6061

6162
Notes:
6263

@@ -66,6 +67,9 @@ Notes:
6667
- `Hydro + chemistry` is tested by `PrimordialChem` and `PopIII`.
6768
- `MHD + radiation` is explicitly disabled in `src/QuokkaSimulation.hpp` with `static_assert(!(is_mhd_enabled && is_radiation_enabled), "MHD + Radiation is not supported yet.")`.
6869
- `MHD + cooling` is exercised by the `SN` problem with `is_mhd_enabled = true` and `cooling.enabled = 1`.
70+
- `Hydro + photoionization` is tested by `DTypeFront`, `StromgrenSphere`, and `OneZonePhotoionization`.
71+
- `Radiation + photoionization` is tested by `DTypeFront` and `StromgrenSphere` — photoionization requires `is_radiation_enabled = true`.
72+
- `Cooling + photoionization` is explicitly forbidden: both modules compute H thermochemistry (photoheating, recombination cooling, collisional ionization cooling), so enabling both simultaneously double-counts those rates. Quokka aborts at startup if `cooling.enabled = 1` and `photochemistry.enabled = 1` are set together. See `docs/markdown/photoionization.md §4.1`.
6973
- `Hydro + particles` is exercised by problems such as `BinaryOrbitCIC`, `ParticleSink*`, `ParticleSF`, `ParticleRadiation`, `RandomBlast`, and `SN`.
7074
- `MHD + particles` is exercised by `DiskGalaxy`, `ParticleAccretion`, `ParticleCreation`, `ParticleSink`, and `ParticleSinkFormation`.
7175
- `Radiation + particles` is exercised by `ParticleRadiation` and `GravRadParticle3D`.

docs/markdown/developer_onboarding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
- **Pre-commit checks.** Run `./scripts/bash/pre-commit.sh` to execute the same pre-commit hooks (YAML validation, clang-format, merge conflict detection, etc.) that the CI enforces. The script prefers `uv run pre-commit`, falls back to `pre-commit` directly, and auto-installs via `pip install --user` if neither is available — no manual setup required.
2828
- **Static analysis.** Run `clang-tidy` manually or via `scripts/tidy.sh` to match the repository’s CI checks, as documented in the How to Use clang-tidy guide ([clang-tidy how-to](howto_clang_tidy.md)).
2929
- **CUDA builds on macOS or Linux.** To build and test CUDA functionality locally, run `./scripts/bash/run-cuda-container.sh`. This script pulls the appropriate Docker image, launches a container, and performs a CUDA build—useful for catching CUDA-specific issues on your development machine.
30-
- **Fast GPU validation via a scoped CI pipeline.** When iterating on a single problem that requires GPU hardware (e.g. during AMD HIP development), you can temporarily restrict the CI pipeline to build and test only that one target. In `.ci/azure-pipelines-amdgpu.yml`, add `--target <ProblemName>` to the `cmake --build` step and `-R "<ProblemName>"` to the `ctest` step, then push to trigger the pipeline. This avoids rebuilding and running the full test suite on shared GPU hardware, cutting pipeline time dramatically. Remember to revert these changes before merging.
30+
- **Fast GPU validation via a scoped CI pipeline.** When iterating on a single problem that requires GPU hardware (e.g. during AMD HIP development), you can temporarily restrict the CI pipeline to build and test only that one target. In `.ci/azure-pipelines.yml` and `.ci/azure-pipelines-amdgpu.yml`, add `--target <ProblemName>` to the `cmake --build` step and `-R "<ProblemName>"` to the `ctest` step, then push to trigger the pipeline. This avoids rebuilding and running the full test suite on shared GPU hardware, cutting pipeline time dramatically. Remember to revert these changes before merging.
3131
- **Writing and building documentation.** The developer is responsible for updating the documentation site. To build and view the documentation site locally:
3232
```bash
3333
./scripts/bash/install_mdbook.sh

docs/markdown/parameters.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,44 @@ These parameters are read in the `QuokkaSimulation<problem_t>::readParmParse()`
113113
| chemistry.max_density_allowed | Float | `1.0e300` | Maximum density value for which chemistry calculations are accurate. Chemistry is not performed for cells with densities above this threshold. |
114114
| chemistry.min_density_allowed | Float | Smallest positive Value | Minimum density value for which chemistry calculations are performed. Chemistry is not performed for cells with densities below this threshold. |
115115

116+
## Integrator (VODE)
117+
118+
These parameters control the VODE ODE integrator used for chemistry and photochemistry source terms. The generated code reads them via `init_extern_parameters()` from the `integrator` prefix. See also `docs/markdown/photoionization.md`.
119+
120+
VODE's built-in defaults (~1e-10) are unusably tight for photochemistry and will cause the integrator to stall. Users must explicitly set the tolerances below.
121+
122+
### Tolerance parameters
123+
124+
| Parameter Name | Type | Default | Description |
125+
|---|---|---|---|
126+
| `integrator.atol_spec` | Float | `1.e-10` | Absolute tolerance for species number densities (cm⁻³). |
127+
| `integrator.rtol_spec` | Float | `1.e-10` | Relative tolerance for species number densities. |
128+
| `integrator.atol_enuc` | Float | `1.e-25` | Absolute tolerance for internal energy (erg g⁻¹). |
129+
| `integrator.rtol_enuc` | Float | `1.e-10` | Relative tolerance for internal energy. |
130+
| `integrator.atol_rad_num` | Float | `1.e-10` | Absolute tolerance for radiation number density (cm⁻³). |
131+
| `integrator.rtol_rad_num` | Float | `1.e-10` | Relative tolerance for radiation number density. |
132+
| `integrator.species_failure_tolerance` | Float | `0.01` | Maximum allowed negative species number density (cm⁻³) at internal VODE nodes. When exceeded, VODE rejects the substep and retries with a smaller timestep. Should equal `atol_spec`. At the final interpolated state, the threshold is relaxed to 1.5× this value to account for VODE's non-monotonic interpolation. |
133+
| `integrator.radiation_failure_tolerance` | Float | `0.01` | Maximum allowed negative photon number density (cm⁻³) at internal VODE nodes. When exceeded, VODE rejects the substep and retries with a smaller timestep. Should equal `atol_rad_num`. At the final interpolated state, the threshold is relaxed to 1.5× this value. |
134+
135+
### Other integrator parameters
136+
137+
| Parameter Name | Type | Default | Description |
138+
|---|---|---|---|
139+
| `integrator.jacobian` | Integer | `1` | Jacobian type: `1` = analytical, `2` = numerical. |
140+
| `integrator.ode_max_steps` | Integer | `150000` | Maximum number of VODE internal steps per burn call. |
141+
| `integrator.ode_max_dt` | Float | `1.e30` | Maximum internal timestep for VODE. |
142+
| `integrator.use_number_densities` | Boolean (0/1) | `1` | If 1, evolve species as number densities instead of mass fractions. Must be `1` for Quokka. |
143+
| `integrator.subtract_internal_energy` | Boolean (0/1) | `1` | If 1, subtract internal energy before integration. Must be `0` for Quokka. |
144+
| `integrator.call_eos_in_rhs` | Boolean (0/1) | `1` | If 1, call EOS in the RHS to update temperature from internal energy. Must be `1` for Quokka. |
145+
| `integrator.integrate_energy` | Boolean (0/1) | `1` | If 1, enable energy integration; if 0, freeze energy. Not recommended for use with number densities. |
146+
| `integrator.scale_system` | Boolean (0/1) | `0` | If 1, scale the ODE system to be O(1). Does not work with number densities — leave at `0`. |
147+
| `integrator.use_burn_retry` | Boolean (0/1) | `0` | If 1, retry failed burns with swapped Jacobian or relaxed tolerances. |
148+
| `integrator.retry_swap_jacobian` | Boolean (0/1) | `1` | If 1, swap Jacobian type (analytic to numerical) on retry. |
149+
| `integrator.burner_verbose` | Boolean (0/1) | `0` | If 1, print diagnostic output after each burn. |
150+
| `integrator.SMALL_X_SAFE` | Float | `1.e-30` | Species floor to prevent underflow in the integrator. |
151+
| `integrator.X_reject_buffer` | Float | `1.0` | Buffer factor for the species change-factor rejection threshold. Only meaningful for mass fractions; has no effect with number densities. Set to `1e100` to disable. |
152+
| `integrator.do_corrector_validation` | Boolean (0/1) | `1` | If 1, check predicted state validity before calling RHS. |
153+
116154
## Dust
117155

118156
These parameters are read in the `QuokkaSimulation<problem_t>::readParmParse()` function in `src/QuokkaSimulation.hpp`, except for optional Kwok stopping-time grain parameters that are read by problem setups that opt into `quokka::dust::readDustGrainParams`.

0 commit comments

Comments
 (0)