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 while reading case-data in standalone launch mode #2753

Closed
mkundu1 opened this issue Apr 30, 2024 · 1 comment · Fixed by #2765
Closed

Errors while reading case-data in standalone launch mode #2753

mkundu1 opened this issue Apr 30, 2024 · 1 comment · Fixed by #2765
Assignees
Labels
bug Something isn't working

Comments

@mkundu1
Copy link
Contributor

mkundu1 commented Apr 30, 2024

I'm seeing 2 different errors while reading case-data in standalone launch mode:

  1. I have elbow.cas.h5 and elbow.dat.h5 in pwd.
>>> import ansys.fluent.core as pyfluent
>>> solver = pyfluent.launch_fluent()
>>> solver.file.read_case_data(file_name="elbow.cas.h5")          
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 1588, in __call__
    return self.execute_command(**kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 1547, in execute_command
    if argument.before_execute(value):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 375, in before_execute
    self._do_before_execute(value)
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 803, in _do_before_execute
    self.file_transfer_service.upload(file_name=value)
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\utils\file_transfer_service.py", line 86, in upload
    shutil.copyfile(
  File "C:\Users\mkundu\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 236, in copyfile
    raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: 'elbow.cas.h5' and 'D:\\ANSYSDev\\PyFluentDev\\pyfluent\\elbow.cas.h5' are the same file
  1. I don't have elbow.cas.h5 and elbow.dat.h5 in pwd. They are in d:\work.
>>> import ansys.fluent.core as pyfluent
>>> solver = pyfluent.launch_fluent()    
>>> solver.file.read_case_data(file_name=r"D:\work\elbow.cas.h5")
Fast-loading "D:\ANSYSDev\vNNN\fluent\fluent24.2\\addons\afd\lib\hdfio.bin"
Done.

AAPAomeLhXO1rdt has other FLUENT parallel processes running.                       Process affinity not being set.

Reading from AAPAomeLhXO1rdt:"D:\ANSYSDev\PyFluentDev\pyfluent\elbow.cas.h5" in NODE0 mode ...
  Reading mesh ...
       45637 cells,     1 cell zone  ...
          45637 tetrahedral cells,  zone id: 2
       94288 faces,     5 face zones ...
           5584 triangular wall faces,  zone id: 3
            216 triangular pressure-outlet faces,  zone id: 4
             12 triangular velocity-inlet faces,  zone id: 5
            216 triangular velocity-inlet faces,  zone id: 6
          88260 triangular interior faces,  zone id: 8
        9203 nodes,     1 node zone  ...
  Done.


Building...
     mesh
     materials,
     interface,
     domains,
        mixture
     zones,
        default-interior
        inlet1
        inlet2
        outlet
        wall
        fluid
     parallel,
Done.

Error: File "elbow.dat.h5" not found!
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 1588, in __call__
Error Object: #f
    return self.execute_command(**kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 1549, in execute_command
Error: File "elbow.dat.h5" not found!
    ret = self._execute_command(*args, **kwds)
Error Object: #f
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 1584, in _execute_command
    return self.flproxy.execute_cmd(self._parent.path, self.obj_name, **newkwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\services\settings.py", line 124, in _fn
    return fn(self, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\services\settings.py", line 329, in execute_cmd
    response = self._service_impl.execute_cmd(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\services\settings.py", line 91, in execute_cmd
    return self.__stub.ExecuteCommand(request, metadata=self.__metadata)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mkundu\AppData\Local\Programs\Python\Python311\Lib\site-packages\grpc\_interceptor.py", line 277, in __call__
    response, ignored_call = self._with_call(
                             ^^^^^^^^^^^^^^^^
  File "C:\Users\mkundu\AppData\Local\Programs\Python\Python311\Lib\site-packages\grpc\_interceptor.py", line 329, in _with_call
    call = self._interceptor.intercept_unary_unary(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\services\interceptors.py", line 122, in intercept_unary_unary
    return self._intercept_call(continuation, client_call_details, request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\services\interceptors.py", line 112, in _intercept_call
    raise ex from None
RuntimeError: File "elbow.dat.h5" not found!
Error Object: #f

Error 2 goes away if I copy d:\work\elbow.dat.h5 to pwd and execute read_case_data again.

Both of these were working before and work in pyconsole. I think it is better to avoid the file-transfer service in standalone launch mode for now.

@mkundu1 mkundu1 added the bug Something isn't working label Apr 30, 2024
@mkundu1
Copy link
Contributor Author

mkundu1 commented May 1, 2024

Similar issue while downloading file in standalone mode:

>>> solver.results.graphics.picture.save_picture(file_name="contour_gu_pyfl")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 1588, in __call__
    return self.execute_command(**kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 1552, in execute_command
    argument.after_execute(value)
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 383, in after_execute
    self._do_after_execute(value)
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 809, in _do_after_execute
    self.file_transfer_service.download(file_name=value)
  File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\utils\file_transfer_service.py", line 108, in download
    shutil.copyfile(remote_file_name, str(local_file_name))
  File "C:\Users\mkundu\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 256, in copyfile
    with open(src, 'rb') as fsrc:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\ANSYSDev\\PyFluentDev\\pyfluent\\contour_gu_pyfl'

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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants