What function allows you to compute Aerodynamic Forces?

CoolHarrison
CoolHarrison Member Posts: 18
10 Comments
**
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

Answers