Skip to content

1D solver crashes when loglevel >7 #2073

@wandadars

Description

@wandadars

The loglevel in the 1D solver generates errors when set to anything greater than 7. This is because the call to the toArray() that is now used in the save() method in the Sim1D class has a call to updateThermo(), which when the loglevel is greater than 7 involves a swapping of the solution vector with the residual vector via the saveResidual() method. So the updateThermo() gets called on a vector that is not valid/consistent thermodynamic state (instead it's just filled with residuals), and this generates an error. In the case I saw it was because it thought the temperature was 0 somewhere.

I'm not sure what to do to resolve this. The call to toArray() seems necessary, and the only thing I can think of right now is that some other argument could be added like a update_thermo=true default argument and then the saveResidual() could somehow activate this argument to prevent the crash from happening.

I'll open up a PR and fix it if any better suggestions are made.

  • Cantera version: Dev branch
  • OS: Ubuntu 24.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions