Closed som1197 closed 4 months ago
@som1197, you could use the settings-api altenative:
surf_name = "point-" + str(angle) solver.results.surfaces.point_surface.create(surf_name) solver.results.surfaces.point_surface[surf_name].point = [x, y, z]
@prmukherj : Can you clarify on how to access settings-api?
@som1197, the snippet provided above is an alternative to running your script using settings-api. For more information on using settings-api, please look into the pyfluent documentation: https://fluent.docs.pyansys.com/version/stable/
@prmukherj , yes but I was looking for the expected arguments that the function would need.
For example: solver.setup.models.viscous.model.allowed_values(), solver.setup.models.viscous.model.get_attr('allowed-values')
, etc.
I can only find out the required input arguments [point, angle and x,y,z] to the function solver.tui.surface.point_surface("point-" + str(angle), x, y, z)
by running this within the fluent TUI console.
The TUI API doesn't have any information about the required parameters. The proceducre to construct TUI commands is described here. This shortcoming is not present in the newer settings API (the commands shared by @prmukherj which will do same the same thing as solver.tui.surface.point_surface(...)
.
@mkundu1 , yes thats correct and i have explored the process of converting journal files into pythonized version of the journal files. But I was looking to do this in a way where the function arguments can be defined as class variables which can then be integrated into the function call in an objected oriented way. This can be useful for cases when some of the TUI calls have really long argument list, For eg:
solver.tui.display.objects.create(
"vector",
"vector-vel",
"style",
"arrow",
"surface-list",
"symmetry-xyplane",
"()",
"scale",
"scale-f",
"4",
"quit",
"skip",
"2",
"quit",
)
We do not have any metadata for TUI argument names, so that approach won't work here. We are developing the settings API to avoid these issues coming from the legacy TUI.
I wanted to create planes using different methods available in the TUI.
Currently I cannot know beforehand the required arguments and their datatypes for the method 'point_surface' and many other methods for the tui module.
I tried to use the 'inspect' module as shown below:
But this gave me empty values as shown below.
Parameter name: args Parameter default value: <class 'inspect._empty'> Parameter annotation: <class 'inspect._empty'> Parameter name: kwargs Parameter default value: <class 'inspect._empty'> Parameter annotation: <class 'inspect._empty'>
Is there a way to expose these default attributes so that they can be conveniently used without having to use the TUI console in the GUI to know the input arguments?