Skip to content

Cantera not throwing any error on the misuse of the attribute 'Q' #1093

@syedshayanz

Description

@syedshayanz

Problem description

I used the command "air.HPQ = None, Pa, 'o2:0.21, n2:0.79, AR:0.01'" and it worked. When I checked the results, it appeared that cantera just ignores the Q attribute instead of indicating that a string cannot be assigned for Q.

Steps to reproduce

  1. Run the following commands in cantera:
    import cantera as ct
    gas = ct.Solution('gri30.yaml')
    air = ct.Quantity(gas, constant='HP')
    air.HPQ = None, None, 'o2:0.21, n2:0.79, AR:0.01'

  2. Error should be seen since a string is being assigned to Q, but no error appears.

Behavior

Cantera just ignores the wrong assignment to Q, but instead it just runs while ignoring the misuse of Q.

System information

  • Cantera version: 2.5.1
  • OS: macOS 11.4 Big Sur
  • Python/MATLAB/other software versions: Python 3.7.9

Attachments

Additional context
cantera_issue.py.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions