ansys / pyfluent

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

Dictionary initialize of objects not valid #2627

Closed millerj97 closed 7 months ago

millerj97 commented 7 months ago

🔍 Before submitting the issue

🐞 Description of the bug

Some objects accessed by dictionary are no longer working in pyfluent standalone session and give the following error;

session.setup.boundary_conditions.wall["wall-pad-disc2"] = {
    "thermal": {"q_dot": {"value": 2000... 000000}, "wall_thickness": {"value": 0.002}}
}... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "v242/commonfiles/CPython/3_10/linx64/Release/python/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1746, in __setitem__
    child.set_state(value)
  File "v242/commonfiles/CPython/3_10/linx64/Release/python/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 689, in set_state
    state = self._unalias(kwargs or state)
  File "v242/commonfiles/CPython/3_10/linx64/Release/python/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 674, in _unalias
    ret[k] = ccls._unalias(v)
  File "v243/commonfiles/CPython/3_10/linx64/Release/python/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 673, in _unalias
    ccls = cls._child_classes[k]
KeyError: 'wall_thickness'

📝 Steps to reproduce

session.file.read_case(file_name="brake.msh") session.setup.models.energy = {"enabled": True} session.setup.general.solver.time = "unsteady-2nd-order-bounded" session.setup.materials.database.copy_by_name(type="solid", name="steel") session.setup.boundary_conditions.wall["wall-pad-disc2"] = { "thermal": {"q_dot": {"value": 2000000000}, "wall_thickness": {"value": 0.002}} }

 - see above error message
 - run for few iterations and run command

session.results.graphics.contour["contour-1"] = {}

 - no error is presented
 - run command and see error:

session.results.graphics.lic["lic-1"] = {}

[dict_case.zip](https://github.com/ansys/pyfluent/files/14774685/dict_case.zip)

### 💻 Which operating system are you using?

Linux

### 📀 Which ANSYS version are you using?

v242

### 🐍 Which Python version are you using?

3.10

### 📦 Installed packages

```shell
absl-py==2.1.0
ansys-api-fluent==0.3.22
ansys-api-platform-instancemanagement==1.0.0
ansys-fluent-core @ file:///home/staff/jomiller/.venv/pyfluent
ansys-fluent-parametric @ file:///home/staff/jomiller/.venv/pyfluent-parametric
ansys-fluent-visualization @ file:///home/staff/jomiller/.venv/pyfluent-visualization
ansys-platform-instancemanagement==1.1.2
asttokens==2.4.1
astunparse==1.6.3
bcrypt==4.1.2
beartype==0.17.1
blinker==1.7.0
cachetools==5.3.2
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
contourpy==1.2.0
cryptography==42.0.2
cycler==0.12.1
dash==2.15.0
dash-bootstrap-components==1.5.0
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-table==5.0.0
decorator==5.1.1
docker==7.0.0
et-xmlfile==1.1.0
exceptiongroup==1.2.0
executing==2.0.1
Flask==3.0.2
flatbuffers==23.5.26
fonttools==4.48.1
gast==0.5.4
google-auth==2.27.0
google-auth-oauthlib==1.2.0
google-pasta==0.2.0
grpcio==1.60.1
grpcio-health-checking==1.48.2
h5py==3.10.0
idna==3.6
imageio==2.34.0
importlib-metadata==7.0.1
iniconfig==2.0.0
ipython==8.21.0
itsdangerous==2.1.2
jedi==0.19.1
Jinja2==3.1.3
joblib==1.3.2
kaleido==0.2.1
keras==2.15.0
kiwisolver==1.4.5
libclang==16.0.6
lxml==5.1.0
Markdown==3.5.2
MarkupSafe==2.1.5
matplotlib==3.8.2
matplotlib-inline==0.1.6
ml-dtypes==0.2.0
nest-asyncio==1.6.0
numpy==1.26.4
oauthlib==3.2.2
openpyxl==3.1.2
opt-einsum==3.3.0
packaging==23.2
pandas==2.2.0
paramiko==3.4.0
paramiko-expect==0.3.5
parso==0.8.3
pexpect==4.9.0
pillow==10.2.0
platformdirs==4.2.0
plotly==5.18.0
pluggy==1.4.0
pooch==1.8.0
prompt-toolkit==3.0.43
protobuf==3.20.3
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
Pygments==2.17.2
PyNaCl==1.5.0
pyparsing==3.1.1
PySide6==6.6.1
PySide6-Addons==6.6.1
PySide6-Essentials==6.6.1
pytest==8.0.0
python-dateutil==2.8.2
python-pptx==0.6.23
pytz==2024.1
pyvista==0.43.3
pyvistaqt==0.11.0
PyYAML==6.0.1
QtPy==2.4.1
requests==2.31.0
requests-oauthlib==1.3.1
retrying==1.3.4
rsa==4.9
scikit-learn==1.4.0
scipy==1.12.0
scooby==0.9.2
seaborn==0.13.2
shiboken6==6.6.1
six==1.16.0
stack-data==0.6.3
tenacity==8.2.3
tensorboard==2.15.2
tensorboard-data-server==0.7.2
tensorflow==2.15.0.post1
tensorflow-estimator==2.15.0
tensorflow-io-gcs-filesystem==0.36.0
termcolor==2.4.0
threadpoolctl==3.2.0
tomli==2.0.1
traitlets==5.14.1
typing_extensions==4.9.0
tzdata==2024.1
urllib3==2.2.0
vtk==9.3.20230807rc0
wcwidth==0.2.13
Werkzeug==3.0.1
wrapt==1.14.1
xgboost==2.0.3
XlsxWriter==3.1.9
zipp==3.17.0
2to3==1.0
absl-py==2.1.0
ansys-api-fluent==0.3.22
ansys-api-platform-instancemanagement==1.0.0
ansys-fluent-core==0.20.dev12
ansys-fluent-parametric @ file:///home/staff/jomiller/.venv/pyfluent-parametric
ansys-fluent-visualization @ file:///home/staff/jomiller/.venv/pyfluent-visualization
ansys-hpcservices-file-management-v1==23.1.2311.26
ansys-hpcservices-file-transfer-v1==23.1.2311.26
ansys-hpcservices-global-permission-v1==23.1.2311.26
ansys-hpcservices-hardware-configuration-clusters-v1==23.1.2311.26
ansys-hpcservices-hardware-configuration-endpoints-v1==23.1.2311.26
ansys-hpcservices-hardware-configuration-queues-v1==23.1.2311.26
ansys-hpcservices-hardware-configuration-storages-v1==23.1.2311.26
ansys-hpcservices-job-management-jobs-v1==23.1.2311.26
ansys-hpcservices-job-management-logs-v1==23.1.2311.26
ansys-hpcservices-job-management-templates-v1==23.1.2311.26
ansys-hpcservices-service-management-v1==23.1.2311.26
ansys-hpcservices-user-management-v1==23.1.2311.26
ansys-platform-instancemanagement==1.1.2
ansys-pythonnet==3.1.0rc0
ansys-units==0.3.2
asttokens==2.4.1
astunparse==1.6.3
attrs==23.2.0
bcrypt==4.1.2
beartype==0.17.2
blinker==1.7.0
certifi==2023.11.17
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
clr-loader==0.2.6
contourpy==1.2.0
cryptography==42.0.5
cycler==0.12.1
dash==2.16.1
dash-bootstrap-components==1.5.0
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-table==5.0.0
decorator==5.1.1
distro==1.9.0
docker==6.1.3
et-xmlfile==1.1.0
exceptiongroup==1.2.0
execnet==2.0.2
executing==2.0.1
Flask==3.0.2
flatbuffers==24.3.25
fonttools==4.50.0
future==0.18.0
gast==0.5.4
google-pasta==0.2.0
googleapis-common-protos==1.52.0
grpcio==1.62.1
grpcio-health-checking==1.48.1
grpcio-status==1.26.0
h5py==3.10.0
idna==3.6
imageio==2.34.0
importlib_metadata==7.1.0
iniconfig==2.0.0
ipython==8.22.2
itsdangerous==2.1.2
jedi==0.19.1
Jinja2==3.1.3
joblib==1.3.2
kaleido==0.2.1
keras==3.1.1
kiwisolver==1.4.5
libclang==18.1.1
llvmlite==0.39.1
lxml==4.9.4
Markdown==3.6
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.8.3
matplotlib-inline==0.1.6
mdurl==0.1.2
ml-dtypes==0.3.2
namex==0.0.7
nest-asyncio==1.6.0
numba==0.56.4
numpy==1.23.5
openpyxl==3.1.2
opt-einsum==3.3.0
optree==0.11.0
packaging==24.0
pandas==1.5.3
paramiko==3.4.0
paramiko-expect==0.3.5
parso==0.8.3
pexpect==4.9.0
pillow==10.2.0
platformdirs==3.11.0
plotly==5.20.0
pluggy==1.4.0
pooch==1.8.1
prompt-toolkit==3.0.43
protobuf==4.25.3
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
py==1.11.0
pybind11==2.10.0
pycparser==2.21
Pygments==2.17.2
PyNaCl==1.5.0
pyparsing==3.1.2
PySide6==6.6.3
PySide6_Addons==6.6.3
PySide6_Essentials==6.6.3
pytest==7.2.1
pytest-forked==1.6.0
pytest-xdist==1.31.0
python-certifi-win32==1.6.1
python-dateutil==2.9.0.post0
python-pptx==0.6.23
pytz==2024.1
pyvista==0.43.4
pyvistaqt==0.11.0
PyYAML==6.0.1
QtPy==2.4.1
requests==2.31.0
retrying==1.3.4
rich==13.7.1
scikit-learn==1.4.1.post1
scipy==1.9.3
SCons==4.0.1
scooby==0.9.2
seaborn==0.13.2
setuptools-scm==8.0.4
shapely==2.0.2
shiboken6==6.6.3
sip==6.5.1
six==1.16.0
stack-data==0.6.3
tenacity==8.2.3
tensorboard==2.16.2
tensorboard-data-server==0.7.2
tensorflow==2.16.1
tensorflow-io-gcs-filesystem==0.36.0
termcolor==2.4.0
threadpoolctl==3.4.0
toml==0.10.2
tomli==2.0.1
traitlets==5.14.2
typing_extensions==4.10.0
tzdata==2024.1
urllib3==1.26.10
vtk==9.3.20230807rc0
wcwidth==0.2.13
websocket-client==1.7.0
Werkzeug==3.0.1
wrapt==1.16.0
wxPython==4.1.1
xgboost==2.0.3
XlsxWriter==3.2.0
zipp==3.18.1
millerj97 commented 7 months ago

@cj-hodgson @mkundu1 @answillgm issue affects regression

mkundu1 commented 7 months ago

@millerj97 what is the version of PyFluent?

millerj97 commented 7 months ago

@mkundu1 0.20.dev12

mkundu1 commented 7 months ago

I'm looking into the issue with

session.setup.boundary_conditions.wall["wall-pad-disc2"] = {
    "thermal": {"q_dot": {"value": 2000... 000000}, "wall_thickness": {"value": 0.002}}
}

The issue is present in legacy pyconsole, new pyconsole and standalone pyfluent.

The issue with

session.results.graphics.lic["lic-1"] = {}

is present only in standalone pyfluent.

mkundu1 commented 7 months ago

The issue with

session.results.graphics.lic["lic-1"] = {}

is pending now. The other issue has been fixed in main branch.

mkundu1 commented 7 months ago

I found a way to reproduce the lic creation issue in Fluent's pyconsole. I'll create defect there.

mkundu1 commented 7 months ago

Closing this as a Fluent issue is opened now.

mkundu1 commented 6 months ago

The Fluent side issue is fixed in 24.2.