Skip to content

Fix derived temperature output in DiskGalaxy#1960

Draft
BenWibking wants to merge 9 commits into
developmentfrom
BenWibking/fix-diskgal-temperature-var
Draft

Fix derived temperature output in DiskGalaxy#1960
BenWibking wants to merge 9 commits into
developmentfrom
BenWibking/fix-diskgal-temperature-var

Conversation

@BenWibking

Copy link
Copy Markdown
Collaborator

Description

Fixes the derived temperature output var in plotfiles (and slices/projections).

Previously, the magnetic field was not subtracted from the total energy when computing this, and so the temperature output was wrong unless the magnetic field was negligible.

Note that this did not affect the evolution of the simulation itself. The conserved variables saved in plotfiles are still correct.

Related issues

N/A

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.

@BenWibking

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@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 ComputeDerivedVar function in testDiskGalaxy.cpp to include magnetic energy when calculating the gas internal energy (Eint). The reviewer suggested using the existing helper function HydroSystem<DiskGalaxy>::ComputeInternalEnergy to simplify the code, avoid manual momentum extraction, and reduce duplication.

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/problems/DiskGalaxy/testDiskGalaxy.cpp Outdated
@BenWibking

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@BenWibking

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

BenWibking and others added 6 commits June 22, 2026 13:30
…red fields to integrand

Move computeVolumeIntegral from AMRSimulation member to free function
template in src/util/volume_integral.hpp. The integrand lambda now
receives both cell-centered and face-centered state arrays, enabling
MHD-correct internal energy computation.

Fix DiskGalaxy ComputeStatistics cold mass diagnostic to use
HydroSystem::ComputeInternalEnergy (subtracts magnetic energy) instead
of RadSystem::ComputeEintFromEgas (only subtracts kinetic energy).
@chongchonghe

Copy link
Copy Markdown
Contributor

/claude-review

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.

2 participants