Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues in examples #3469

Open
2 tasks done
millerj97 opened this issue Nov 11, 2024 · 4 comments
Open
2 tasks done

issues in examples #3469

millerj97 opened this issue Nov 11, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@millerj97
Copy link
Collaborator

millerj97 commented Nov 11, 2024

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

some of the commands in the documentation examples are no longer working;

  1. Modeling Radiation in a Headlamp Using the Monte Carlo Method
    https://fluent.docs.pyansys.com/version/stable/examples/00-fluent/radiation_headlamp.html# commands under Boundary Conditions;
bc.radiation.diffuse_fraction_band = {"s-": 0.1}
...
>>> >>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".venv/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1143, in __setattr__
    attr = getattr(self, name)
  File ".venv/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1110, in __getattribute__
    attr = super().__getattribute__(name)
AttributeError: 'radiation' object has no attribute 'diffuse_fraction_band'.
.
The most similar names are: diffuse_irradiation_settings.

rad_input_bc.radiation.direct_irradiation = {"s-": 1200}
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".venv/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1143, in __setattr__
    attr = getattr(self, name)
  File ".venv/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1110, in __getattribute__
    attr = super().__getattribute__(name)
AttributeError: 'radiation' object has no attribute 'direct_irradiation'.
.
The most similar names are: direct_irradiation_settings, solar_irradiation, diffuse_irradiation_settings.. Did you mean: 'solar_irradiation'?

It also worth noting in the above example, the did you mean prompt suggests solar_irradiation. But the original command was direct_irradiation, and most similar names contains direct_irradiation_settings. Would this not be the appropriate suggestion?

  1. Parametric study workflow
    example https://fluent.docs.pyansys.com/version/stable/examples/00-fluent/parametric_static_mixer_1.html - cannot find the saved flprj file despite saving successful message? for step "Launch Fluent and read saved project"
>>> project_filepath = str(Path(pyfluent.EXAMPLES_PATH) / "static_mixer_study_save.flprj")

solver_session.settings.file.parametric_project.save_as(
   project_filename=project_filepath
)

solver_session.exit()>>> >>> ... ... 
Current working directory is "pyfl_examples_251/parametric_static_mixer_1/pyfluent_run/project_1.cffdb"

Project saved successfully at "ansys_fluent_core_examples/static_mixer_study_save.flprj"
>>> >>> >>> 
>>> 
>>> 
>>> 
>>> solver_session = pyfluent.launch_fluent(
   precision="double", processor_count=2, mode="solver"
)

project_filepath_read = str(Path(pyfluent.EXAMPLES_PATH) / "static_mixer_study.flprj")

solver_session.settings.file.parametric_project.open(
   project_filename=project_filepath_read, load_case=True
)... ... nohup: appending output to 'nohup.out'

>>> >>> >>> >>> ... ... pyfluent.settings_api WARNING: Mismatch between generated file and server object info. Dynamically created settings classes will be used.
>>> 
>>> 
>>> solver_session.settings.file.parametric_project.save()
File /ansys_fluent_core_examples/static_mixer_study.flprj does not exists.
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
Error: api-checks-before-command-or-query: command/query is not active
Error Object: "file/parametric-project/save"
 File "/.venv/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1739, in __call__
     return self.execute_command(**kwds)
 File "/.venv/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1663, in execute_command
   ret = self._execute_command(*args, **kwds)
 File "/.venv/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1727, in _execute_command
   ret = self.flproxy.execute_cmd(self._parent.path, self.obj_name, **newkwds)
 File "/.venv/lib/python3.10/site-packages/ansys/fluent/core/services/settings.py", line 124, in _fn
   return fn(self, *args, **kwds)
 File "/.venv/lib/python3.10/site-packages/ansys/fluent/core/services/settings.py", line 329, in execute_cmd
   response = self._service_impl.execute_cmd(request)
 File "/.venv/lib/python3.10/site-packages/ansys/fluent/core/services/settings.py", line 91, in execute_cmd
   return self.__stub.ExecuteCommand(request, metadata=self.__metadata)
 File "/.venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 277, in __call__
   response, ignored_call = self._with_call(
 File "/.venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 329, in _with_call
   call = self._interceptor.intercept_unary_unary(
 File "/.venv/lib/python3.10/site-packages/ansys/fluent/core/services/interceptors.py", line 122, in intercept_unary_unary
   return self._intercept_call(continuation, client_call_details, request)
 File "/.venv/lib/python3.10/site-packages/ansys/fluent/core/services/interceptors.py", line 112, in _intercept_call
   raise ex from None
RuntimeError: api-checks-before-command-or-query: command/query is not active

  1. Automotive Brake Thermal Analysis
    running the brake thermal example https://fluent.docs.pyansys.com/version/stable/examples/00-fluent/brake.html in the documentation results in the following error
Traceback (most recent call last):

  File "/Brake_Thermal_PyVista_Matplotlib/brake.py", line 215, in <module>
    solver.settings.results.graphics.contour["temperature"] = {
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1895, in __setitem__
    child.set_state(value)
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 766, in set_state
    state, outer_set_states = self._unalias(self.__class__, kwargs or state)
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 749, in _unalias
    ret[k], o_set_states = cobj._unalias(ccls, v)
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 749, in _unalias
    ret[k], o_set_states = cobj._unalias(ccls, v)
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 748, in _unalias
    cobj = getattr(self, k)
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1099, in __getattribute__
    raise InactiveObjectError(self.python_path)
ansys.fluent.core.solver.flobject.InactiveObjectError: '<session>.settings.results.graphics.contour["temperature"].range_option.auto_range_off' is currently inactive.
  1. Fault-tolerant meshing workflow using settings objects
    https://fluent.docs.pyansys.com/version/stable/examples/00-fluent/exhaust_system_settings_api.html scene commands result in below error
Error: api-create-obj: new objects of this type cannot be created
Traceback (most recent call last):
Error Object: "results/scene/scene-1/graphics-objects"
  File "exhaust_system_settings_api/orig_script.py", line 733, in <module>
    scene1.graphics_objects["mesh-1"] = {
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1889, in __setitem__
    self.flproxy.create(self.path, name)
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/services/settings.py", line 124, in _fn
    return fn(self, *args, **kwds)
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/services/settings.py", line 215, in create
    self._service_impl.create(request)
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/services/settings.py", line 55, in create
    return self.__stub.Create(request, metadata=self.__metadata)
  File "/.venv3/lib/python3.10/site-packages/grpc/_interceptor.py", line 277, in __call__
    response, ignored_call = self._with_call(
  File "/.venv3/lib/python3.10/site-packages/grpc/_interceptor.py", line 329, in _with_call
    call = self._interceptor.intercept_unary_unary(
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/services/interceptors.py", line 122, in intercept_unary_unary
    return self._intercept_call(continuation, client_call_details, request)
  File "/.venv3/lib/python3.10/site-packages/ansys/fluent/core/services/interceptors.py", line 112, in _intercept_call
    raise ex from None
RuntimeError: api-create-obj: new objects of this type cannot be created
Error Object: results/scene/scene-1/graphics-objects

suggested fix
using the following add commands should fix this issue;

solver.results.scene["scene-1"] = {}
scene1 = solver.results.scene["scene-1"]
scene1.graphics_objects.add(name="mesh-1")
scene1.graphics_objects['mesh-1'] = {
    "transparency": 90,
}
  1. Parametric Study workflow
    https://fluent.docs.pyansys.com/version/stable/examples/00-fluent/parametric_static_mixer_1.html
    the create command appears out of date:
Traceback (most recent call last):
  File "/parametric_static_mixer_1.py", line 220, in <module>
    ].design_points.create_1(write_data=False, capture_simulation_report_data=True)
  File ".env/lib/python3.10/site-packages/ansys/fluent/core/solver/flobject.py", line 1475, in __getattr__
    return getattr(super(), name)
AttributeError: 'super' object has no attribute 'create_1'. Did you mean: 'create'?

📝 Steps to reproduce

💻 Which operating system are you using?

Linux

📀 Which ANSYS version are you using?

v251

🐍 Which Python version are you using?

3.10

📦 Installed packages

about-time==4.2.1
alive-progress==3.2.0
ansys-api-fluent==0.3.28
ansys-api-platform-instancemanagement==1.1.0
ansys-api-tools-filetransfer==0.1.1
ansys-fluent-core==0.26.1
ansys-platform-instancemanagement==1.1.2
ansys-tools-filetransfer==0.1.0
ansys-units==0.3.2
beartype==0.19.0
certifi==2024.8.30
charset-normalizer==3.4.0
click==8.1.7
docker==7.1.0
grapheme==0.6.0
grpcio==1.67.1
grpcio-health-checking==1.62.3
idna==3.10
importlib_metadata==8.5.0
joblib==1.4.2
lxml==5.3.0
nltk==3.9.1
numpy==1.26.4
pandas==2.2.3
platformdirs==4.3.6
protobuf==4.25.5
psutil==6.1.0
python-dateutil==2.9.0.post0
pytz==2024.2
PyYAML==6.0.2
regex==2024.11.6
requests==2.32.3
six==1.16.0
tqdm==4.67.0
tzdata==2024.2
urllib3==2.2.3
zipp==3.21.0
@millerj97 millerj97 added the bug Something isn't working label Nov 11, 2024
@millerj97
Copy link
Collaborator Author

@prmukherj I am working through the examples so will track any issues here, unless you know of any existing issues to fix the examples?

@mkundu1
Copy link
Contributor

mkundu1 commented Nov 11, 2024

These are settings API changes from 24.2 to 25.1 and there is no backward compatibility entry for these settings.

But, anyway, the documentation examples should reflect the latest settings API. We shall upgrade the Fluent version to 25.1 for doc build after FCA.

@seanpearsonuk
Copy link
Collaborator

The lack of backward compatibility is a major concern. We have told ACE that the API is fully covered by backward compatibility which would have been disseminated to customers. I believe that this is also mentioned in our documentation.

Regarding appropriate suggestions, I note that diffuse_irradiation_settings. seems to be provided as a distinct suggestion from diffuse_irradiation_settings? I wasn't able to reconcile some of the other comments about the suggestions with the output that is provided.

@millerj97 @mkundu1

@millerj97
Copy link
Collaborator Author

@cj-hodgson

@millerj97 millerj97 changed the title example commands no longer working issues in examples Nov 22, 2024
@millerj97 millerj97 assigned millerj97 and hpohekar and unassigned millerj97 Nov 22, 2024
@hpohekar hpohekar assigned prmukherj and unassigned prmukherj Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants