ansys / pyfluent

Pythonic interface to Ansys Fluent
https://fluent.docs.pyansys.com
MIT License
275 stars 40 forks source link

Broken solver.tui.define.models.addon_module() #1799

Closed raph-luc closed 1 year ago

raph-luc commented 1 year ago

This is the reason for tests/test_tui_api.py::test_runtime_tui_menus failing, see https://github.com/ansys/pyfluent/actions/runs/5544822327/jobs/10122911719.

Calling that test results in a loop of segmentation faults, see for example the size of the cortexerror.log file with almost one million lines of text: image

It only has this message repeated ad infinitum:

Error [cortex] [time 7/13/23 16:52:21] Cortex received a fatal signal (SEGMENTATION VIOLATION).
1000000: fluent(CX_Primitive_Error+0x225) [0x7f72d5]
1000000: fluent() [0x7f8030]
1000000: /lib64/libc.so.6(+0x36400) [0x7fc634679400]
1000000: /ansys_inc/v241/fluent/fluent24.1.0/cortex/lnamd64/libGrpcServer.so(_ZN8remoting6server13StreamHandlerIN12grpcRemoting17TranscriptRequestENS2_18TranscriptResponseEE10streamDataERS4_+0x3d5) [0x7fc6067b5ca5]
1000000: /ansys_inc/v241/fluent/fluent24.1.0/cortex/lnamd64/libGrpcServer.so(+0x9bb6f4) [0x7fc6067b56f4]
1000000: fluent(Port_Echo_String+0x63) [0x93de43]
1000000: fluent() [0x93ddb2]
1000000: fluent(message+0xc7) [0x935ed7]
1000000: fluent(seem_err+0x62) [0x936332]
1000000: fluent(lerr+0x3d) [0x8ab3ed]
1000000: fluent(eval+0xb7a) [0x93402a]
1000000: fluent() [0x935a6f]
1000000: fluent(eval+0xfd0) [0x934480]
1000000: fluent(eval+0xec7) [0x934377]
1000000: fluent(eval+0x1f25) [0x9353d5]


Captured log call before error:

DEBUG    pyfluent.networking:interceptors.py:27 GRPC_TRACE: rpc = /ansys.api.fluent.v0.DataModel/GetAttributeValue, request = {'path': '/define/models/addon_module'}
DEBUG    pyfluent.networking:interceptors.py:34 GRPC_TRACE: response = {'value': []}
DEBUG    pyfluent.tui:datamodel_tui.py:195 TUI Command: path: "/define/models/addon_module"
args {
  fields {
    key: "tui_args"
    value {
      list_value {
        values {
          number_value: 3.0
        }
      }
    }
  }
}

DEBUG    pyfluent.networking:interceptors.py:27 GRPC_TRACE: rpc = /ansys.api.fluent.v0.DataModel/ExecuteCommand, request = {'path': '/define/models/addon_module', 'args': {'tui_args': [3.0]}}


Fluent .trn file:

Fluent Addon Modules:
        0. None
        1. MHD Model
        2. Fiber Model
        3. Fuel Cell and Electrolysis Model
        4. SOFC Model with Unresolved Electrolyte
        5. Population Balance Model
        6. Adjoint Solver
        7. Single-Potential Battery Model
        8. MSMD Battery Model
        9. PEM Fuel Cell Model
        10. Macroscopic Particle Model
        11. Reduced Order Model
        12. PCB Model
Fast-loading "/ansys_inc/v241/fluent/fluent24.1.0/addons/fuelcells/lib/addon.bin"

Error: eval: unbound variable
Error Object: no

Error: Invalid string.
Error Object: no


Also note Fluent is reporting errors, that are not raising any exceptions in PyFluent (until RuntimeError: End of TCP stream or RuntimeError: Socket closed), so PyFluent keeps going only making things worse until Fluent goes down

seanpearsonuk commented 1 year ago

@raph-luc @mkundu1 some of your commits reference this issue. Is it resolved?

If not, have we triaged wrt isolated Fluent-side behaviour?

raph-luc commented 1 year ago

The test is still being skipped, so the issue has not yet been resolved:

https://github.com/ansys/pyfluent/blob/175b514d018bb0ad0301412ae7e27adbd1d4787f/tests/test_tui_api.py#L18-L19

I haven't found the time to investigate and triage this yet, I'm unsure how much of a priority this is.

mkundu1 commented 1 year ago

The test runs fine with Fluent 23.2 and also activating other addon modules works for 24.1. Initial investigation points to an error from a TUI menu execution while loading the fuelcells module.

mkundu1 commented 1 year ago

will be fixed from Fluent side