Display plane surface by using Py-Fluent Visualization

Options
Gopi Raju Velpula
Gopi Raju Velpula Member Posts: 18
First Comment Name Dropper Photogenic
edited June 23 in Fluids

I created Plane surface by using below code but when i try to display it it shows error
anyone help me with this..

surface1 = graphics.Surfaces['zx-plane']
surface1.definition.type = 'plane-surface'
surface1.definition.plane_surface.creation_method = 'zx-plane'
surface1.display()

Getting below error..


RuntimeError Traceback (most recent call last)
Cell In[18], line 4
2 surface1.definition.type = 'plane-surface'
3 surface1.definition.plane_surface.creation_method = 'zx-plane'
----> 4 surface1.display()

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\core\meta.py:111, in Command.init.._execute(_self, *args, **kwargs)
107 if arg_value < minimum or arg_value > maximum:
108 raise DisallowedValuesError(
109 arg, arg_value, allowed_values
110 )
--> 111 return method(_self.obj, *args, **kwargs)

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\visualization\pyvista\pyvista_objects.py:149, in Surface.display(self, window_id, overlay)
136 @Command
137 def display(self, window_id: Optional[str] = None, overlay: Optional[bool] = False):
138 """Display surface graphics.
139
140 Parameters
(...)
147 The default is False.
148 """
--> 149 pyvista_windows_manager.plot(
150 self, window_id=window_id, overlay=overlay, fetch_data=True
151 )

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\visualization\pyvista\pyvista_windows_manager.py:595, in PyVistaWindowsManager.plot(self, object, window_id, fetch_data, overlay)
593 window_id = self._get_unique_window_id()
594 if in_notebook() or get_config()["blocking"]:
--> 595 self._plot_notebook(object, window_id, fetch_data, overlay)
596 else:
597 self._open_and_plot_console(object, window_id, fetch_data, overlay)

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\visualization\pyvista\pyvista_windows_manager.py:783, in PyVistaWindowsManager._plot_notebook(self, obj, window_id, fetch_data, overlay)
781 window.fetch_data = fetch_data
782 window.overlay = overlay
--> 783 window.plot()

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\visualization\pyvista\pyvista_windows_manager.py:146, in PyVistaWindow.plot(self)
144 def plot(self):
145 """Display graphics."""
--> 146 self.fetch()
147 self.render()

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\visualization\pyvista\pyvista_windows_manager.py:94, in PyVistaWindow.fetch(self)
92 self._fetch_mesh(obj)
93 elif obj.class.name == "Surface":
---> 94 self._fetch_surface(obj)
95 elif obj.class.name == "Contour":
96 self._fetch_contour(obj)

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\visualization\pyvista\pyvista_windows_manager.py:405, in PyVistaWindow._fetch_surface(self, obj)
403 self._fetch_mesh(mesh)
404 del post_session.Meshes[dummy_object]
--> 405 surface_api.delete_surface_on_server()

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\core\post_objects\post_helper.py:118, in PostAPIHelper._SurfaceAPI.delete_surface_on_server(self)
116 def delete_surface_on_server(self):
117 """Deletes the surface on server."""
--> 118 self._get_api_handle().delete_surface(self._surface_name_on_server)

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\core\services\datamodel_tui.py:314, in TUIMethod.call(self, *args, **kwargs)
313 def __call__(self, *args, **kwargs):
--> 314 return PyMenu(self._service, self._version, self._mode, self._path).execute(
315 *args, **kwargs
316 )

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\core\services\datamodel_tui.py:241, in PyMenu.execute(self, *args, **kwargs)
239 return self._service.execute_query(self._path, *args, **kwargs)
240 else:
--> 241 return self._service.execute_command(self._path, *args, **kwargs)

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\core\services\datamodel_tui.py:157, in DatamodelService.execute_command(self, path, *args, **kwargs)
155 else:
156 _convert_value_to_gvalue(args, request.args.fields["tui_args"])
--> 157 return self._impl.execute_command(request)

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\core\services\datamodel_tui.py:69, in DatamodelServiceImpl.execute_command(self, request)
65 def execute_command(
66 self, request: DataModelProtoModule.ExecuteCommandRequest
67 ) -> DataModelProtoModule.ExecuteCommandResponse:
68 """ExecuteCommand RPC of DataModel service."""
---> 69 return self._stub.ExecuteCommand(request, metadata=self._metadata)

File ~.ansys_python_venvs\sim\lib\site-packages\grpc_interceptor.py:277, in _UnaryUnaryMultiCallable.call(self, request, timeout, metadata, credentials, wait_for_ready, compression)
268 def call(
269 self,
270 request: Any,
(...)
275 compression: Optional[grpc.Compression] = None,
276 ) -> Any:
--> 277 response, ignored_call = self._with_call(
278 request,
279 timeout=timeout,
280 metadata=metadata,
281 credentials=credentials,
282 wait_for_ready=wait_for_ready,
283 compression=compression,
284 )
285 return response

File ~.ansys_python_venvs\sim\lib\site-packages\grpc_interceptor.py:329, in _UnaryUnaryMultiCallable._with_call(self, request, timeout, metadata, credentials, wait_for_ready, compression)
326 except Exception as exception: # pylint:disable=broad-except
327 return _FailureOutcome(exception, sys.exc_info()[2])
--> 329 call = self._interceptor.intercept_unary_unary(
330 continuation, client_call_details, request
331 )
332 return call.result(), call

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\core\services\interceptors.py:122, in GrpcErrorInterceptor.intercept_unary_unary(self, continuation, client_call_details, request)
115 def intercept_unary_unary(
116 self,
117 continuation: Any,
118 client_call_details: grpc.ClientCallDetails,
119 request: Any,
120 ) -> Any:
121 """Intercept unary-unary call for error state checking."""
--> 122 return self._intercept_call(continuation, client_call_details, request)

File ~.ansys_python_venvs\sim\lib\site-packages\ansys\fluent\core\services\interceptors.py:112, in GrpcErrorInterceptor._intercept_call(self, continuation, client_call_details, request)
110 ex = RuntimeError(grpc_ex.details())
111 ex.context = grpc_ex
--> 112 raise ex from None
113 return response

RuntimeError: An error occurred in the previous operation.
The details can be found in the text output.
Error Object: #f

Comments

  • Gopi Raju Velpula
    Gopi Raju Velpula Member Posts: 18
    First Comment Name Dropper Photogenic
    edited June 26
    Options

    @Chris Harrold
    Hi Chris,
    I'm experiencing an issue with my code and haven't gotten any responses so far. Could you help me out?