ansys / pyfluent

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

Error when running meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry") #892

Closed pavankumarkonchada closed 2 years ago

pavankumarkonchada commented 2 years ago

🔍 Before submitting the issue

🐞 Description of the bug

'Session' object has no attribute 'workflow'

📝 Steps to reproduce

I have tried to run and i am getting the issue

💻 Which operating system are you using?

Windows

🐍 Which Python version are you using?

3.10

📦 Installed packages

pip install pyfluent
prmukherj commented 2 years ago

@pavankumarkonchada , Could you please provide the steps to reproduce?

pavankumarkonchada commented 2 years ago

import ansys.fluent.core as pyfluent from ansys.fluent.core import examples

import_filename = examples.download_file("mixing_elbow.pmdb", "pyfluent/mixing_elbow") meshing = pyfluent.launch_fluent(precision="double", processor_count=10, meshing_mode=True,show_gui=True)

meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

when I am trying to run the above commands it is throwing Session object has no attribute worflow

AttributeError Traceback (most recent call last) Input In [2], in <cell line: 1>() ----> 1 meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

AttributeError: 'Session' object has no attribute 'workflow'

prmukherj commented 2 years ago

@pavankumarkonchada, Actually we have a new launcher preference in place now. So, either use any one of the following:

  1. Session = pyfluent.launch_fluent(precision="double", processor_count=10, meshing_mode=True, show_gui=True) Session.meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

or, 2. meshing = pyfluent.launch_fluent(precision="double", processor_count=10, mode="meshing", show_gui=True) meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

Both the above techniques will work. However, second approach is preferred as the first approach has been deprecated. Please let us know if the issue still persist. Thank you

seanpearsonuk commented 2 years ago

@pavankumarkonchada, Actually we have a new launcher preference in place now. So, either use any one of the following:

  1. Session = pyfluent.launch_fluent(precision="double", processor_count=10, meshing_mode=True, show_gui=True) Session.meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

or, 2. meshing = pyfluent.launch_fluent(precision="double", processor_count=10, mode="meshing", show_gui=True) meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

Both the above techniques will work. However, second approach is preferred as the first approach has been deprecated. Please let us know if the issue still persist. Thank you

@prmukherj that's correct. In the example from @pavankumarkonchada, it would have been necessary to call meshing.meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

pavankumarkonchada commented 2 years ago

Using the second method I am getting this error TypeError Traceback (most recent call last) Input In [4], in <cell line: 3>() 1 import ansys.fluent.core as pyfluent 2 from ansys.fluent.core import examples ----> 3 meshing = pyfluent.launch_fluent(precision="double", processor_count=10, mode="meshing", show_gui=True) 4 meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

TypeError: launch_fluent() got an unexpected keyword argument 'mode'

prmukherj commented 2 years ago

@pavankumarkonchada, do you have the latest version of the code? Could you please confirm that? Thank you

pavankumarkonchada commented 2 years ago

I am following as mentioned in the below blog https://www.ansys.com/en-in/blog/open-source-access-to-fluent-with-pyfluent And after that when I have opened in launcher.py I see the arguments passed to launcher definition is as below def launch_fluent( version: str = None, precision: str = None, processor_count: int = None, journal_filename: str = None, meshing_mode: bool = None, start_timeout: int = 3000, additional_arguments: str = "", env: Dict[str, Any] = None, start_instance: bool = None, ip: str = None, port: int = None, cleanup_on_exit: bool = True, start_transcript: bool = True, show_gui: bool = None, ) -> Session:

seanpearsonuk commented 2 years ago

I am following as mentioned in the below blog https://www.ansys.com/en-in/blog/open-source-access-to-fluent-with-pyfluent And after that when I have opened in launcher.py I see the arguments passed to launcher definition is as below def launch_fluent( version: str = None, precision: str = None, processor_count: int = None, journal_filename: str = None, meshing_mode: bool = None, start_timeout: int = 3000, additional_arguments: str = "", env: Dict[str, Any] = None, start_instance: bool = None, ip: str = None, port: int = None, cleanup_on_exit: bool = True, start_transcript: bool = True, show_gui: bool = None, ) -> Session:

The referenced blog doesn't use meshing.