Skip to content

Make sure viscturb is always initialized when plotting#592

Merged
baperry2 merged 2 commits intoAMReX-Combustion:developmentfrom
baperry2:mut_init_plt
Nov 18, 2025
Merged

Make sure viscturb is always initialized when plotting#592
baperry2 merged 2 commits intoAMReX-Combustion:developmentfrom
baperry2:mut_init_plt

Conversation

@baperry2
Copy link
Copy Markdown
Collaborator

The turbulent viscosity is not currently computed on initialization in the "old" state, only the "new" state. So if we don't have any init iters, the state plotted for plt00000 is uninitialized. Also, the "-1" state that gets plotted with the plot_init_state option is never properly initialized.

Two fixes:

  • Plot turbulent viscosity from the "new" state rather than the old "state" (although after initialization, turbulent_viscosity is always computed at the old state, it gets copied to the new state so this should be fine)
  • Compute turbulent viscosity on initialization prior to dumping the "-1" plt file

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses uninitialized turbulent viscosity values in plot files during initialization. The fix ensures that turbulent viscosity is properly computed and available for plotting in both the initial state (plt00000) and the optional pre-iteration state (plot_init_state).

Key Changes:

  • Switched plot file generation to use turbulent viscosity from the "new" state instead of "old" state
  • Added turbulent viscosity computation during initialization before writing the initial plot file

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Source/PeleLMeX_Plot.cpp Changed turbulent viscosity source from m_leveldata_old to m_leveldata_new for all spatial dimensions
Source/PeleLMeX_Init.cpp Added calcTurbViscosity call during initialization when LES is enabled, before optional initial plot file output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@baperry2 baperry2 enabled auto-merge (squash) November 18, 2025 21:49
@baperry2 baperry2 merged commit 011f3d8 into AMReX-Combustion:development Nov 18, 2025
24 checks passed
@baperry2 baperry2 deleted the mut_init_plt branch November 25, 2025 22:55
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.

3 participants