Closed lord644 closed 6 months ago
Hello pyFluent team, do you need extra information to fix this issue or may I have missed something ?
I can reproduce this error in latest Fluent/PyFluent. We need to investigate/fix this on the Fluent side. For a workaround, you can write the mesh from a CPU meshing session and read it is a GPU solver session.
Thank you Mainak, so I ended up replacing the switch to solver call like this
##########################################################
meshing.exit() solver = pyfluent.launch_fluent( precision="double", processor_count=4, show_gui=True, gpu=True, mode="solver", ) solver.file.read(file_type="mesh", file_name="C:/Users/mathieu/AppData/Local/Ansys/ansys_fluent_core/examples/wing.msh.h5") ..... #############################################################
As you said the solver call can now make use of GPU acceleration. I still have 2 questions:
1. Regarding that specific external_compressible_flow.py example the script ends like this: ###############################################################################
external_compressible1.cas.h5
.solver.file.write(file_name="external_compressible.cas.h5", file_type="case")
###############################################################################
solver.solution.run_calculation.iterate(iter_count=25)
###############################################################################
solver.file.write(file_name="external_compressible1.cas.h5", file_type="case") #################################################################################
As far as I understand the first call to solver.file.write saves both mesh and problem description and the second is supposed to store both the case and results. But I notice that both external_compressible.cas.h5 and external_compressible1.cas.h5 have the same size on disk, so I assume that the result isn't saved.
@lord644 Right, the command for saving case and data is
solver.file.write(file_name="external_compressible1.cas.h5", file_type="case-data")
or
solver.file.write_case_data(file_name="external_compressible1.cas.h5") # preferred
The above call will write both external_compressible1.cas.h5 and external_compressible1.dat.h5.
Feel free to fork the repo and create a PR. You can find the general contribution guidelines here.
Is there a way to follow the state of that issue, here or on the fluent side ?
Please use the current issue for tracking purpose.
Fluent bug id - 1023325
This will be fixed in Fluent version 2024 R2
π Before submitting the issue
π Description of the bug
Hello again, I have recently update Fluent solver to 2024R1 as well as ansys-fluent-core to 0.19.2 and Python to 3.11.8. I still have an issue running External Compressible Flow script with gpu=True.
########################################################### .... Mesh is now scaled to meters.
Error: invalid command Error Object: "solve"
Error: invalid command Error Object: "solve" Warning: Pressure far-field boundary condition can only be used with ideal gas law. Please change either the boundary condition type or enable ideal gas law. Solver cannot proceed until this is fixed. Traceback (most recent call last): File "c:\Users\mathieu\Documents\Experiments\fluent\external_compressible_flow.py", line 228, in solver = meshing.switch_to_solver() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\mathieu\miniconda3\envs\pyfluent\Lib\site-packages\ansys\fluent\core\session_meshing.py", line 33, in self.switch_to_solver = lambda: self._switch_to_solver() ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\mathieu\miniconda3\envs\pyfluent\Lib\site-packages\ansys\fluent\core\session_meshing.py", line 37, in _switch_to_solver self.tui.switch_to_solution_mode("yes") File "C:\Users\mathieu\miniconda3\envs\pyfluent\Lib\site-packages\ansys\fluent\core\meshing\tui_241.py", line 55, in switch_to_solution_mode return PyMenu(self._service, self._version, self._mode, "/switch_to_solution_mode").execute(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\mathieu\miniconda3\envs\pyfluent\Lib\site-packages\ansys\fluent\core\services\datamodel_tui.py", line 243, in execute return self._service.execute_command(self._path, args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\mathieu\miniconda3\envs\pyfluent\Lib\site-packages\ansys\fluent\core\services\datamodel_tui.py", line 161, in execute_command return self._impl.execute_command(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\mathieu\miniconda3\envs\pyfluent\Lib\site-packages\ansys\fluent\core\services\error_handler.py", line 15, in func raise RuntimeError(ex.details()) from None RuntimeError: invalid command Error Object: solve
##############################################
What can I do to fix it ?
π Steps to reproduce
Activate gpu in python script (l.62) https://fluent.docs.pyansys.com/version/stable/_downloads/b8aa6db4291033ee466dd4c2737e1e8d/external_compressible_flow.py
i.e.
meshing = pyfluent.launch_fluent( precision="double", processor_count=4, gpu=True, mode="meshing", )
π» Which operating system are you using?
Windows
π Which ANSYS version are you using?
Fluent 2024R1
π Which Python version are you using?
3.11
π¦ Installed packages