ansys / pyfluent

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

meshing.workflow.InitializeWorkflow does not work #2249

Closed gantnera closed 11 months ago

gantnera commented 11 months ago

🔍 Before submitting the issue

🐞 Description of the bug

trying to setup the watertight workflow with the example provided on the example page (https://fluent.docs.pyansys.com/version/stable/examples/00-fluent/mixing_elbow.html#sphx-glr-examples-00-fluent-mixing-elbow-py) does not work. The error occurs when trying to initialize the watertight workflow meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

Error-messages: v232: AttributeError: module 'ansys.fluent.core.workflow' has no attribute 'InitializeWorkflow' v241: ModuleNotFoundError: No module named 'ansys.fluent.core.datamodel_241'

Is the example out-of-date? Or is there a bug?

📝 Steps to reproduce

import ansys.fluent.core as pyfluent

meshing = pyfluent.launch_fluent(mode="meshing", product_version="24.1.0") meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

v232 & v241

🐍 Which Python version are you using?

3.10

📦 Installed packages

Package                               Version
------------------------------------- --------
ansys-api-fluent                      0.3.18
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-sherlock                    0.1.14
ansys-api-systemcoupling              0.1.0
ansys-dpf-composites                  0.2.0
ansys-dpf-core                        0.8.1
ansys-dpf-gate                        0.3.1
ansys-dpf-gatebin                     0.3.1
ansys-dpf-post                        0.4.0
ansys-fluent-core                     0.18.1
ansys-grantami-bomanalytics           1.1.3
ansys-grantami-bomanalytics-openapi   1.0.0
ansys-grantami-recordlists            1.0.0
ansys-grantami-serverapi-openapi      1.0.0
ansys-grpc-dpf                        0.7.1
ansys-mapdl-core                      0.64.1
ansys-mapdl-reader                    0.52.17
ansys-math-core                       0.1.1
ansys-mechanical-core                 0.8.0
ansys-meshing-prime                   0.3.2
ansys-motorcad-core                   0.1.3
ansys-openapi-common                  1.2.1
ansys-optislang-core                  0.2.1
ansys-platform-instancemanagement     1.1.1
ansys-pythonnet                       3.1.0rc1
ansys-seascape                        0.2.0
ansys-sherlock-core                   0.2.0
ansys-systemcoupling-core             0.1.3
appdirs                               1.4.4
cachetools                            5.3.1
certifi                               2023.5.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.1.0
cryptography                          41.0.1
cycler                                0.11.0
docker                                6.1.3
fonttools                             4.40.0
google-api-core                       2.11.1
google-api-python-client              2.92.0
google-auth                           2.21.0
google-auth-httplib2                  0.1.0
googleapis-common-protos              1.59.1
grpcio                                1.56.0
grpcio-health-checking                1.48.2
grpcio-status                         1.48.2
h5py                                  3.9.0
httplib2                              0.22.0
idna                                  3.4
importlib-metadata                    6.7.0
joblib                                1.3.1
kiwisolver                            1.4.4
lxml                                  4.9.3
matplotlib                            3.7.2
numpy                                 1.25.0
packaging                             23.1
pandas                                2.0.3
Pillow                                10.0.0
pip                                   23.2.1
platformdirs                          3.8.0
plumbum                               1.8.2
pooch                                 1.7.0
protobuf                              3.20.3
protoc-gen-swagger                    0.1.0
psutil                                5.9.5
pyaedt                                0.6.76
pyansys                               2023.2.5
pyansys-tools-versioning              0.4.0
pyasn1                                0.5.0
pyasn1-modules                        0.3.0
pycparser                             2.21
pyiges                                0.3.1
pyparsing                             3.0.9
pypiwin32                             223
pyspnego                              0.9.1
python-dateutil                       2.8.2
pythonnet                             3.0.1
pytwin                                0.3.0
pytz                                  2023.3
pyvista                               0.40.0
pywin32                               306
PyYAML                                6.0
requests                              2.31.0
requests-negotiate-sspi               0.5.2
requests-ntlm                         1.2.0
rpyc                                  5.3.1
rsa                                   4.9
scikit-learn                          1.3.0
scipy                                 1.11.1
scooby                                0.7.2
setuptools                            65.5.0
six                                   1.16.0
threadpoolctl                         3.1.0
tqdm                                  4.65.0
tzdata                                2023.3
uritemplate                           4.1.1
urllib3                               1.26.16
vtk                                   9.2.6
websocket-client                      1.6.3
zipp                                  3.15.0
raph-luc commented 11 months ago

Hi @gantnera, thanks for reporting this. The required API files for Fluent v241 are not yet distributed with the public release of PyFluent, as Fluent v241 is still under development and hasn't been released publicly. For Fluent v241, you can try the development install as described in the installation instructions.

Fluent v232 works fine on my end, as does Fluent v241 when the required API files are provided: image

It seems that the API files are missing in your PyFluent installation (are you using a dev install without the API files?), can you try again using pip install ansys-fluent-core?

By the way, we have a new PyFluent release coming out soon.

gantnera commented 11 months ago

Thanks for your response , @raph-luc

Which pyfluent version did you use when running it with v232?

Another question: how should this example look like when I would like to run it with the python-console inside Fluent-Meshing? I did a short test and it seems that the used classes are not available. image

raph-luc commented 11 months ago

I was using a local PyFluent development version as described in the link I sent above.

The conventional PyFluent installation using pip install ansys-fluent-core supports Fluent v232 with no issues, it is just Fluent v241 that hasn't been released yet and will require a development install of PyFluent.

The Python Console inside Fluent is not using PyFluent (yet) and objects are exposed differently. In the Python Console, you would use workflow.InitializeWorkflow(WorkflowType="Watertight Geometry") directly. See: image

I am going to close this issue tracker as there is no issue here for us to fix, feel free to continue asking questions and re-open in case you identify any issue that you wish to report (or create a new issue tracker if applicable).