Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors related to monitors #2188

Closed
2 tasks done
tejalprabhu01 opened this issue Nov 1, 2023 · 3 comments · Fixed by #2193
Closed
2 tasks done

Errors related to monitors #2188

tejalprabhu01 opened this issue Nov 1, 2023 · 3 comments · Fixed by #2193
Assignees
Labels
bug Something isn't working

Comments

@tejalprabhu01
Copy link
Collaborator

tejalprabhu01 commented Nov 1, 2023

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

A customer reported following errors while using pyfluent from Fluent nodes in optiSLang:
image002
image003
image001

@seanpearsonuk @ajain-work

📝 Steps to reproduce

Unfortunately I donot know which command leads to this, since it was reproduced on the customer machine. If more information is required, Please let me know.

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

2023R2

🐍 Which Python version are you using?

3.10

📦 Installed packages

ansys-fluent-core
@tejalprabhu01 tejalprabhu01 added the bug Something isn't working label Nov 1, 2023
@seanpearsonuk
Copy link
Collaborator

Thank you for submitting this, @tejalprabhu01.

Yes, for the customer's sake, if they can provide the ful details, it will help in finding a solution.

@hpohekar
Copy link
Collaborator

hpohekar commented Nov 2, 2023

@seanpearsonuk @tejalprabhu01

I have investigated it now.

The primary guess is that the user has either not read data file or not called iterate() before executing methods of solver_session.monitors_manager.

e.g

solver_session.monitors_manager.get_monitor_set_names()
solver_session.monitors_manager.get_monitor_set_data(monitor_set_name="residual")

Normal solver session

>>> import ansys.fluent.core as pyfluent
>>> from ansys.fluent.core import examples
>>> import_case = examples.download_file(file_name="exhaust_system.cas.h5", directory="pyfluent/exhaust_system")
Checking if specified file already exists...
File already exists. File path:
C:\Users\hpohekar\AppData\Local\Ansys\ansys_fluent_core\examples\exhaust_system.cas.h5
>>> import_data = examples.download_file(file_name="exhaust_system.dat.h5", directory="pyfluent/exhaust_system")
Checking if specified file already exists...
File already exists. File path:
C:\Users\hpohekar\AppData\Local\Ansys\ansys_fluent_core\examples\exhaust_system.dat.h5
>>> solver_session = pyfluent.launch_fluent(precision="double", processor_count=2, start_transcript=False, mode="solver", cleanup_on_exit=False)

Monitors list is empty now.

>>> monitors_list = solver_session.monitors_manager.get_monitor_set_names()
>>> monitors_list
[]

Monitors list is still empty after reading a case file.

>>> solver_session.tui.file.read_case(import_case)                                                                                               
pyfluent.tui WARNING: Currently calling the TUI commands in a generic manner. Please run `python codegen/allapigen.py` from the top-level pyfluent directory to generate the local TUI commands classes.
The following solver settings object method could also be used to execute the above command:
<solver_session>.file.read_case(file_name = r"C:\Users\hpohekar\AppData\Local\Ansys\ansys_fluent_core\examples\exhaust_system.cas.h5")
>>> monitors_list = solver_session.monitors_manager.get_monitor_set_names()
>>> monitors_list
[]

We get monitors list only after reading a data file or after calling iterate() method.

>>> solver_session.tui.file.read_data(import_data)                          
The following solver settings object method could also be used to execute the above command:
<solver_session>.file.read_data(file_name = r"C:\Users\hpohekar\AppData\Local\Ansys\ansys_fluent_core\examples\exhaust_system.dat.h5")
>>> monitors_list = solver_session.monitors_manager.get_monitor_set_names()
>>> monitors_list
['residual', 'mass-bal-rplot', 'mass-tot-rplot', 'mass-in-rplot', 'point-vel-rplot']

calling iterate() method.

>>> solver_session.tui.solve.set.number_of_iterations(15)
The following solver settings object method could also be used to execute the above command:
<solver_session>.solution.run_calculation.iter_count = 15
>>> solver_session.tui.solve.iterate()
The following solver settings object method could also be used to execute the above command:
<solver_session>.solution.run_calculation.iterate(iter_count = 15)
>>> solver_session.monitors_manager.get_monitor_set_names()
['residual', 'mass-bal-rplot', 'mass-tot-rplot', 'mass-in-rplot', 'point-vel-rplot']

I also verified following source code behavior (shared by user in 1st screenshot). It's working fine.

image

>>> for monitor_set_name, monitor_set_info in solver_session.monitors_manager._monitors_info.items():
...     print(monitor_set_info["monitors"])                                
... 
['continuity', 'x-velocity', 'y-velocity', 'z-velocity', 'energy', 'k', 'omega']
['mass-bal']
['mass-tot']
['mass-in']
['point-vel']
>>>

@hpohekar
Copy link
Collaborator

hpohekar commented Nov 2, 2023

@seanpearsonuk @tejalprabhu01

@ajain-work and I tried to reproduce this bug and we are able to reproduce this.

It's resolved now.

We will create a PR soon.

Thank you.

hpohekar added a commit that referenced this issue Nov 2, 2023
@hpohekar hpohekar linked a pull request Nov 2, 2023 that will close this issue
@hpohekar hpohekar self-assigned this Nov 2, 2023
hpohekar added a commit that referenced this issue Nov 2, 2023
hpohekar added a commit that referenced this issue Nov 2, 2023
hpohekar added a commit that referenced this issue Nov 2, 2023
* Fix for #2188

* test for #2188

* test for #2188

* test for 232 and 241
@github-project-automation github-project-automation bot moved this from Prioritised to In progress in PyFluent Public Roadmap Nov 2, 2023
raph-luc pushed a commit that referenced this issue Nov 14, 2023
* Fix for #2188

* test for #2188

* test for #2188

* test for 232 and 241
raph-luc pushed a commit that referenced this issue Nov 15, 2023
* Fix for #2188

* test for #2188

* test for #2188

* test for 232 and 241
@seanpearsonuk seanpearsonuk moved this from In progress to Done in PyFluent Public Roadmap Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 2021-2024
Development

Successfully merging a pull request may close this issue.

4 participants