! PMSM 2D Magneto-Static Simulation
! Parameters
$ w_m = 3000/60*2*pi ! [rad/s mech.] mechanical frequency
$ pp = 2 ! number of polepairs
$ w_el = w_m*pp ! [rad/s el.] electrical frequency
$ B_PM = 1.17 ! [T] remanent flux density
$ mu_PM = 1.06 ! relative permeability of PMs
$ H_PM = B_PM/(mu_PM*pi*4d-7) ! [A/m] magnetization of PMs
$ Id = 0 ! [A] d-axis current
$ Iq = 0 ! [A] q-axis current
$ Nph = 186 ! Number of phase turns
$ Scs = 0.00154555 ! [m^2] area of the coil side
Header
CHECK KEYWORDS Warn
Mesh DB "PMSM" "."
Include Path ""
Results Directory "results"
End
Constants
Permittivity of Vacuum = 8.8542e-12
End
Simulation
Max Output Level = 3
Coordinate System = Cartesian
Coordinate Scaling = 0.001
Simulation Type = Transient
Timestepping Method = BDF
BDF Order = 2
Timestep Sizes = $ 1/(w_el/2/pi)/6/30! 180 samples per el. period
Timestep Intervals = 31
Output Intervals = 1
!!!!!!!! mesh interpolation tolerances
Interpolation Numeric Epsilon = Real 5.0e-9
End
!!!!!!!!!!!!!!!!!!!!!!!!!! Materials !!!!!!!!!!!!!!!!!!!!!!!!!!!
Material 1
Name = "Air"
Relative Permeability = 1
End
Material 2
Name = "Iron"
! actually B-H values are in the file BH (name is H-B, but values are in B-H format)
H-B Curve = Variable coupled iter
Real Monotone Cubic
Include BH
End
End
Material 3
Name = "PM_right"
Relative Permeability = $ mu_PM
Magnetization 1 = Variable time, timestep size
Real MATC "H_PM*cos(w_m*(tx(0)-tx(1)))"
Magnetization 2 = Variable time, timestep size
Real MATC "H_PM*sin(w_m*(tx(0)-tx(1)))"
End
Material 4
Name = "PM_up"
Relative Permeability = $ mu_PM
Magnetization 1 = Variable time, timestep size
Real MATC "-H_PM*sin(w_m*(tx(0)-tx(1)))"
Magnetization 2 = Variable time, timestep size
Real MATC "H_PM*cos(w_m*(tx(0)-tx(1)))"
End
Material 5
Name = "PM_left"
Relative Permeability = $ mu_PM
Magnetization 1 = Variable time, timestep size
Real MATC "-H_PM*cos(w_m*(tx(0)-tx(1)))"
Magnetization 2 = Variable time, timestep size
Real MATC "-H_PM*sin(w_m*(tx(0)-tx(1)))"
End
Material 6
Name = "PM_down"
Relative Permeability = $ mu_PM
Magnetization 1 = Variable time, timestep size
Real MATC "H_PM*sin(w_m*(tx(0)-tx(1)))"
Magnetization 2 = Variable time, timestep size
Real MATC "-H_PM*cos(w_m*(tx(0)-tx(1)))"
End
Material 7
Name = "Wedge"
Relative Permeability = 1
End
!!!!!!!!!!!!!!!!!!!!!!!!!! Boundary conditions !!!!!!!!!!!!!!!!!!!!!!!!!!!
!outer boundary Dirichlet
Boundary Condition 1
Target Boundaries(1) = 1
Name = "Boundary_Outer"
Potential Condition = 0
Potential = 0
End
Boundary Condition 2
Target Boundaries(1) = 2
Name = "Sliding"
Discontinuous Boundary = Logical True
Save Line = True
Mortar BC = 3
End
!!!!!!!!!!!!!!!!!!!!!!!!!! Body Forces !!!!!!!!!!!!!!!!!!!!!!!!!!!
!rotation of the rotor
Body Force 1
Name = "BodyForce_Rotation"
Mesh Rotate 3 = Variable time, timestep size
Real MATC "180/pi*w_m*(tx(0)-tx(1))" ! in degrees
End
!!!!!!!!!!!!!!!!!!!!!!!!!! Solver parameters !!!!!!!!!!!!!!!!!!!!!!!!!!!
!mesh rotation
Solver 1
Exec Solver = Before Timestep
Equation = MeshDeform
Procedure = "RigidMeshMapper" "RigidMeshMapper"
End
! solver for magnetic vector potential A [Vs/m]
Solver 2
Equation = MgDyn2D
Procedure = "MagnetoDynamics2D" "MagnetoDynamics2D"
Exec Solver = Always
Nonlinear System Convergence Tolerance = 1.0e-6
Nonlinear System Max Iterations = 20
Nonlinear System Relaxation Factor = 1
Linear System Solver = Direct
Linear System Direct Method = UMFPACK
End
!solver for magnetic flux density B [T]
!does not require settings for nonlinear solver
Solver 3
Equation = MgDyn2DPost
Procedure = "MagnetoDynamics2D" "BSolver"
Exec Solver = After Timestep
Linear System Solver = Direct
Linear System Direct Method = UMFPACK
Discontinuous Galerkin = True
Average Within Materials = False
End
!save to VTU format for ParaView with faces' IDs
Solver 4
Exec Solver = After Timestep
Procedure = "ResultOutputSolve" "ResultOutputSolver"
Output File Name = "step"
Vtu Format = True
Binary Output = True
Single Precision = True
Save Geometry Ids = True
End
!save scalar variables - torque T [Nm]
Solver 5
Exec Solver = After Timestep
Filename = "scalars.dat"
Procedure = "SaveData" "SaveScalars"
Show Norm Index = 1
End
Equation 1
Name = "ModelDomain"
Active Solvers(5) = 1 2 3 4 5
End
!!!!!!!!!!!!!!!!!!!!!!!!!! Bodies are here !!!!!!!!!!!!!!!!!!!!!!!!!!!
Body 1
Target Bodies(1) = 1
Name = "U+"
Equation = 1
Material = 1
End
Body 2
Target Bodies(1) = 2
Name = "U-"
Equation = 1
Material = 1
End
Body 3
Target Bodies(1) = 3
Name = "V+"
Equation = 1
Material = 1
End
Body 4
Target Bodies(1) = 4
Name = "V-"
Equation = 1
Material = 1
End
Body 5
Target Bodies(1) = 5
Name = "W+"
Equation = 1
Material = 1
End
Body 6
Target Bodies(1) = 6
Name = "W-"
Equation = 1
Material = 1
End
Body 7
Target Bodies(1) = 7
Name = "stator lamination"
Equation = 1
Material = 2
End
Body 8
Target Bodies(1) = 8
Name = "rotor lamination"
Equation = 1
Material = 2
Body Force = 1
End
Body 9
Target Bodies(1) = 9
Name = "wedges"
Equation = 1
Material = 7
End
Body 10
Target Bodies(1) = 10
Name = "shaft"
Equation = 1
Material = 1
Body Force = 1
End
Body 11
Target Bodies(1) = 11
Name = "PM1"
Equation = 1
Material = 3
Body Force = 1
End
Body 12
Target Bodies(1) = 12
Name = "PM2"
Equation = 1
Material = 6
Body Force = 1
End
Body 13
Target Bodies(1) = 13
Name = "PM3"
Equation = 1
Material = 5
Body Force = 1
End
Body 14
Target Bodies(1) = 14
Name = "PM4"
Equation = 1
Material = 4
Body Force = 1
End
Body 15
Target Bodies(1) = 15
Name = "stator airgap"
Equation = 1
Material = 1
End
Body 16
Target Bodies(1) = 16
Name = "rotor airgap"
Equation = 1
Material = 1
Body Force = 1
r outer = Real 0.0406
r inner = Real 0.040
End