ansys / pyfluent

Pythonic interface to Ansys Fluent
https://fluent.docs.pyansys.com
MIT License
274 stars 40 forks source link

Bug located in pyfluent #1577

Closed hauke2007 closed 1 year ago

hauke2007 commented 1 year ago

πŸ” Before submitting the issue

🐞 Description of the bug

I am using Pyfluent in Fluent 23.2. After setting up a case. I am writing the cas and dat out. During the runtime I do not receive any issues or error messages, but after reading the cas into the exiting or new fluent session fluent crashes.

solver.file.write(file_type = "case-data", file_name = caseFilename)

image

πŸ“ Steps to reproduce

cannot upload the files because they are not supported

πŸ’» Which operating system are you using?

Windows

πŸ“€ Which ANSYS version are you using?

Version 23.2 Build ID 176

🐍 Which Python version are you using?

3.11

πŸ“¦ Installed packages

PS D:\Git\turbotestsuite> python -m pip freeze
ansys-api-fluent==0.3.5
ansys-api-mapdl==0.5.1
ansys-api-mechanical==0.1.0
ansys-api-meshing-prime==0.1.1
ansys-api-platform-instancemanagement==1.0.0b3
ansys-api-systemcoupling==0.1.0
ansys-dpf-composites==0.2b2
ansys-dpf-core==0.8.0
ansys-dpf-gate==0.3.1
ansys-dpf-gatebin==0.3.1
ansys-dpf-post==0.4.0
ansys-fluent-core==0.12.5
ansys-grantami-bomanalytics==1.1.3
ansys-grantami-bomanalytics-openapi==1.0.0
ansys-grpc-dpf==0.7.1
ansys-mapdl-core==0.64.1
ansys-mapdl-reader==0.52.12
ansys-math-core==0.1.1
ansys-mechanical-core==0.7.1
ansys-meshing-prime==0.3.0
ansys-motorcad-core==0.1.3
ansys-openapi-common==1.2.1
ansys-optislang-core==0.2.0
ansys-platform-instancemanagement==1.0.3
ansys-pythonnet==3.1.0rc1
ansys-seascape==0.2.0
ansys-systemcoupling-core==0.1.3
appdirs==1.4.4
cachetools==5.3.0
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.3
clr-loader==0.2.5
colorama==0.4.6
contourpy==1.0.7
cryptography==40.0.2
cycler==0.11.0
fonttools==4.39.3
geomdl==5.3.1
google-api-core==2.11.0
google-api-python-client==2.86.0
google-auth==2.17.3
google-auth-httplib2==0.1.0
googleapis-common-protos==1.59.0
grpcio==1.54.0
grpcio-status==1.48.2
h5py==3.8.0
httplib2==0.22.0
idna==3.4
imageio==2.28.1
importlib-metadata==6.6.0
kiwisolver==1.4.4
matplotlib==3.7.1
numpy==1.24.3
packaging==23.1
pandas==2.0.1
Pillow==9.5.0
plumbum==1.8.1
protobuf==3.20.3
protoc-gen-swagger==0.1.0
psutil==5.9.5
pyaedt==0.6.70
pyansys==2023.2rc2
pyansys-tools-versioning==0.3.3
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser==2.21
pyflunt==1.0.0
pyiges==0.2.1
pyparsing==3.0.9
pypiwin32==223
pyspnego==0.9.0
python-dateutil==2.8.2
pythonnet==3.0.1
pytwin==0.3.0
pytz==2023.3
pyvista==0.36.1
pywin32==306
PyYAML==6.0
requests==2.29.0
requests-negotiate-sspi==0.5.2
requests-ntlm==1.2.0
rpyc==5.3.0
rsa==4.9
scipy==1.10.1
scooby==0.7.2
six==1.16.0
tqdm==4.65.0
tzdata==2023.3
uritemplate==4.1.1
urllib3==1.26.15
vtk==9.2.6
zipp==3.15.0
seanpearsonuk commented 1 year ago

general issue or case specific?

hauke2007 commented 1 year ago

As far as I can see it it is case specific

seanpearsonuk commented 1 year ago

Given the same Fluent state:

  1. can you write the files OK in Fluent without going through PyFluent?
  2. can you write the files OK in Fluent via the new Python console, using similar commands as in PyFluent?
  3. can you write the files OK via PyFluent if you try to write the case and data files via separate commands?
  4. have you checked solver.file.write.file_type.allowed_values()?
hauke2007 commented 1 year ago

thanks the file seems to be fine before. Somewhere during the setup, something has happened which destroy the case without creating an error I will try to identify the particular script part and come back to you

hauke2007 commented 1 year ago

the case is broken after the following command. solver.tui.mesh.modify_zones.make_periodic(peri_interface, bz_interfaces_periodic_names.get(peri_interface), 'yes', 'yes')

seanpearsonuk commented 1 year ago

Can you break it just the same if the above Python call is just a TUI invocation like /mesh/modify-zones/... etc ? Trying to dig into whether there is something special about PyFluent here. Also, does bz_interfaces_periodic_names.get(peri_interface) provide data in the right format - that's something you could check.

hauke2007 commented 1 year ago

Hello Sean, after some further debugging we found out that an invalid expression caused the crash after setting up the periodic boundary conditions. Strange is that the periodic boundary conditions and with it the crash is effect by an invalid expression. Overall I think it is not an python issue anymore but really hard to debug. Sorry for bothering

hauke2007 commented 1 year ago

invalid boundary condition yields to the strange behavior but it is a general issue.

seanpearsonuk commented 1 year ago

Hello Sean, after some further debugging we found out that an invalid expression caused the crash after setting up the periodic boundary conditions. Strange is that the periodic boundary conditions and with it the crash is effect by an invalid expression. Overall I think it is not an python issue anymore but really hard to debug. Sorry for bothering

no problem!