TAGGED: #fluent-#cfd-#ansys, fluent, python, python-scripting
-
-
December 10, 2023 at 9:56 pm
Christopher Mifflin
SubscriberVersion: Fluent 2022R2
I have a simualtion setup already. Using pyFluent, I'm able to read it in, and run the simulation without changing the boundary conditions. However, when I try to change the boundary conditions, it throws a CAR error and haults the scrip execution.
This is the command that ends up aborting execution:Â
solver.setup.boundary_conditions.pressure_far_field['cv_inlet'](m = 3.0, t = 230)Here is the output:
Traceback (most recent call last):
 File "c:/pyFluent/Work/fluenttest.py", line 8, in
 File "C:\ProgramData\Anaconda2021_05\lib\site-packages\ansys\fluent\core\solver\flobject.py", line 405, in __call__
  self.set_state(kwargs)
 File "C:\ProgramData\Anaconda2021_05\lib\site-packages\ansys\fluent\core\solver\flobject.py", line 262, in set_state
  return self.flproxy.set_var(self.path, self.to_scheme_keys(state))
 File "C:\ProgramData\Anaconda2021_05\lib\site-packages\ansys\fluent\core\services\settings.py", line 102, in _fn
  return fn(self, *args, **kwds)
 File "C:\ProgramData\Anaconda2021_05\lib\site-packages\ansys\fluent\core\services\settings.py", line 168, in set_var
  self._service_impl.set_var(request)
 File "C:\ProgramData\Anaconda2021_05\lib\site-packages\ansys\fluent\core\services\error_handler.py", line 15, in func
  raise RuntimeError(ex.details()) from None
RuntimeError: CAR: invalid argument [1]: wrong type [not a pair]
Error Object: 3This command does execute:
print(solver.setup.boundary_conditions.pressure_far_field())output:{'cv_inlet': {'p': {'option': 'constant or expression', 'constant': 0}, 'm': {'option': 'constant or expression', 'constant': 2.5}, 't': {'option': 'constant or expression', 'constant': 300}, 'coordinate_system': 'Cartesian (X, Y, Z)', 'ni': {'option': 'constant or expression', 'constant': 0.9063077869999999}, 'nj': {'option': 'constant or expression', 'constant': 0.4226182620000001}, 'nk': {'option': 'constant or expression', 'constant': 0}, 'flow_direction_component': [{'option': 'constant or expression', 'constant': 0.9063077869999999}, {'option': 'constant or expression', 'constant': 0.4226182620000001}, {'option': 'constant or expression', 'constant': 0}], 'ke_spec': 'Intensity and Viscosity Ratio', 'turb_intensity': 0.05, 'turb_viscosity_ratio': 10}, 'cv_exit': {'p': {'option': 'constant or expression', 'constant': 0}, 'm': {'option': 'constant or expression', 'constant': 2.5}, 't': {'option': 'constant or expression', 'constant': 300}, 'coordinate_system': 'Cartesian (X, Y, Z)', 'ni': {'option': 'constant or expression', 'constant': 0.9063077869999999}, 'nj': {'option': 'constant or expression', 'constant': 0.4226182620000001}, 'nk': {'option': 'constant or expression', 'constant': 0}, 'flow_direction_component': [{'option': 'constant or expression', 'constant': 0.9063077869999999}, {'option': 'constant or expression', 'constant': 0.4226182620000001}, {'option': 'constant or expression', 'constant': 0}], 'ke_spec': 'Intensity and Viscosity Ratio', 'turb_intensity': 0.05, 'turb_viscosity_ratio': 10}}ÂI'm perplexed as I've seen a very similar command in a pyfluent training video:solver.setup.boundary_conditions.velocity_inlet['velocity_inlet_1'](vmag = 1, t = 300).ÂI realize I'm solving a sim with different boundary condition types, but the syntax should be similar. Anyone know what's going on? -
December 11, 2023 at 2:45 pm
Supreetha J
Forum ModeratorHello,Â
PyAnsys 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
Thank you.
-
December 12, 2023 at 1:29 pm
Rob
Forum ModeratorPressure farfield also needs the gas density to be ideal gas, did you set that first?Â
-
- The topic ‘trying to automate boundary conditions using pyfluent and setup simulation’ is closed to new replies.
-
3597
-
1208
-
1092
-
1068
-
952
© 2025 Copyright ANSYS, Inc. All rights reserved.