Open lijinlong0308 opened 2 weeks ago
Hi @lijinlong0308,
What do you mean the API doesn't work? Could you paste your code snippet? it will help me understand what you are trying to do.
Thanks,
Giulia
import os import tempfile import time
import ansys.aedt.core
AEDT_VERSION = "2024.2" NUM_CORES = 4 NG_MODE = True # Open AEDT UI when it is launched.
#
temp_folder.name
.temp_folder = './'
#
project_name = os.path.join(temp_folder, "AFSM-bench.aedt") rmxprt = ansys.aedt.core.Rmxprt( version=AEDT_VERSION, new_desktop=True, close_on_exit=True, solution_type="APSM", project=project_name, non_graphical=NG_MODE, )
rmxprt.general["Source Type"] = "DC" rmxprt.general["Structure"] = "Axial-Flux Rotor" rmxprt.general["Stator Type"] = "AXIAL_AC" rmxprt.general["Rotor Type"] = "AXIAL_PM" rmxprt.general["Double-Sided"] = "None" rmxprt.general["Air Gap Length"] = "1mm"
#
rmxprt.stator["Number of Poles"] = 12 rmxprt.stator["Number of Slots"] = 15 rmxprt.stator["Circuit Type"] = "Y3" rmxprt.stator["Slot Type"] = 3 rmxprt.stator.properties.children["Core"].props["Outer Diameter"] = "120mm" rmxprt.stator.properties.children["Core"].props["Inner Diameter"] = "70mm" rmxprt.stator.properties.children["Core"].props["Length"] = "25mm" rmxprt.stator.properties.children["Core"].props["Stacking Factor"] = 0.95 rmxprt.stator.properties.children["Core"].props["Steel Type"] = [ "Material:=", "steel_1008", ]
rmxprt.stator.properties.children["Core"].children["Slot"].props["Auto Design"] = False rmxprt.stator.properties.children["Core"].children["Slot"].props["Hs0"] = "1.5mm" rmxprt.stator.properties.children["Core"].children["Slot"].props["Hs1"] = "2mm" rmxprt.stator.properties.children["Core"].children["Slot"].props["Hs2"] = "13mm" rmxprt.stator.properties.children["Core"].children["Slot"].props["Bs0"] = "3mm" rmxprt.stator.properties.children["Core"].children["Slot"].props["Bs1"] = "8mm" rmxprt.stator.properties.children["Core"].children["Slot"].props["Bs2"] = "8mm" rmxprt.stator.properties.children["Core"].children["Slot"].props["Rs"] = "0.4mm" rmxprt.stator.properties.children["Winding"].props["Winding Layers"] = 2 rmxprt.stator.properties.children["Winding"].props["Parallel Branches"] = 1 rmxprt.stator.properties.children["Winding"].props["Conductors per Slot"] = 48 rmxprt.stator.properties.children["Winding"].props["Coil Pitch"] = 1 rmxprt.stator.properties.children["Winding"].props["Number of Strands"] = 1 rmxprt.stator.properties.children["Winding"].props["Conductor Type"] = [ "Material:=", "copper", ]
rmxprt.stator.properties.children["Circuit"].props["Control Type"] = "DC" rmxprt.stator.properties.children["Circuit"].props["Trigger Pulse Width"] = "120deg" rmxprt.stator.properties.children["Circuit"].props["Transistor Drop"] = "0.7V" rmxprt.stator.properties.children["Circuit"].props["Diode Drop"] = "0.7V"
#
rmxprt.rotor["Number of Poles"] = 12 rmxprt.rotor.properties.children["Core"].props["Outer Diameter"] = "120mm" rmxprt.rotor.properties.children["Core"].props["Inner Diameter"] = "70mm" rmxprt.rotor.properties.children["Core"].props["Length"] = "15mm" rmxprt.rotor.properties.children["Core"].props["Steel Type"] = [ "Material:=", "steel_1008", ] rmxprt.rotor.properties.children["Core"].props["Stacking Factor"] = 0.95 rmxprt.rotor.properties.children["Core"].children["Pole"].props["Embrace"] = 0.9 rmxprt.rotor.properties.children["Core"].children["Pole"].props["Magnet Type"] = [ "Material:=", "NdFe35", ] rmxprt.rotor.properties.children["Core"].children["Pole"].props["Magnet Thickness"] = "8mm" rmxprt.rotor.properties.children["Core"].children["Pole"].props["Magnet Length"] = "25mm"
rmxprt.shaft["Magnetic Shaft"] = False rmxprt.shaft["Frictional Loss"] = "12W" rmxprt.shaft["Windage Loss or Power"] = "12W" rmxprt.shaft["Reference Speed"] = "3000rpm"
#
setup = rmxprt.create_setup() setup["name"] ="MySetupAuto" setup.props["Enabled"] = True setup.props["OperationType"] = "Motor" setup.props["LoadType"] = "Const Power" setup.props["RatedOutputPower"] = "2.5kW" setup.props["RatedVoltage"] = "220V" setup.props["RatedSpeed"] = "3900rpm" setup.props["OperatingTemperature"] = "75cel" setup.update() rmxprt.analyze() rmxprt.export_profile(setup) exported_files = rmxprt.get_traces_for_plot() print(exported_files) rmxprt.save_project()
Hi @lijinlong0308,
I'd suggest first to test this example in graphical mode so you can actually see what is going on in AEDT. Then I'd suggest to debug the code to see which properties you can access in an axial flux machine. My IDE of choice is PyCharm and if I debug I can see this: Could you please check in graphical mode if you are actually analyzing an axial flux machine and which errors do you get?
Thanks,
Giulia
Dear all, How can I extract the results from an analyzed RMxprt project with python code? the APIs seems not work. Best, Jinlong