Questions about elmer-elmag-main/PermanentMagnetMachine2D

Numerical methods and mathematical models of Elmer
Post Reply
FFF
Posts: 36
Joined: 11 Jun 2021, 11:00
Antispam: Yes

Questions about elmer-elmag-main/PermanentMagnetMachine2D

Post by FFF »

Hi everyone,

I am trying to run the examples provided here:
https://github.com/ElmerCSC/elmer-elmag ... tMachine2D

I get the following errors trying to run case.sif

Code: Select all

ELMER SOLVER (v 9.0) STARTED AT: 2024/05/10 10:35:09
ParCommInit:  Initialize #PEs:            1
MAIN: 
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 9.0 (Rev: unknown, Compiled: 2024-05-06)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN:  HYPRE library linked in.
MAIN:  MUMPS library linked in.
MAIN:  Lua interpreter linked in.
MAIN: =============================================================
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: case.sif
LoadInputFile: Scanning input file: case.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
CheckKeyword: Found keyword type assuming suffix 1 for: harmonic loss coefficient 2
CheckKeyword: Found keyword type assuming suffix 1 for: harmonic loss coefficient 2
CheckKeyword: Found keyword type assuming suffix 1 for: variable 2
CheckKeyword: Found keyword type assuming suffix 1 for: variable 2
CheckKeyword: Found keyword type assuming suffix 1 for: variable 3
CheckKeyword: Found keyword type assuming suffix 1 for: variable 3
CheckKeyword: Found keyword type assuming suffix 1 for: variable 4
CheckKeyword: Found keyword type assuming suffix 1 for: variable 4
CheckKeyword: Found keyword type assuming suffix 1 for: variable 5
CheckKeyword: Found keyword type assuming suffix 1 for: variable 5
CheckKeyword: Found keyword type assuming suffix 1 for: variable 6
CheckKeyword: Found keyword type assuming suffix 1 for: variable 6
LoadInputFile: Loading input file: case.sif
LoadInputFile: Reading base load of sif file
CheckKeyword: Found keyword type assuming suffix 1 for: harmonic loss coefficient 2
CheckKeyword: Found keyword type assuming suffix 1 for: harmonic loss coefficient 2
CheckKeyword:  Unlisted keyword: [torque groups] in section: [body 10]
CheckKeyword:  Unlisted keyword: [torque groups] in section: [body 11]
CheckKeyword:  Unlisted keyword: [torque groups] in section: [body 12]
CheckKeyword:  Unlisted keyword: [torque groups] in section: [body 13]
CheckKeyword:  Unlisted keyword: [torque groups] in section: [body 14]
CheckKeyword:  Unlisted keyword: [calculate windinging voltage] in section: [solver 3]
CheckKeyword: Found keyword type assuming suffix 1 for: variable 2
CheckKeyword: Found keyword type assuming suffix 1 for: variable 2
CheckKeyword: Found keyword type assuming suffix 1 for: variable 3
CheckKeyword: Found keyword type assuming suffix 1 for: variable 3
CheckKeyword: Found keyword type assuming suffix 1 for: variable 4
CheckKeyword: Found keyword type assuming suffix 1 for: variable 4
CheckKeyword: Found keyword type assuming suffix 1 for: variable 5
CheckKeyword: Found keyword type assuming suffix 1 for: variable 5
CheckKeyword: Found keyword type assuming suffix 1 for: variable 6
CheckKeyword: Found keyword type assuming suffix 1 for: variable 6
CheckKeyword:  Unlisted keyword: [separate loss components] in section: [solver 7]
CheckKeyword:  Unlisted keyword: [harmonic loss frequency exponent 1] in section: [solver 7]
CheckKeyword:  Unlisted keyword: [harmonic loss frequency exponent 2] in section: [solver 7]
CheckKeyword:  Unlisted keyword: [harmonic loss field exponent 1] in section: [solver 7]
CheckKeyword:  Unlisted keyword: [harmonic loss field exponent 2] in section: [solver 7]
CheckKeyword:  Unlisted keyword: [a] in section: [boundary condition 5]
LoadInputFile: Number of BCs: 7
LoadInputFile: Number of Body Forces: 4
LoadInputFile: Number of Initial Conditions: 0
LoadInputFile: Number of Materials: 6
LoadInputFile: Number of Equations: 2
LoadInputFile: Number of Solvers: 7
LoadInputFile: Number of Bodies: 15
WARNING:: LoadInputFile: > Material 2 < not used in any Body!
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by area
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by volume
ElmerAsciiMesh: Base mesh name: mesh
MapCoordinates: Scaling coordinates: 1.000E+00 1.000E+00 1.000E+00
ReadTargetNames: Reading names info from file: mesh/mesh.names
ReadTargetNames: Mapped 7 body names to indexes
ReadTargetNames: Mapped 15 bc names to indexes
WARNING:: ListFind: 
WARNING:: ListFind:  Requested property: [Equation], not found
WARNING:: ListFind: 
WARNING:: ListFind: 
WARNING:: ListFind:  Requested property: [Equation], not found
WARNING:: ListFind: 
MAIN: -------------------------------------
OptimizeBandwidth: Initial bandwidth for mgdyn2d: 4354
OptimizeBandwidth: Optimized bandwidth for mgdyn2d: 123
OptimizeBandwidth: Initial bandwidth for calcfields: 4354
OptimizeBandwidth: Optimized bandwidth for calcfields: 123
FourierLossSolver: Computing elemental fields only by default when neither given!
OptimizeBandwidth: Initial bandwidth for fourierloss: 1691
OptimizeBandwidth: Optimized bandwidth for fourierloss: 64
MAIN: Number of timesteps to be saved: 121
MAIN: 
MAIN: -------------------------------------
MAIN: Time: 1/121:   3.330E-04
MAIN: -------------------------------------
MAIN: 
RigidMeshMapper: ---------------------------------------
RigidMeshMapper: Performing analytic mesh mapping
RigidMeshMapper: ---------------------------------------
StoreOriginalCoordinates: Original coordinates already stored
RigidMeshMapper:  Number of nodes mapped:         2128
RigidMeshMapper: All done
PeriodicProjector: Elapsed REAL time:     0.0003 (s)
PeriodicProjector: Elapsed REAL time:     0.0067 (s)
PeriodicProjector: Elapsed REAL time:     0.0003 (s)
MagnetoDynamics2D: ------------------------------------------------
MagnetoDynamics2D: Solving equation for magnetic vector potential
MagnetoDynamics2D: ------------------------------------------------
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.50024379E-02  2.0000000     ) :: mgdyn2d
ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.44693624E-02 0.11256055     ) :: mgdyn2d
ComputeChange: NS (ITER=3) (NRM,RELC): ( 0.49685372E-02 0.10578092     ) :: mgdyn2d
ComputeChange: NS (ITER=4) (NRM,RELC): ( 0.51758953E-02 0.40881152E-01 ) :: mgdyn2d
ComputeChange: NS (ITER=5) (NRM,RELC): ( 0.52114051E-02 0.68371654E-02 ) :: mgdyn2d
ComputeChange: NS (ITER=6) (NRM,RELC): ( 0.52125431E-02 0.21834498E-03 ) :: mgdyn2d
ComputeChange: NS (ITER=7) (NRM,RELC): ( 0.52072229E-02 0.10211744E-02 ) :: mgdyn2d
ComputeChange: NS (ITER=8) (NRM,RELC): ( 0.52040111E-02 0.61699965E-03 ) :: mgdyn2d
ComputeChange: NS (ITER=9) (NRM,RELC): ( 0.52036860E-02 0.62471550E-04 ) :: mgdyn2d
ComputeChange: NS (ITER=10) (NRM,RELC): ( 0.52036240E-02 0.11910910E-04 ) :: mgdyn2d
ComputeChange: NS (ITER=11) (NRM,RELC): ( 0.52035533E-02 0.13586957E-04 ) :: mgdyn2d
ComputeChange: NS (ITER=12) (NRM,RELC): ( 0.52035188E-02 0.66216156E-05 ) :: mgdyn2d
ComputeChange: NS (ITER=13) (NRM,RELC): ( 0.52035129E-02 0.11472730E-05 ) :: mgdyn2d
ComputeChange: NS (ITER=14) (NRM,RELC): ( 0.52035122E-02 0.12795476E-06 ) :: mgdyn2d
MagnetoDynamics2D: Number of elements to compute torque: 712
MagnetoDynamics2D: Air gap correction initial:  0.2281
MagnetoDynamics2D: Air gap correction rotor periods: 4
MagnetoDynamics2D: Air gap correction:  0.0570
WARNING:: GetPermittivity: Permittivity not defined in material, defaulting to that of vacuum
ERROR:: SolveLinearSystem: Give "Linear System Solver", e.g. "linear" or "direct"
In the section of solver 2 the line Linear System Solver = Direct is provided.
Equally this error happens for the case_ coarse. Only the case_coarse_opt.sif leads to a result. The only thing I see so far is that the latter uses LUA and the prior uses MATC? From my understanding this is manly a matter of computation time? What could be the reason that I get this error?

The case_3d. sif also converges and I get results. But observing the content of the . sif I am wondering what is the use of Boundary 8 and 9 (see below)? These conditions do not point to any geometrical entity or other BC. What is their purpose?

Code: Select all

Boundary Condition 8
  AV  = Real 0
  AV {e} = Real 0
  AV {f} = Real 0
End
Boundary Condition 9
  AV  = Real 0
  AV {e} = Real 0
  AV {f} = Real 0
End


Any hint is appreciated!

Best regards,

Felix
kevinarden
Posts: 2403
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Questions about elmer-elmag-main/PermanentMagnetMachine2D

Post by kevinarden »

I just ran the 2d and did not get any errors. I also did not get these warnings
WARNING:: ListFind:
WARNING:: ListFind: Requested property: [Equation], not found
WARNING:: ListFind:
WARNING:: ListFind:
WARNING:: ListFind: Requested property: [Equation], not found
WARNING:: ListFind:

Did you edit the sif file?
FFF
Posts: 36
Joined: 11 Jun 2021, 11:00
Antispam: Yes

Re: Questions about elmer-elmag-main/PermanentMagnetMachine2D

Post by FFF »

Thank you for your message!

I did a fresh download of the elmer-elmag repository but still get the same error.

The case.sif which I use is this one:

Code: Select all

$ WM = 2*pi*1500/60        ! Mechanical Frequency [rad/s]
$ PP = 2                ! Pole pairs
$ H_PM = 920000              ! Magnetization at 20 deg C [A/m]
$ Is = 4.2425*35*sqrt(2)                ! Stator current * Number of turns [A]
$ Carea = 5.749662468156698e-05             ! Coil Side Conductor Area [m2]
$ Mangle1 = 45.0     ! Magnetization Angle [deg]
$ DegreesPerSec = WM*180.0/pi  !
$ RotorInitPos = 0 ! Initial Rotor Position
$ rpm = 1500 ! Rotational speed (1/min)
$ f = rpm/60*PP ! Electrical frequency (Hz)
$ rot_dir = 1 ! Direction of rotation. 1: CCW, -1: CW
$ dir_ph0 = 1 ! Current direction of Phase 0
$ dir_ph1 = 1 ! Current direction of Phase 1
$ dir_ph2 = -1 ! Current direction of Phase 2

Header
	CHECK KEYWORDS Warn
	Mesh DB "mesh"
	Include Path "."
	Results Directory "results"
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 = 121
	Use Mesh Names = Logical True
End

!--- MATERIALS ---
Material 1
	Name = "Air"
	Relative Permeability = 1
	Electric Conductivity = 0
End

Material 2
	Name = "Insulation"
	Relative Permeability = 1
	Electric Conductivity = 0
End

Material 3
	Name = "StatorMaterial"
	Include "m350-50a_20c.pmf"

	! C1 Hysteresis k_h
	Harmonic Loss Coefficient 1 = Real 159.9615
	! C2 Eddy currents k_e
	Harmonic Loss Coefficient 2 = Real 0.934621628891
	! ! C3 Excessive k_a
	! Harmonic Loss Coefficient 3 = Real 0
End

Material 4
	Name = "RotorMaterial"
	Include "m350-50a_20c.pmf"

	! C1 Hysteresis k_h
	Harmonic Loss Coefficient 1 = Real 159.9615
	! C2 Eddy currents k_e
	Harmonic Loss Coefficient 2 = Real 0.934621628891
	! ! C3 Excessive k_a
	! Harmonic Loss Coefficient 3 = Real 0
End

Material 5
	Name = "Copper"
	Relative Permeability = 1
	Electric Conductivity = 0 !58000000
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
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 = Stator-0_Lamination
	Equation = 2
	Material = 3
End

Body 2
	Name = Stator-0_Winding_R0-T0-S0
	Equation = 1
	Material = 5
	Body Force = 2
End

Body 3
	Name = Stator-0_Winding_R0-T0-S1
	Equation = 1
	Material = 5
	Body Force = 2
End

Body 4
	Name = Stator-0_Winding_R0-T0-S2
	Equation = 1
	Material = 5
	Body Force = 4
End

Body 5
	Name = Stator-0_Winding_R0-T0-S3
	Equation = 1
	Material = 5
	Body Force = 4
End

Body 6
	Name = Stator-0_Winding_R0-T0-S4
	Equation = 1
	Material = 5
	Body Force = 3
End

Body 7
	Name = Stator-0_Winding_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 = Rotor-0_Lamination
	Equation = 2
	Material = 4
	Body Force = 1
	Torque Groups = Integer 1
End

Body 11
	Name = Rotor-0_HoleVoid_R0-T0-S0
	Equation = 1
	Material = 1
	Body Force = 1
	Torque Groups = Integer 1
End

Body 12
	Name = Rotor-0_HoleMag_R0-T0-S0
	Equation = 1
	Material = 6
	Body Force = 1
	Torque Groups = Integer 1
End

Body 13
	Name = Rotor-0_HoleVoid_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 = "Laminations"
	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-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
	! 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
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 Windinging 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
	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
  Exec Solver = Always
  Equation = FourierLoss
  Procedure = "FourierLoss" "FourierLossSolver"
  Target Variable = A

  Frequency = Real $ f

  Fourier Start Time = Real 0
  Fourier Integrate Cycles = Integer 1
  Separate Loss Components = Logical True

  Fourier Series Components = Integer 24 ! Should be >= Number of slots
  Fourier Loss Filename = File "results/loss.dat"

  Harmonic Loss Frequency Exponent 1 = Real 1.0
  Harmonic Loss Frequency Exponent 2 = Real 2.0

  Harmonic Loss Field Exponent 1 = Real 2.0
  Harmonic Loss Field Exponent 2 = Real 2.0
End

!--- BOUNDARIES ---
Boundary Condition 1
	Name = SB_Rotor
End

Boundary Condition 2
	Name = Rotor-Right
	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
End

Boundary Condition 4
	Name = SB_Stator
	Mortar BC = Integer 1
	Anti Rotational Projector = Logical True
	Galerkin Projector = Logical True
	Save Line = True
End

Boundary Condition 5
	Name = Domain
	A = Real 0
End

Boundary Condition 6
	Name = Stator-Right
	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
End

Does it differ from the one which you used?

Do you have any idea what the purpose of Boundary Condition 8 and 9 is in the case_3d.sif?

Best regards,

Felix
kevinarden
Posts: 2403
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Questions about elmer-elmag-main/PermanentMagnetMachine2D

Post by kevinarden »

No I used the case_2.5d.sif.

If I use case.sif I get the same error, I do not know why.

I do not know what the extra BCs are in the 3d, they do not appear to be used.
FFF
Posts: 36
Joined: 11 Jun 2021, 11:00
Antispam: Yes

Re: Questions about elmer-elmag-main/PermanentMagnetMachine2D

Post by FFF »

Adding the following lines to Solver 3 (MagnetoDynamicsCalcFields) solves the issue with 2D.

Code: Select all

Solver 3
[...]
	Linear System Solver = Direct
	Linear System Direct Method = umfpack
End

This is interesting because the .sifs utilizing LUA, (i.e case_coarse_opt.sif and case_2.5d.sif) do not seem to require these lines. Why is that?

BR,

Felix
FFF
Posts: 36
Joined: 11 Jun 2021, 11:00
Antispam: Yes

Re: Questions about elmer-elmag-main/PermanentMagnetMachine2D

Post by FFF »

Boundary Condition 8 and 9 (in the case_3d.sif) must have a purpose. If I deactivate them the obtained results of torque and flux density are not plausible. Please see the figures below.
Bfield.png
(122.36 KiB) Not downloaded yet
I greatly appreciate, if anybody could provide an answer on how these BC can be understood.

Kind regards,

Felix
Post Reply