ansys / pyfluent

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

Error in deleting species from mixture template (species transport) #2259

Closed sravanansys closed 4 months ago

sravanansys commented 9 months ago

πŸ” Before submitting the issue

🐞 Description of the bug

I am activating the species transport model and adding additional species to it. But when I am trying to delete the unnecessary species I am getting an error.

`>>> fluent.setup.materials.mixture['mixture-template'].species.volumetric_species.delete(name_list=['o2'])

Error: eval: unbound variable Error Object: name Traceback (most recent call last): File "<pyshell#83>", line 1, in fluent.setup.materials.mixture['mixture-template'].species.volumetric_species.delete(name_list=['o2']) File "D:\sravan\pyansys\pyfluent\src\ansys\fluent\core\solver\flobject.py", line 991, in call return self.flproxy.execute_cmd(self._parent.path, self.obj_name, *newkwds) File "D:\sravan\pyansys\pyfluent\src\ansys\fluent\core\services\settings.py", line 122, in _fn return fn(self, args, **kwds) File "D:\sravan\pyansys\pyfluent\src\ansys\fluent\core\services\settings.py", line 320, in execute_cmd response = self._service_impl.execute_cmd(request) File "D:\sravan\pyansys\pyfluent\src\ansys\fluent\core\services\error_handler.py", line 15, in func raise RuntimeError(ex.details()) from None RuntimeError: eval: unbound variable Error Object: name`

πŸ“ Steps to reproduce

Activate species transport model and try to delete one species from the mixture template.

fluent.setup.models.species.model.option='species-transport' fluent.setup.models.species.options.diffusion_energy_source=False fluent.setup.materials.mixture['mixture-template'].species.volumetric_species.delete(name_list=['o2'])

πŸ’» Which operating system are you using?

Windows

πŸ“€ Which ANSYS version are you using?

2024R1

🐍 Which Python version are you using?

3.9

πŸ“¦ Installed packages

ansys-api-fluent==0.3.18
ansys-api-platform-instancemanagement==1.0.0
-e git+https://github.com/ansys/pyfluent.git@5c81a342aff8cf995babed8011661bd16122265a#egg=ansys_fluent_core
-e git+https://github.com/ansys/pyfluent-visualization.git@b907538e399406d96da587a38d8518697746593d#egg=ansys_fluent_visualization
ansys-platform-instancemanagement==1.1.2
anyio==4.0.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
attrs==23.1.0
Babel==2.13.1
beautifulsoup4==4.12.2
bleach==6.1.0
certifi==2023.7.22
cffi==1.16.0
charset-normalizer==3.3.2
colorama==0.4.6
comm==0.2.0
contourpy==1.2.0
cycler==0.12.1
debugpy==1.8.0
decorator==5.1.1
defusedxml==0.7.1
docker==6.1.3
exceptiongroup==1.1.3
executing==2.0.1
fastjsonschema==2.19.0
fonttools==4.44.0
fqdn==1.5.1
grpcio==1.59.2
grpcio-health-checking==1.48.2
idna==3.4
importlib-metadata==6.8.0
importlib-resources==6.1.1
ipykernel==6.26.0
ipython==8.17.2
ipywidgets==8.1.1
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.2
json5==0.9.14
jsonpointer==2.4
jsonschema==4.19.2
jsonschema-specifications==2023.11.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.9.0
jupyter-lsp==2.2.0
jupyter_client==8.6.0
jupyter_core==5.5.0
jupyter_server==2.10.1
jupyter_server_terminals==0.4.4
jupyterlab==4.0.8
jupyterlab-pygments==0.2.2
jupyterlab-widgets==3.0.9
jupyterlab_server==2.25.1
kiwisolver==1.4.5
lxml==4.9.3
MarkupSafe==2.1.3
matplotlib==3.8.1
matplotlib-inline==0.1.6
mistune==3.0.2
nbclient==0.9.0
nbconvert==7.11.0
nbformat==5.9.2
nest-asyncio==1.5.8
notebook==7.0.6
notebook_shim==0.2.3
numpy==1.26.2
overrides==7.4.0
packaging==23.2
pandas==2.1.3
pandocfilters==1.5.0
parso==0.8.3
Pillow==10.1.0
platformdirs==4.0.0
pooch==1.8.0
prometheus-client==0.18.0
prompt-toolkit==3.0.40
protobuf==3.20.3
psutil==5.9.6
pure-eval==0.2.2
pycparser==2.21
Pygments==2.16.1
pyparsing==3.1.1
PySide6==6.6.0
PySide6-Addons==6.6.0
PySide6-Essentials==6.6.0
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2023.3.post1
pyvista==0.42.3
pyvistaqt==0.11.0
pywin32==306
pywinpty==2.0.12
PyYAML==6.0.1
pyzmq==25.1.1
qtconsole==5.5.1
QtPy==2.4.1
referencing==0.31.0
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.12.0
scooby==0.9.2
Send2Trash==1.8.2
shiboken6==6.6.0
six==1.16.0
sniffio==1.3.0
soupsieve==2.5
stack-data==0.6.3
terminado==0.18.0
tinycss2==1.2.1
tomli==2.0.1
tornado==6.3.3
traitlets==5.13.0
types-python-dateutil==2.8.19.14
typing_extensions==4.8.0
tzdata==2023.3
uri-template==1.3.0
urllib3==2.0.7
vtk==9.3.20230807rc0
wcwidth==0.2.9
webcolors==1.13
webencodings==0.5.1
websocket-client==1.6.4
widgetsnbextension==4.0.9
zipp==3.17.0
ansjsia commented 9 months ago

I am also running into this issue. I find that using del causes the same problems.

mkundu1 commented 4 months ago

As volumetric_species is a named object container, the following code will delete the object inside container:

del fluent.setup.materials.mixture['mixture-template'].species.volumetric_species.delete['o2']

If the above call fails, it would also fail in Fluent/PyConsole, please log a defect in Fluent in that case.