ansys / pyfluent

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

Py Script converted from journal file runs in pyconsole but fails in pyfluent #1957

Closed answillgm closed 1 year ago

answillgm commented 1 year ago

🔍 Before submitting the issue

🐞 Description of the bug

Journal file converted to py file runs normally when ran in fluent pyconsole, however when running in pyfluent the error is thrown:

Error: CDR: invalid argument [1]: wrong type [not a pair] Error Object: #f Traceback (most recent call last): File "D:\PyFluent Regression\PyScript Changes\recreate\spray_tui_s1.py", line 18, in <module> solver.setup.boundary_conditions.mass_flow_inlet['central_air'] = {"momentum" : {"flow_direction" : [0, 0, 1], "coordinate_system" : "Cartesian (X, Y, Z)", "direction_specification" : "Direction Vector", "mass_flow_rate" : {"value" : 9.166999999999999e-05}}, "turbulence" : {"hydraulic_diameter" : 0.0037, "turbulent_intensity" : 0.1, "turbulent_specification" : "Intensity and Hydraulic Diameter"}, "thermal" : {"total_temperature" : {"value" : 293.}}, "species" : {"mf" : {"o2" : {"value" : 0.23}}}} File "E:\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 1088, in __setitem__ child.set_state(value) File "E:\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 262, in set_state return self.flproxy.set_var(self.path, self.to_scheme_keys(state)) File "E:\pyfluent\src\ansys\fluent\core\services\settings.py", line 102, in _fn return fn(self, *args, **kwds) File "E:\pyfluent\src\ansys\fluent\core\services\settings.py", line 168, in set_var self._service_impl.set_var(request) File "E:\pyfluent\src\ansys\fluent\core\services\error_handler.py", line 15, in func raise RuntimeError(ex.details()) from None RuntimeError: CDR: invalid argument [1]: wrong type [not a pair] Error Object: #f

Note that if the "species" arguments on line 18 of the py file are omitted, the error does not occur

📝 Steps to reproduce

  1. Download and extract recreate.zip
  2. Run the script "spray_tui_s1.py" in pyfluent, the above error will be thrown
  3. Run the "spray_tui_s1.py" script in fluent from command line as follows: (path to exe)\fluent.exe 3ddp -gu -t1 -i spray_tui_s1.py -py - the script will run to completion

(The original journal file is also included)

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

24.1

🐍 Which Python version are you using?

3.10

📦 Installed packages

absl-py==1.4.0
ansi2html==1.8.0
ansys-api-fluent==0.3.15
ansys-api-platform-instancemanagement==1.0.0
-e e:\pyfluent
-e e:\pyfluent-parametric
-e e:\pyfluent-visualization
ansys-platform-instancemanagement==1.1.2
asttokens==2.2.1
astunparse==1.6.3
backcall==0.2.0
bcrypt==4.0.1
cachetools==5.3.1
certifi==2023.7.22
cffi==1.15.1
charset-normalizer==3.2.0
click==8.1.7
colorama==0.4.6
contourpy==1.1.0
cryptography==41.0.3
cycler==0.11.0
dash==2.12.1
dash-bootstrap-components==1.4.2
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-table==5.0.0
decorator==5.1.1
docker==6.1.3
et-xmlfile==1.1.0
executing==1.2.0
Flask==2.2.5
flatbuffers==23.5.26
fonttools==4.42.1
gast==0.4.0
google-auth==2.22.0
google-auth-oauthlib==1.0.0
google-pasta==0.2.0
grpcio==1.57.0
grpcio-health-checking==1.48.2
h5py==3.9.0
idna==3.4
imageio==2.31.1
importlib-metadata==6.8.0
ipython==8.14.0
itsdangerous==2.1.2
jedi==0.19.0
Jinja2==3.1.2
joblib==1.3.2
kaleido==0.2.1
keras==2.13.1
kiwisolver==1.4.4
libclang==16.0.6
lxml==4.9.3
Markdown==3.4.4
MarkupSafe==2.1.3
matplotlib==3.7.2
matplotlib-inline==0.1.6
nest-asyncio==1.5.7
numpy==1.24.3
oauthlib==3.2.2
openpyxl==3.1.2
opt-einsum==3.3.0
packaging==23.1
pandas==2.0.3
paramiko==3.3.1
paramiko-expect==0.3.5
parso==0.8.3
pickleshare==0.7.5
Pillow==10.0.0
platformdirs==3.10.0
plotly==5.16.1
pooch==1.7.0
prompt-toolkit==3.0.39
protobuf==3.20.3
psutil==5.9.5
pure-eval==0.2.2
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser==2.21
Pygments==2.16.1
PyNaCl==1.5.0
pyparsing==3.0.9
PySide6==6.5.2
PySide6-Addons==6.5.2
PySide6-Essentials==6.5.2
python-dateutil==2.8.2
python-pptx==0.6.21
pytz==2023.3
pyvista==0.41.1
pyvistaqt==0.11.0
pywin32==306
PyYAML==6.0.1
QtPy==2.3.1
requests==2.31.0
requests-oauthlib==1.3.1
retrying==1.3.4
rsa==4.9
scikit-learn==1.3.0
scipy==1.11.2
scooby==0.7.2
seaborn==0.12.2
shiboken6==6.5.2
six==1.16.0
stack-data==0.6.2
tenacity==8.2.3
tensorboard==2.13.0
tensorboard-data-server==0.7.1
tensorflow==2.13.0
tensorflow-estimator==2.13.0
tensorflow-intel==2.13.0
tensorflow-io-gcs-filesystem==0.31.0
termcolor==2.3.0
threadpoolctl==3.2.0
traitlets==5.9.0
typing_extensions==4.5.0
tzdata==2023.3
urllib3==1.26.16
vtk==9.2.6
wcwidth==0.2.6
websocket-client==1.6.2
Werkzeug==2.2.3
wrapt==1.15.0
xgboost==1.7.6
XlsxWriter==3.1.2
zipp==3.16.2
mkundu1 commented 1 year ago

This should be fixed now. Please test with the latest Fluent 24.1.