I would like to calculate the core losses of an electric motor using either the Steinmetz or Bertotti equation.
There seem to be several different ways to do this in Elmer, but I could not get any of them to work, they all calculate 0 core losses despite there being plenty of magnetic flux density.
What is the recommended way to calculate the core losses? Are there any examples available anywhere that could help me figuring out the correct syntax?
What I tried so far:
FourierLossSolver: Based on the documentation I think this is the preferred way.
BSolver: This is obsolete according to the source code, so I probably shouldn't be using this?
!--- SOLVERS ---
Solver 1
Exec Solver = Before Timestep
Equation = MeshDeform
Procedure = "RigidMeshMapper" "RigidMeshMapper"
End
Solver 2
Equation = MgDyn2D
Procedure = "MagnetoDynamics2D" "MagnetoDynamics2D"
Exec Solver = Always
Variable = A
Nonlinear System Convergence Tolerance = 1e-06
Nonlinear System Max Iterations = 100
Nonlinear System Min Iterations = 1
Nonlinear System Newton After Iterations = 5
Nonlinear System Relaxation Factor = 0.9
Nonlinear System Convergence Without Constraints = Logical True
Export Lagrange Multiplier = Logical True
Linear System Abort Not Converged = Logical False
Linear System Solver = Direct
Linear System Direct Method = umfpack
Optimize Bandwidth = Logical True
Linear System Preconditioning = ILU2
Linear System Max Iterations = 5000
Linear System Residual Output = 20
Linear System Convergence Tolerance = 1e-07
Mortar BCs Additive = Logical True
! BertottiCompute = Logical True
End
Solver 3
Exec Solver = Always
Equation = CalcFields
Potential Variable = "A"
Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
Calculate Nodal Forces = Logical True
Calculate Magnetic Vector Potential = Logical True
Calculate Winding Voltage = Logical True
Calculate Current Density = Logical True
Calculate Maxwell Stress = Logical True
Calculate JxB = Logical True
Calculate Magnetic Field Strength = Logical True
End
Solver 4
Exec Solver = After Timestep
Procedure = "ResultOutputSolve" "ResultOutputSolver"
Output File Name = "step"
Vtu Format = True
Binary Output = False
Single Precision = True
Save Geometry Ids = True
Show Variables = True
End
Solver 5
Exec Solver = After Timestep
Filename = "scalars.dat"
Procedure = "SaveData" "SaveScalars"
Show Norm Index = 1
End
Solver 6
Equation = "Fourier"
Exec Solver = Always
Procedure = "FourierLoss" "FourierLossSolver"
Target Variable = "A"
! Target Variable Direct = Logical True
! Target Variable = "Magnetic Flux Density"
Fourier Loss Filename = File "Loss.dat"
Fourier Series Components = Integer 3!25
!Base frequency for Fourier transform
Frequency = Real 1
! Fourier Start Cycles = Integer 1
! Fourier Start Time = Real 0.00
! Averaging over this much cycles
! Fourier Integrate Cycles = Integer 30
! Discontinuous Galerkin = Logical True
Calculate Elemental Fields = Logical True
! Inexact Integration = Logical False
! Simpsons Rule = Logical True
Harmonic Loss Field Exponent(3) = Real 1.776 2.0 1.5
Harmonic Loss Frequency Exponent(3) = Real 1.0 2.0 1.5
Linear System Solver = Iterative
Linear System Iterative Method = BicgStabl ! GCR !
Linear System GCR Restart = 500
Bicgstabl Polynomial Degree = 4
Linear System Preconditioning = ILU0
Linear System Max Iterations = 1500
Linear System Residual Output = Integer 20
Linear System Convergence Tolerance = 1e-7 ! 2.0e-6
Separate Loss Components = Logical True
Fourier Series Output = Logical True
End
Another thing I found a bit confusing that Fourier Loss Filename specified in the Fourier Solver section never gets created, but the fourier loss gets written into the SaveScalars results file instead.
In material section I have defined loss coefficients. I have two equations, the second equation has the FourierLossSolver. Equation 2 is applied only to core bodies.
Material 2
include BH.dat
Harmonic Loss Coefficient 1 = Real $ C_h
Harmonic Loss Coefficient 2 = Real $ C_e
End
Body 1
Name = StCore
Equation = 2
Material = 2
End
Body 2
Name = RtCore
Equation = 2
Material = 2
Body Force = 2
Torque Groups = Integer 1
End
Equation 1 :: Active Solvers(3) = 2 3 4
Equation 2 :: Active Solvers(4) = 2 3 4 9
Solver 9
Exec Solver = Always
Equation = FourierLoss
Procedure = "FourierLoss" "FourierLossSolver"
Target Variable = A
Frequency = Real $ f
Fourier Start Time = Real $ start_time
Fourier Integrate Cycles = Integer 1
Separate Loss Components = Logical True
Fourier Series Components = Integer 2
Fourier Loss Filename = File $ res_file_fourierloss
Harmonic Loss Frequency Exponent 1 = Real $ alpha_h
Harmonic Loss Frequency Exponent 2 = Real $ alpha_e
Harmonic Loss Field Exponent 1 = Real $ beta_h
Harmonic Loss Field Exponent 2 = Real $ beta_e
End
I think you can also drop these from mgdyn2d solver as you have direct solver
Linear System Abort Not Converged = Logical False
Linear System Preconditioning = ILU2
Linear System Max Iterations = 5000
Linear System Residual Output = 20
Linear System Convergence Tolerance = 1e-07
I just realised that the reason my core losses using the FourierLossSolver were 0 was because I didn't actually run the simulation for a full cycle. That's also why the Fourier Loss File didn't get generated.
I am now getting non-0 losses and the profile looks reasonable at first sight, I will do a bit more investigating to see if the absolute values are correct.
I had a go at comparing the results vs an ANSYS Maxwell model. There's a few things I'm a bit unsure about.
My model is 90° periodic. To get the correct loss value I need to multiply the result calculated by FourierLossSolver by 4 (to make up for periodicity) and the core length, right?
I'm not sure what value I should pick for "Fourier Series Components". The results seem to be quite sensitive to that value (particularly on the rotor).
I got a sinusoidal current excitation on the stator windings. Presumably the FourierLossSolver frequency should be the same?
@vencels: My excitatoin is sinusoidal, so I think the generalized equation is not required.
Add this solver after calc fields. It will compute time-dependent core loss.
Add core loss properties in solver:
Solver ...
Equation = "MGDynamicsCalc"
Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
Linear System Symmetric = True
Potential Variable = String "AV"
Calculate Current Density = Logical True
Calculate Joule Heating = Logical True
Steady State Convergence Tolerance = 0
Linear System Solver = "Iterative"
Linear System Preconditioning = None
Linear System Residual Output = 1000
Linear System Max Iterations = 5000
Linear System Iterative Method = CG
Steady State Convergence Tolerance = 1e-8
Linear System Convergence Tolerance = 1.0e-8
Separate Magnetic Energy = Logical True Calculate Harmonic Loss = Logical True
Harmonic Loss Linear Frequency Exponent = Real 1.4
Harmonic Loss Linear Exponent = Real 2.5
Calculate Relative Permeability = Logical True
End
and in the core material:
Material 3
Name = "Ferrite"
Electric Conductivity = Variable Temperature, LossFactor
Real MATC "0.2/(1+0.0*(tx(0)-20))/tx(1)"
Relative Permittivity = Real 1.0
Relative Permeability = 2300.0 Harmonic Loss Linear Coefficient = Real 0.0168
Harmonic Loss Quadratic Coefficient = Real 0.0
Heat Conductivity = 4.0
Density = Real 4800.0
End
Add the solver ProcessFields as following:
Solver ...
Procedure = "ProcessFields" "ProcessFields"
Equation = post process data
Update Exported Variables = Logical True
Exported Variable 1 = -dg "LoadWkg"
Exported Variable 2 = -dg "LoadWm3"
Exported Variable 3 = -dg "BT"
End
I will be very thankful if you could share your comparison with any other means of calculation.
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0x7f21d62ddd21 in ???
#1 0x7f21d62dcef5 in ???
#2 0x7f21d610e08f in ???
#3 0x7f21ce3a2faf in processfields_
at /home/kevin/monumo/elmer/validation/si_iron_loss/ProcessFields.F90:105
#4 0x7f21d683f359 in __mainutils_MOD_singlesolver
at /build/elmerfem-csc-GRiY2M/elmerfem-csc-8.4-0ppa0/fem/src/MainUtils.F90:5365
#5 0x7f21d6854d08 in __mainutils_MOD_solveractivate
at /build/elmerfem-csc-GRiY2M/elmerfem-csc-8.4-0ppa0/fem/src/MainUtils.F90:5616
#6 0x7f21d685676e in solvecoupled
at /build/elmerfem-csc-GRiY2M/elmerfem-csc-8.4-0ppa0/fem/src/MainUtils.F90:3264
#7 0x7f21d6857b53 in __mainutils_MOD_solveequations
at /build/elmerfem-csc-GRiY2M/elmerfem-csc-8.4-0ppa0/fem/src/MainUtils.F90:2964
#8 0x7f21d6ab8205 in execsimulation
at /build/elmerfem-csc-GRiY2M/elmerfem-csc-8.4-0ppa0/fem/src/ElmerSolver.F90:3079
#9 0x7f21d6abf68a in elmersolver_
at /build/elmerfem-csc-GRiY2M/elmerfem-csc-8.4-0ppa0/fem/src/ElmerSolver.F90:607
#10 0x560c70f033f5 in solver
at /build/elmerfem-csc-GRiY2M/elmerfem-csc-8.4-0ppa0/fem/src/Solver.F90:57
#11 0x560c70f0315e in main
at /build/elmerfem-csc-GRiY2M/elmerfem-csc-8.4-0ppa0/fem/src/Solver.F90:34
^C
[1]+ Segmentation fault ElmerSolver case_gse.sif > LOG-Elmer
Any idea why? I'm not sure what Line105 in ProcessFields does.
$ WM = 2*pi*1500/60 ! Mechanical Frequency [rad/s]
$ PP = 2 ! Pole pairs
$ WE = PP*WM ! Electrical Frequency [Hz]
$ H_PM = 920000 ! Magnetization at 20 deg C [A/m]
$ Shift = 2*pi/3 ! N-phase machine [rad]
$ Gamma = -2*pi/180 ! Current Angle [rad]
$ Ncond = 1 ! Conductors per coil
$ Cp = 1 ! Parallel paths
$ Is = 4.2425*35*sqrt(2) ! Stator current [A]
$ Aaxis = 0.0 ! Axis Coil A [deg]
$ Carea = 5.749662468156698e-05 ! Coil Side Conductor Area [m2]
$ Mangle1 = 45.0 ! Magnetization Angle [deg]
$ Nsteps = 2 !
$ StepDegrees = 1 !
$ DegreesPerSec = WM*180.0/pi !
$ RotorInitPos = 0
!Custom KB
$ rpm = 1500
$ f = rpm/60*PP
$ rot_dir = 1
$ dir_ph0 = 1
$ dir_ph1 = 1
$ dir_ph2 = -1
Header
CHECK KEYWORDS Warn
Mesh DB "."
Include Path "."
Results Directory "results_gse"
End
Constants
Permittivity of Vacuum = 8.8542e-12
End
Simulation
Max Output Level = 4
Coordinate System = Cartesian 2D
Coordinate Scaling = 1.0
Simulation Type = Transient
Timestepping Method = BDF
BDF Order = 2
Timestep Sizes = 3.33e-04
Timestep Intervals = 120
Use Mesh Names = Logical True
End
!--- MATERIALS ---
Material 1
Name = "Air"
Relative Permeability = 1
Electric Conductivity = 0
Density = Real 1.0
End
Material 2
Name = "Insulation"
Relative Permeability = 1
Electric Conductivity = 0
Density = Real 1.0
End
Material 3
Name = "LaminationMaterial"
Include "m350-50a_20c.pmf"
Density = Real 4800.0
Heat Conductivity = 4.0
Relative Permittivity = Real 1.0
Relative Permeability = 2300.0
Harmonic Loss Linear Coefficient = Real 0.0168
Harmonic Loss Quadratic Coefficient = Real 0.0
End
Material 4
Name = "RotorMaterial"
Include "m350-50a_20c.pmf"
Density = Real 1.0
End
Material 5
Name = "Copper"
Relative Permeability = 1
Electric Conductivity = 0 !58000000
Density = Real 1.0
End
Material 6
Name = "PM_1"
Relative Permeability = 1.03
Magnetization 1 = Variable time, timestep size
Real MATC "H_PM*cos(rot_dir*WM*(tx(0)-tx(1)) + 0*pi/PP + 0*pi + (RotorInitPos + Mangle1)*pi/180)"
Magnetization 2 = Variable time, timestep size
Real MATC "H_PM*sin(rot_dir*WM*(tx(0)-tx(1)) + 0*pi/PP + 0*pi + (RotorInitPos + Mangle1)*pi/180)"
Electric Conductivity = 625000.0 !0
Density = Real 1.0
End
!--- BODY FORCES ---
Body Force 1
Name = "BodyForce_Rotation"
Mesh Rotate 3 = Variable time, timestep size
Real MATC "RotorInitPos+rot_dir*(tx(0)-tx(1))*DegreesPerSec"
End
Body Force 2
Name = "Phase_0_BF_2"
Current Density = Variable time, timestep size
Real MATC "dir_ph0*Is/Carea*sin((tx(0)-tx(1))*2*pi*f-0*2*pi/3)"
End
Body Force 3
Name = "Phase_1_BF_3"
Current Density = Variable time, timestep size
Real MATC "dir_ph1*Is/Carea*sin((tx(0)-tx(1))*2*pi*f-1*2*pi/3)"
End
Body Force 4
Name = "Phase_2_BF_4"
Current Density = Variable time, timestep size
Real MATC "dir_ph2*Is/Carea*sin((tx(0)-tx(1))*2*pi*f-2*2*pi/3)"
End
!--- BODIES ---
Body 1
Name = STA-0_Lam
Equation = 2
Material = 3
End
Body 2
Name = STA-0_Wind_R0-T0-S0
Equation = 1
Material = 5
Body Force = 2
End
Body 3
Name = STA-0_Wind_R0-T0-S1
Equation = 1
Material = 5
Body Force = 2
End
Body 4
Name = STA-0_Wind_R0-T0-S2
Equation = 1
Material = 5
Body Force = 4
End
Body 5
Name = STA-0_Wind_R0-T0-S3
Equation = 1
Material = 5
Body Force = 4
End
Body 6
Name = STA-0_Wind_R0-T0-S4
Equation = 1
Material = 5
Body Force = 3
End
Body 7
Name = STA-0_Wind_R0-T0-S5
Equation = 1
Material = 5
Body Force = 3
End
Body 8
Name = Airgap_Stator
Equation = 1
Material = 1
End
Body 9
Name = Airbox
Equation = 1
Material = 1
End
Body 10
Name = ROT-0_Lam
Equation = 2
Material = 3
Body Force = 1
Torque Groups = Integer 1
End
Body 11
Name = ROT-0_HV_R0-T0-S0
Equation = 1
Material = 1
Body Force = 1
Torque Groups = Integer 1
End
Body 12
Name = ROT-0_HM_R0-T0-S0
Equation = 1
Material = 6
Body Force = 1
Torque Groups = Integer 1
End
Body 13
Name = ROT-0_HV_R0-T1-S0
Equation = 1
Material = 1
Body Force = 1
Torque Groups = Integer 1
End
Body 14
Name = None_Shaft
Equation = 1
Material = 1
Body Force = 1
Torque Groups = Integer 1
End
Body 15
Name = Airgap_Rotor
Equation = 1
Material = 1
Body Force = 1
End
Equation 1
Name = "Model_Domain"
Active Solvers(6) = 1 2 3 4 5 6
End
Equation 2
Name = "Lamination"
Active Solvers(7) = 1 2 3 4 5 6 7
End
!--- SOLVERS ---
Solver 1
Exec Solver = Before Timestep
Equation = MeshDeform
Procedure = "RigidMeshMapper" "RigidMeshMapper"
End
Solver 2
Equation = MgDyn2D
Procedure = "MagnetoDynamics2D" "MagnetoDynamics2D"
Exec Solver = Always
Variable = A
Nonlinear System Convergence Tolerance = 1e-02
Nonlinear System Max Iterations = 100
Nonlinear System Min Iterations = 1
! Nonlinear System Newton After Iterations = 5
Nonlinear System Relaxation Factor = 0.9
Nonlinear System Convergence Without Constraints = Logical True
Export Lagrange Multiplier = Logical True
Linear System Abort Not Converged = Logical False
Linear System Solver = Direct
Linear System Direct Method = umfpack
! Linear System Solver = Iterative
! Linear System Iterative Method = BiCGStab
Optimize Bandwidth = Logical True
Linear System Preconditioning = ILU2
Linear System Max Iterations = 5000
Linear System Residual Output = 20
Linear System Convergence Tolerance = 1e-07
Mortar BCs Additive = Logical True
! BertottiCompute = Logical True
End
Solver 3
Exec Solver = Always
Equation = CalcFields
Potential Variable = "A"
Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
Calculate Nodal Forces = Logical True
Calculate Magnetic Vector Potential = Logical True
Calculate Winding Voltage = Logical True
Calculate Current Density = Logical True
Calculate Maxwell Stress = Logical True
Calculate JxB = Logical True
Calculate Magnetic Field Strength = Logical True
Calculate Harmonic Loss = Logical True
Harmonic Loss Linear Frequency Exponent = Real 1.4
Harmonic Loss Linear Exponent = Real 2.5
Calculate Joule Heating = Logical True
Separate Magnetic Energy = Logical True
Calculate Relative Permeability = Logical True
End
Solver 4
Exec Solver = After All
Procedure = "ResultOutputSolve" "ResultOutputSolver"
Output File Name = "step"
Vtu Format = True
Binary Output = False
Single Precision = True
Save Geometry Ids = True
Show Variables = True
End
Solver 5
Exec Solver = After Timestep
Equation = SaveLine
Filename = "lines.dat"
Procedure = "SaveData" "SaveLine"
Variable 1 = Magnetic Flux Density 1
Variable 2 = Magnetic Flux Density 2
Variable 3 = Magnetic Flux Density 3
Variable 4 = Magnetic Flux Density e 1
Variable 5 = Magnetic Flux Density e 2
Variable 6 = Magnetic Flux Density e 3
End
Solver 6
Exec Solver = After Timestep
Filename = "scalars.dat"
Procedure = "SaveData" "SaveScalars"
Show Norm Index = 1
End
Solver 7
Procedure = "ProcessFields" "ProcessFields"
Equation = post process data
Update Exported Variables = Logical True
Exported Variable 1 = -dg "LoadWkg"
Exported Variable 2 = -dg "LoadWm3"
Exported Variable 3 = -dg "BT"
End
!--- BOUNDARIES ---
Boundary Condition 1
Name = SB_Rotor_BOUNDARY
End
Boundary Condition 2
Name = Rotor-Right_BOUNDARY
Mortar BC = Integer 3
Mortar BC Static = Logical True
Anti Radial Projector = Logical True
Galerkin Projector = Logical True
End
Boundary Condition 3
Name = Rotor-Left_BOUNDARY
End
Boundary Condition 4
Name = SB_Stator_BOUNDARY
Mortar BC = Integer 1
Anti Rotational Projector = Logical True
Galerkin Projector = Logical True
Save Line = True
End
Boundary Condition 5
Name = Domain_BOUNDARY
A = Real 0
End
Boundary Condition 6
Name = Stator-Right_BOUNDARY
Mortar BC = Integer 7
Mortar BC Static = Logical True
Anti Radial Projector = Logical True
Galerkin Projector = Logical True
End
Boundary Condition 7
Name = Stator-Left_BOUNDARY
End