Skip to content

IMEX Photoionization#1947

Draft
James471 wants to merge 84 commits into
developmentfrom
imex
Draft

IMEX Photoionization#1947
James471 wants to merge 84 commits into
developmentfrom
imex

Conversation

@James471

Copy link
Copy Markdown
Contributor

Description

Please write a short paragraph describing what changes this pull request makes to the code. It should provide sufficient context so that a reviewer can efficiently browse the source code changes.

Related issues

Are there any GitHub issues that are fixed by this pull request? Add a link to them here.

Checklist

Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an x inside the square brackets [ ] in the Markdown source below:

  • I have added a description (see above).
  • I have added a link to any related issues (if applicable; see above).
  • I have read the Contributing Guide.
  • I have added tests for any new physics that this PR adds to the code.
  • (For quokka-astro org members) I have manually triggered the GPU tests with the magic comment /azp run.

James471 and others added 30 commits June 4, 2026 16:45

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Microphysics subproject, adjusts integrator tolerances and network settings in several input files, integrates photochemistry calculations into the radiation subcycling stages, and updates CMake configurations to specify the Rosenbrock solver. A review comment suggests using if constexpr when checking numPassiveScalars to prevent compilation errors when no passive scalars are defined.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/QuokkaSimulation.hpp
Comment on lines +3138 to +3144
#ifdef PHOTOCHEMISTRY
for (int nn = 0; nn < Physics_Traits<problem_t>::numPassiveScalars; ++nn) {
stateNew(i, j, k, RadSystem<problem_t>::scalar0_index + nn) =
(1.0 - IMEX_alpha) * stateNew(i, j, k, RadSystem<problem_t>::scalar0_index + nn) +
IMEX_alpha * stateTmp(i, j, k, RadSystem<problem_t>::scalar0_index + nn);
}
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When Physics_Traits<problem_t>::numPassiveScalars is 0, RadSystem<problem_t>::scalar0_index may not be defined or could be invalid, which can lead to compilation errors during template instantiation. Using if constexpr ensures that this block is only compiled when there are actually passive scalars present.

#ifdef PHOTOCHEMISTRY
					if constexpr (Physics_Traits<problem_t>::numPassiveScalars > 0) {
						for (int nn = 0; nn < Physics_Traits<problem_t>::numPassiveScalars; ++nn) {
							stateNew(i, j, k, RadSystem<problem_t>::scalar0_index + nn) =
							    (1.0 - IMEX_alpha) * stateNew(i, j, k, RadSystem<problem_t>::scalar0_index + nn) +
							    IMEX_alpha * stateTmp(i, j, k, RadSystem<problem_t>::scalar0_index + nn);
						}
					}
#endif

@BenWibking BenWibking changed the title Imex IMEX Photoionization Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant