Hi Peter

Thank you so much for the advices!

I have tried the FourierSolver, but it calculates the loss at least after one or several rotational periods.

Actually, I want to optimize the motor with less calculation cost.

Hence, I tried the time-step method to calculate the hysteresis loss and eddy-current loss in each time-step, based on the reference

"V. Raulin, A. Radun and I. Husain, “Modeling of losses in switched reluctance machines,” IEEE Trans. Ind. Appl., vol. 40, no. 6, pp. 1560-1569, Nov/Dec 2004."

The principle is not very difficult.

If the core loss can be calculated in each time-step, less time steps are requried.

Today, I found the "CalcFields solver" sloves B field and tried to add a subroutine to solve the core loss in CalcFields.F90. A new variable is defined in the Solver 2 of the sif:

- Code: Select all
`Solver 2`

Exec Solver = Always

Equation = MgDyn2D

Variable = A

Exported Variable 1 = -global -dofs 1 P_hys

Procedure = "MagnetoDynamics2D" "MagnetoDynamics2D"

Stabilize = False

Partition Local Constraints = Logical True

Nonlinear System Compute Change in Scaled System = Logical True

Nonlinear System Convergence Measure = Residual

Nonlinear System Convergence Tolerance = 1e-6

Nonlinear System Max Iterations = 20

Nonlinear System Min Iterations = 1

Nonlinear System Relaxation Factor = 1.0

Nonlinear System Newton After Iterations = 7

Export Lagrange Multiplier = Logical True

Linear System Abort Not Converged = False

Linear System Solver = Iterative

Linear System Iterative Method = GCR

Linear System GCR Restart = 500

Bicgstabl Polynomial Degree = 4

Linear System Preconditioning = ILU4

Linear System Max Iterations = 1500

Linear System Residual Output = Integer 20

Linear System Convergence Tolerance = 1e-7

Mortar BCs Additive = Logical True

End

Solver 3

Exec Solver = Always

Equation = CalcFields

Potential Variable = "A"

Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"

Calculate Nodal Forces = Logical True

Calculate Magnetic Torque = Logical True

Calculate Magnetic Force = Logical True

Calculate Current Density = Logical True

Calculate Magnetic Vector Potential = Logical True

Frequency = Real $ f

Linear System Solver = Direct

Linear System Iterative Method = MUMPS

End

Solver 4

Exec Solver = After timestep

Equation = "ResultOutput"

Procedure = "ResultOutputSolve" "ResultOutputSolver"

Output File Name = case

Output Directory = results_5krpm

Save Geometry Ids = Logical True

Vtu Format = Logical True

End

Solver 5

Exec Solver = After timestep

Equation = scalars

Procedure = "SaveData" "SaveScalars"

Filename = transient_results.dat

Output Directory = results_5krpm

Variable 1 = Time

End

The "Exported Variable 1 = -global -dofs 1 P_hys" is declared, but the variable is not outputed in the VTU file.

It seems that the defined variable in sif is not linked with the pointer in solver subroutine.

And the calculated results in the subroutine is not linked with the solver variable. So I guess this is the reason why it is not outputed in the VTU file.

Thank you again for your hints. Maybe I should try to call the B field in another defined solver, instead of revising the "CalcFields.F90".

If it works, I will upload the solver code here. In case anyone needs that.