TAGGED: python-scripts
-
-
July 19, 2023 at 12:41 pm
Antoine ROLAND
SubscriberHi,
I'm having trouble doing something pretty basic... I want to extract the vector field from a .dat.gz of the volume/fluid domain "surface".
To be clear: I want the DataFrame with columns=[nodes_number, x, y, z, velocity_x, velocity_y, velocity_z]Here is a test code:
import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
file = examples.download_file(
filename="manifold_solution.cas.h5", directory="pyfluent/exhaust_manifold"
)
file_dat = examples.download_file(
filename="manifold_solution.dat.h5", directory="pyfluent/exhaust_manifold"
)
solver = pyfluent.launch_fluent(precision='double', processor_count=1, mode="solver")
solver.file.read(file_type="case-data", file_name=file)
field_data = solver.field_data
vector_field = field_data.get_vector_field_data(field_name="velocity", surface_name="fluid1")
print(vector_field)And here is the traceback:C:\Users\ARD\anaconda3\Lib\site-packages\paramiko\transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated
"class": algorithms.Blowfish,
Checking if specified file already exists...
File already exists. File path:
C:\Users\ARD\AppData\Local\Ansys\ansys_fluent_core\examples\manifold_solution.cas.h5
Checking if specified file already exists...
File already exists. File path:
C:\Users\ARD\AppData\Local\Ansys\ansys_fluent_core\examples\manifold_solution.dat.h5
Fast-loading "C:\PROGRA~1\ANSYSI~1\v231\fluent\fluent23.1.0\\addons\afd\lib\hdfio.bin"
Done.
Note: Rank = 0: Process affinity not being set (6).
Reading from SYC-29:"C:\Users\ARD\AppData\Local\Ansys\ansys_fluent_core\examples\manifold_solution.cas.h5" in NODE0 mode ...
Reading mesh ...
288590 cells, 2 cell zones ...
201658 polyhedra cells, zone id: 815
86932 polyhedra cells, zone id: 818
1795387 faces, 13 face zones ...
454038 polygonal interior faces, zone id: 817
1258889 polygonal interior faces, zone id: 814
275 polygonal pressure-outlet faces, zone id: 559
261 polygonal velocity-inlet faces, zone id: 463
265 polygonal velocity-inlet faces, zone id: 367
262 polygonal velocity-inlet faces, zone id: 272
51846 polygonal wall faces, zone id: 226
13399 polygonal wall faces, zone id: 830
13399 polygonal wall faces, zone id: 2
724 polygonal wall faces, zone id: 181
676 polygonal wall faces, zone id: 180
678 polygonal wall faces, zone id: 179
675 polygonal wall faces, zone id: 178
1408040 nodes, 1 node zone ...
Warning: reading 4 partition grid onto 1 compute node machine.
Combining every 4 partitions.
Done.
Building...
mesh
materials,
interface,
domains,
mixture
zones,
solid_up:1:830-shadow
interior--fluid1
interior--solid_up
outlet
inlet2
inlet1
inlet
solid_up:1
solid_up:1:830
out1
in3
in2
in1
fluid1
solid_up
parallel,
Done.
Reading from SYC-29:"C:\Users\ARD\AppData\Local\Ansys\ansys_fluent_core\examples\manifold_solution.dat.h5" in NODE0 mode ...
Reading results.
Parallel variables...
Done.
Traceback (most recent call last):
File "D:\python\stansys\example_stack_overflow.py", line 15, in
vector_field = field_data.get_vector_field_data(field_name="velocity", surface_name="fluid1")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARD\anaconda3\Lib\site-packages\ansys\fluent\core\services\field_data.py", line 359, in __call__
return self._field_data_accessor(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARD\anaconda3\Lib\site-packages\ansys\fluent\core\services\field_data.py", line 1336, in get_vector_field_data
surface_ids = _get_surface_ids(
^^^^^^^^^^^^^^^^^
File "C:\Users\ARD\anaconda3\Lib\site-packages\ansys\fluent\core\services\field_data.py", line 730, in _get_surface_ids
allowed_surface_names.valid_name(surface_name)
File "C:\Users\ARD\anaconda3\Lib\site-packages\ansys\fluent\core\services\field_data.py", line 293, in valid_name
raise SurfaceNameError(
ansys.fluent.core.services.field_data.SurfaceNameError: fluid1 is not an allowed surface name.
The most similar names are: solid_up:1. -
July 21, 2023 at 12:49 pm
Supreetha J
SubscriberHello,
PyAnsys project is developed and supported through GitHub. You can post issues and request new featured on the the Issues page for each package, or contact PyAnsys support. For more details, please refer to PyAnsys GitHub page: https://github.com/pyansys
Thank you.
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Suppress Fluent to open with GUI while performing in journal file
- Mesh Interfaces in ANSYS FLUENT
- Time Step Size and Courant Number
- error: Received signal SIGSEGV
-
7748
-
4504
-
2971
-
1449
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.