ansys / pyfluent

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

Setting Monte Carlo multiband band order using dictionary results in random crashes #2182

Open ansjsia opened 1 year ago

ansjsia commented 1 year ago

🔍 Before submitting the issue

🐞 Description of the bug

When using the Monte Carlo multiband (non-grey) radiation model, setting the bands using a dictionary results in the bands being set in Fluent in random order. If the bands happen to not be in order of increasing wavelength, attempting a solve results in Fluent stalling with the following error:

Error at Node 0: Spectral bands do not fill the spectrum.
Void/overlap found in spectral bands.

Error: error: wta[1](string)
Error Object: ()

Setting the bands one at a time in order is a workaround.

📝 Steps to reproduce

See attached the following files to reproduce this bug: multiband_bug_test_files.zip

Description of contents:

Steps to reproduce:

  1. Launch a Fluent solver session. Ensure that show_gui=True.
  2. Load any mesh.
  3. Set up the Monte Carlo radiation model
  4. Set bands all at once using a dictionary, e.g.:
    solver.setup.models.radiation.multiband = {
    'solar': {
        'start': 0,
        'end': 2.8,
    },
    'thermal-ir': {
        'start': 2.8,
        'end': 50,
    },
    }
  5. Check the radiation model dialog box in the GUI*. If the bands are not in order of increasing wavelength (solar first, then thermal-ir), the next step will not be successful.
  6. Attempt a solve.

To avoid this bug, the workaround is to change Step 4:

  1. Set bands one at a time, e.g.:
    models = solver.setup.models.radiation
    radiation.multiband['solar'] = {
    'start': 0,
    'end': 2.8,
    }
    radiation.multiband['thermal-ir'] = {
    'start': 2.8,
    'end': 50,
    }

* Note: This must be checked in the GUI. Calling solver.setup.models.radiation.multiband.get_state() returns a dictionary with the bands in a random order that does not correspond to the order of the bands in Fluent's datamodel.

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

24R1, build ID: 168

🐍 Which Python version are you using?

3.11

📦 Installed packages

accessible-pygments==0.0.4
alabaster==0.7.13
ansys-api-fluent==0.3.18
ansys-api-platform-instancemanagement==1.0.0
ansys-api-systemcoupling==0.1.0
-e git+https://github.com/ansys/pyfluent.git@487a8acb74d66fe87358687992237195c2ca99c7#egg=ansys_fluent_core
ansys-platform-instancemanagement==1.1.2
ansys-sphinx-theme==0.10.2
-e git+https://github.com/ansys/pysystem-coupling.git@82e50fe7c81a1d59c888df28a99760e4b64bb614#egg=ansys_systemcoupling_core
anyio==4.0.0
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
astropy==5.3.4
asttokens==2.4.0
async-lru==2.0.4
attrs==23.1.0
autodocsumm==0.2.11
Babel==2.12.1
backcall==0.2.0
beautifulsoup4==4.12.2
bleach==6.0.0
cattrs==23.1.2
certifi==2023.7.22
cffi==1.15.1
cfgv==3.4.0
charset-normalizer==3.2.0
colorama==0.4.6
comm==0.1.4
contourpy==1.1.0
cycler==0.11.0
debugpy==1.7.0
decorator==5.1.1
defusedxml==0.7.1
distlib==0.3.7
doc8==1.1.1
docker==6.1.3
docutils==0.20.1
esbonio==0.16.1
executing==1.2.0
fastjsonschema==2.18.0
filelock==3.12.3
fonttools==4.42.1
fqdn==1.5.1
googleapis-common-protos==1.61.0
grpcio==1.58.0
grpcio-health-checking==1.48.2
grpcio-status==1.48.2
h5py==3.9.0
identify==2.5.27
idna==3.4
imagesize==1.4.1
importlib-metadata==6.8.0
iniconfig==2.0.0
ipykernel==6.25.2
ipympl==0.9.3
ipython==8.15.0
ipython-genutils==0.2.0
ipywidgets==8.1.0
isoduration==20.11.0
jedi==0.19.0
Jinja2==3.1.2
jplephem==2.19
json5==0.9.14
jsonpointer==2.4
jsonschema==4.19.0
jsonschema-specifications==2023.7.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.7.0
jupyter-lsp==2.2.0
jupyter-sphinx==0.4.0
jupyter_client==8.3.1
jupyter_core==5.3.1
jupyter_server==2.7.3
jupyter_server_terminals==0.4.4
jupyterlab==4.0.5
jupyterlab-pygments==0.2.2
jupyterlab-widgets==3.0.8
jupyterlab_server==2.24.0
kiwisolver==1.4.5
livereload==2.6.3
lsprotocol==2023.0.0a3
lxml==4.9.3
MarkupSafe==2.1.3
matplotlib==3.7.2
matplotlib-inline==0.1.6
mistune==3.0.1
msgpack-python==0.5.6
nbclient==0.8.0
nbconvert==7.8.0
nbformat==5.9.2
nest-asyncio==1.5.7
nodeenv==1.8.0
notebook==7.0.3
notebook_shim==0.2.3
NotFound==1.0.2
numpy==1.25.2
numpydoc==1.5.0
overrides==7.4.0
packaging==23.1
pandas==2.1.0
pandocfilters==1.5.0
parso==0.8.3
pathlib==1.0.1
pbr==5.11.1
pickleshare==0.7.5
Pillow==10.0.0
platformdirs==3.10.0
pluggy==1.3.0
pre-commit==3.4.0
prometheus-client==0.17.1
prompt-toolkit==3.0.39
protobuf==3.20.3
psutil==5.9.5
pure-eval==0.2.2
pycparser==2.21
pydata-sphinx-theme==0.13.3
pyerfa==2.0.0.3
pygls==1.0.2
Pygments==2.16.1
pypandoc==1.11
pyparsing==3.0.9
pyspellchecker==0.7.2
pytest==7.4.2
pytest-sphinx==0.5.0
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2023.3.post1
pywin32==306
pywinpty==2.0.11
PyYAML==6.0.1
pyzmq==25.1.1
qtconsole==5.4.4
QtPy==2.4.0
referencing==0.30.2
requests==2.31.0
restructuredtext-lint==1.4.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.10.2
scipy==1.11.3
Send2Trash==1.8.2
sgp4==2.22
six==1.16.0
skyfield==1.46
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.5
Sphinx==7.1.2
sphinx-autobuild==2021.3.14
sphinx-autodoc-typehints==1.24.0
sphinx-copybutton==0.5.2
sphinx-gallery==0.13.0
sphinx-notfound-page==0.8.3
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.6
sphinxcontrib-serializinghtml==1.1.9
sphinxcontrib-websupport==1.2.5
sphinxemoji==0.2.0
stack-data==0.6.2
stevedore==5.1.0
terminado==0.17.1
tinycss2==1.2.1
tornado==6.3.3
traitlets==5.9.0
typeguard==3.0.2
typing_extensions==4.7.1
tzdata==2023.3
uri-template==1.3.0
urllib3==2.0.4
virtualenv==20.24.5
wcwidth==0.2.6
webcolors==1.13
webencodings==0.5.1
websocket-client==1.6.2
widgetsnbextension==4.0.8
zipp==3.16.2
seanpearsonuk commented 6 months ago

@gyeole @h-krishnan I can reproduce this

@ansjsia

seanpearsonuk commented 6 months ago

Fluent ID 1035314