ansys / pysystem-coupling

Python API to System Coupling
https://systemcoupling.docs.pyansys.com/
MIT License
7 stars 4 forks source link

Need operation to clear System Coupling session #276

Closed ochernuk closed 4 months ago

ochernuk commented 5 months ago

🔍 Before submitting the issue

🐞 Description of the bug

When a participant is added using a session handle:

fluent_name = syc.setup.add_participant(participant_session = fluent_session)

syc object stores the handle internally. There needs to be an operation to clear those handles, along with the System Coupling state. Typically, the following command would clear the state:

syc.case.clear_state()

That clears all System Coupling state, but it does not clear the session objects held in PySystemCoupling. Probably the best option is to intercept syc.case.clear_state command and make it reset all the session objects held in PySystemCoupling, as well as the System Coupling state.

📝 Steps to reproduce

Add a Fluent session instance:

fluent_name = syc.setup.add_participant(participant_session = fluent_session)

Confirm that fluent_name is equal to "FLUENT-1"

Clear System Coupling:

syc.case.clear_state()

fluent_name = syc.setup.add_participant(participant_session = fluent_session)

Confirm that fluent_name is still equal to "FLUENT-1", not "FLUENT-2"

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

24.2

🐍 Which Python version are you using?

3.10

📦 Installed packages

n/a
SeunSomefun commented 4 months ago

Fix for this bug is merged