ansys / pyfluent

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

Vector field data is empty after reading case-data #2339

Closed mkundu1 closed 3 months ago

mkundu1 commented 6 months ago
>>> import ansys.fluent.core as pyfluent                           
>>> solver = pyfluent.launch_fluent(show_gui=True)
>>> solver.file.read_case_data(file_name="elbow.cas.h5")
>>> [a.x for a in solver.field_data.get_vector_field_data(field_name="velocity", surface_ids=[1])[1].data][:5]
[0.0, 0.0, 0.0, 0.0, 0.0]
# after initializing and iterating on the server
>>> [a.x for a in solver.field_data.get_vector_field_data(field_name="velocity", surface_ids=[1])[1].data][:5]
[9.886924, 9.887492, 9.885322, 9.890671, 9.891528]
mkundu1 commented 6 months ago

Another minor issue:

>>> solver.field_info.get_vector_fields_info()
{'velocity': {'x-component': 'x-velocity', 'y-component': 'y-velocity', 'z-component': 'z-velocity'}, 'relative-velocity': {'x-component': 'relative-x-velocity', 'y-component': 'relative-y-velocity', 'z-component': 'relative-z-velocity'}}

For other get_*_info methods, the keys are in snake case.

seanpearsonuk commented 4 months ago

@ajain-work would you have time to look into this before 22/03?

seanpearsonuk commented 4 months ago

This will be fixed on the Fluent side.

mkundu1 commented 3 months ago

Fix has been merged to Fluent, TODO: PyFluent unitest

seanpearsonuk commented 3 months ago

Fix has been merged to Fluent, TODO: PyFluent unitest

Either @prmukherj or @hpohekar could pick up the unit test work

hpohekar commented 3 months ago

@seanpearsonuk I'm looking into unit test work.

seanpearsonuk commented 3 months ago

@seanpearsonuk I'm looking into unit test work.

@hpohekar thank you