AMReX-Combustion / PeleLMeX

An adaptive mesh hydrodynamics simulation code for low Mach number reacting flows without level sub-cycling.
https://amrex-combustion.github.io/PeleLMeX/
BSD 3-Clause "New" or "Revised" License
24 stars 32 forks source link

pelelm.incompressible flag segfaults #340

Closed ThomasHowarth closed 3 months ago

ThomasHowarth commented 5 months ago

Hi, If I run with the incompressible flag switched on, the code segfaults. I tracked it down to the line in the Utils that tries to get the reactions MF without a flag check (e.g. m_do_react or m_incompressible, referenced below). I could fix it and put in a pull request but figured someone could add this quick fix without needing a full pull request.

https://github.com/AMReX-Combustion/PeleLMeX/blob/2b95bc8df51829d5f81a48bc7a9b060fc7fe8545/Source/PeleLMeX_Utils.cpp#L971

Thomas

baperry2 commented 5 months ago

@ThomasHowarth good catch. Thanks for finding this and tracking down the source of the error. I think a single check on m_do_react should resolve the issue for both incompressible and nonreacting but compressible flows.

Currently all changes, whether a single line or a whole new capability, must be made through a PR. So please do submit a PR with the fix if you are willing! The PR should go through easily for something like this.