pyfluent: Unexpected Boolean type for attributes
It seems that attribute methods in flobject are returning False for unset attributes - should return None.
e.g. after reading mixing-elbow case (doesn’t matter what case):
>>> s.setup.boundary_conditions.velocity_inlet['cold-inlet'].turb_intensity.default_value()
0.05
>>> s.setup.boundary_conditions.velocity_inlet['cold-inlet'].turb_intensity.max()
1
>>> s.setup.boundary_conditions.velocity_inlet['cold-inlet'].vmag.value.min()
False
>>> s.setup.boundary_conditions.velocity_inlet['cold-inlet'].vmag.value.max()
False
>>> s.setup.boundary_conditions.velocity_inlet['cold-inlet'].vmag.value.default_value()
False
>>> s.setup.boundary_conditions.velocity_inlet['cold-inlet'].vmag.value.get_attr('default')
False
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (1 by maintainers)
@gyeole thanks very much, that will be good. @prmukherj nothing to change in flobject.py or any client code. Thanks for raising this.
@seanpearsonuk I agree. I will handle it at API level. I will create PR in a day or two.
@seanpearsonuk Only min and max are exceptions.
@prmukherj we need to put something in flobject.py (both versions) in the min and max methods to convert False to None. Also standby for replies to the above questions.
In Fluent to specify no limit, #f is used for min and max attribute. Hence it return false for quantities for which it is not defined