What function allows you to compute Aerodynamic Forces?
solver.solution.report_definitions.drag['cd-mon1'] = {"zones" : ["wall_ahmed_body_main", "wall_ahmed_body_front", "wall_ahmed_body_rear", "wheels"]} solver.solution.report_definitions.lift['cl-mon1'] = {"zones" : ["wall_ahmed_body_main", "wall_ahmed_body_front", "wall_ahmed_body_rear", "wheels"]} solver.tui.define.parameters.output_parameters.create('force', 'cd-mon1', 'force', 'wall_ahmed_body_main', 'wall_ahmed_body_rear', 'wall_ahmed_body_front', 'wheels', '()', '1', '0', '0') solver.tui.define.parameters.output_parameters.create('force', 'cl-mon1', 'force', 'wall_ahmed_body_front', 'wall_ahmed_body_rear', 'wall_ahmed_body_main', 'wheels', '()', '0', '1', '0') solver.parameters.output_parameters.report_definitions['parameter-1'] = {"report_definition" : "cd-mon1"} solver.parameters.output_parameters.report_definitions['parameter-2'] = {"report_definition" : "cl-mon1"} #Running sim solver.solution.initialization.initialization_type = "hybrid" solver.solution.initialization.hybrid_initialize() solver.solution.run_calculation.iterate(iter_count = 20) drag_val = solver.solution.report_definitions["cd-mon1"].compute() lift_val = solver.solution.report_definitions["cl-mon1"].compute() print("Drag Force: ", drag_val) print("\nLift Force: ", lift_val) print("\nDrag Coefficent: ", drag_val/(0.5*1.225*reference_area**2)) print("\nLift Cofficent: ", lift_val/(0.5*1.225*reference_area**2)) solver.exit()
In this code, the second I get to solver.solution.report_definitions["cd-mon1"].compute() I get an error. It says something like "force_child doesn't have the attribute compute()". I'm not sure what the correct function to receive the drag and lift is, so any if you have any extra info I'll be very grateful.
Best Answer
-
Hi
Perhaps the below helps.
Think line 13 is not correct - missing .drag (see here: https://fluent.docs.pyansys.com/version/stable/api/solver/_autosummary/settings/report_definitions.html).
In addition see this post on how to use compute():
0
Answers
-
Hello Erik,
When I click https://fluent.docs.pyansys.com/version/stable/api/solver/_autosummary/settings/report_definitions.html,
I get a 404 error. Also, I tried using these two lines, but they didn't work.drag_val = solver.solution.report_definitions.drag["cd-mon1"].compute() drag_val = solver.solution.report_definitions["cd-mon1"].drag()
0 -
(Actually nevermind about the 404 error, there was just an extra ')' in your link)
0 -
And nevermind about it not working, I just tried using the correct compute implementation and it all worked out. Thank you!
0