ansys / pyfluent

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

Look into make_a_copy functionality for settings named object #3294

Open seanpearsonuk opened 2 months ago

seanpearsonuk commented 2 months ago

materials method make_a_copy returns string as follows:

>>> x=solver.setup.materials.fluid.make_a_copy(from_="water",to="water-2")
>>> x
"'water"

Rename goes like this (it returns a string list):

>>> solver.setup.materials.fluid.rename(old="bob", new="bobby")
["'bob"]

create behaves differently to make_a_copy. create returns an object. Why only this one?

>>> mysolid = solver.setup.materials.solid.create("mysolid")
>>> mysolid
<flapi.flobject.child_object_type object at 0x00000000D30002E0>
>>> mysolid.chemical_formula = "SiO2"
>>> mysolid.density = 2650
prmukherj commented 2 months ago

Discussion from Scrum (24/09/2024)

solver.setup.materials.fluid.make_acopy(from="water",to="water-2") -->> Should return python object like 'create'

solver.setup.materials.fluid.rename(old="bob", new="bobby") -->> Can be fixed from settings-api to not return anything

prmukherj commented 5 days ago

Current behavior in

PyConsole: Image

PyFluent: Image

Both are consistent and does not return anything. Need to look into 'make_a_copy' to return object.

'create' returns a string in PyConsole: Image

but an object in PyFluent: Image

Need to address this inconsistency. cc. @mkundu1, @seanpearsonuk

prmukherj commented 2 days ago

Current behavior: Image