{
"name": "FileNotFoundError",
"message": "[Errno 2] No such file or directory: 'C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\Temp\\\\pyfluent.server'",
"stack": "---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[6], line 3
1 fluent_file_info = wb.start_fluent_server(\"FFF\")
2 print(fluent_file_info)
----> 3 fluent = pyfluent.connect_to_fluent(server_info_file_name=fluent_file_info)
6 # system_name = \"FFF\"
7 # server_info_file_name = wb.run_script_string(\"\
\".join(
8 # [\"import json\",
(...)
13 # print(server_file)
14 # fluent = pyfluent.connect_to_fluent(server_info_file_name=server_file.absolute() )
File c:\\Users\\User\\Ansys\\Lib\\site-packages\\ansys\\fluent\\core\\launcher\\launcher.py:356, in connect_to_fluent(ip, port, cleanup_on_exit, start_transcript, server_info_file_name, password, start_watchdog)
305 def connect_to_fluent(
306 ip: Optional[str] = None,
307 port: Optional[int] = None,
(...)
312 start_watchdog: Optional[bool] = None,
313 ) -> Union[Meshing, PureMeshing, Solver, SolverIcing]:
314 \"\"\"Connect to an existing Fluent server instance.
315
316 Parameters
(...)
354 Session object.
355 \"\"\"
--> 356 ip, port, password = _get_server_info(server_info_file_name, ip, port, password)
357 fluent_connection = FluentConnection(
358 ip=ip,
359 port=port,
(...)
362 start_transcript=start_transcript,
363 )
364 new_session = _get_running_session_mode(fluent_connection)
File c:\\Users\\User\\Ansys\\Lib\\site-packages\\ansys\\fluent\\core\\launcher\\server_info.py:42, in _get_server_info(server_info_file_name, ip, port, password)
40 else:
41 if server_info_file_name:
---> 42 ip, port, password = _parse_server_info_file(server_info_file_name)
43 ip = ip or os.getenv(\"PYFLUENT_FLUENT_IP\", \"127.0.0.1\")
44 port = port or os.getenv(\"PYFLUENT_FLUENT_PORT\")
File c:\\Users\\User\\Ansys\\Lib\\site-packages\\ansys\\fluent\\core\\session.py:38, in _parse_server_info_file(file_name)
37 def _parse_server_info_file(file_name: str):
---> 38 with open(file_name, encoding=\"utf-8\") as f:
39 lines = f.readlines()
40 ip_and_port = lines[0].strip().split(\":\")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\Temp\\\\pyfluent.server'"
}
It seems we're deleting the local copy and returning it ?? in launcher pyworkbench/src/ansys/workbench/core
/workbench_client.py
def start_fluent_server(self, system_name):
"""Start the PyFluent server for the given system in the Workbench project. ... """
)
_local_copy = os.path.join(self.workdir, server_info_file_name)
if os.path.exists(local_copy):
os.remove(localcopy)
self.download_file(server_info_file_name, show_progress=False)
return local_copy
š Steps to reproduce
basic code
import ansys.fluent.core as pyfluent
from pathlib import Path
from ansys.workbench.core import launch_workbench
wb_script_file = Path("./modules/wbScript.txt") # system with fluent setup
wb = launch_workbench(release="241")
wb.run_script_file(wb_script_file.absolute())
š Before submitting the issue
š Description of the bug
Server file not found for Fluent.
It seems we're deleting the local copy and returning it ?? in launcher pyworkbench/src/ansys/workbench/core /workbench_client.py def start_fluent_server(self, system_name): """Start the PyFluent server for the given system in the Workbench project. ... """ ) _local_copy = os.path.join(self.workdir, server_info_file_name) if os.path.exists(local_copy): os.remove(localcopy) self.download_file(server_info_file_name, show_progress=False) return local_copy
š Steps to reproduce
basic code
import ansys.fluent.core as pyfluent from pathlib import Path from ansys.workbench.core import launch_workbench
wb_script_file = Path("./modules/wbScript.txt") # system with fluent setup wb = launch_workbench(release="241") wb.run_script_file(wb_script_file.absolute())
fluent_file_info = wb.start_fluent_server("FFF") print(fluent_file_info) fluent = pyfluent.connect_to_fluent(server_info_file_name=fluent_file_info)
š» Which operating system are you using?
Windows
š Which ANSYS version are you using?
v241
š Which Python version are you using?
3.12
š¦ Installed packages