TAGGED: fluent, python-scripting
-
-
January 7, 2025 at 5:36 pm
wheeler.ky
SubscriberHi all,
I am using ansys-fluent-core to write a python script to automate some simulations with different geometries and setup. I have a script that can import the different mesh files, setup and run the simulation, and save certain results. However, I need to export specific solution data, which in the GUI is done by file > export > solution data. I need to export static pressure, x-wall shear stress, x-face area, y-face area, and dx-velocity_dx in ascii format.
ansys-fluent-core has a function for exporting solution data, which is solver.file.export.ascii(), which is what I am trying to use for this. This is the description of the arguments for the function:
class ascii(Command)
 |  ascii(name: 'Optional[str]' = None, parent=None)
 |
 |  Write an ASCII file.
 |
 |  Parameters
 |  ----------
 |    file_name : str
 |      Enter the desired file name to export.
 |    surface_name_list : List
 |      List of surfaces to export.
 |    delimiter : str
 |      Select the delimiter separating the fields.
 |    cell_func_domain : List
 |      Select the list of quantities to export.
 |    location : str
 |      Select the node or cell-center to export data values.So the line of code I'm attempting to use is this:
solver.file.export.ascii(file_name = solution_data_file, surface_name_list = ["no_slip_walls"], delimiter = "space", location = "cell-center", cell_func_domain = ["Static_Pressure"])
where solution_data_file is a string with the correct file name and path and no_slip_walls is a defined named selction in the mesh file.
The issue I am having is that I don't know what the cell_func_domain list expects as an argument. This should be the list that specifies that I want to export static pressure, x-wall shear stress, etc, but I don't know what format these should be in in the list. I have tried many variations, such as ["Static_Pressure"], ["static_pressure"], ["static pressure"], etc., but I always get an error that the value is not allowed:
RuntimeError: Values contain disallowed entries
Error Object: (Static_Pressure)I could not find any documentation or examples (I searched through the pyfluent documentation and their github) that explain this either, so if anyone knows how the specific quantities are supposed to be specified or where to look for better documentation I would really appreciate it.
Thanks,
Kyle
-
February 5, 2025 at 1:43 pm
V.P
Ansys EmployeePyAnsys project is developed and supported through GitHub. You can post issues and request new features 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
-
- You must be logged in to reply to this topic.
- air flow in and out of computer case
- Varying Bond model parameters to mimic soil particle cohesion/stiction
- Eroded Mass due to Erosion of Soil Particles by Fluids
- I am doing a corona simulation. But particles are not spreading.
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- Issue to compile a UDF in ANSYS Fluent
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
-
3882
-
1414
-
1241
-
1118
-
1015
© 2025 Copyright ANSYS, Inc. All rights reserved.