## Periodic BC instead of mortar for sliding mesh

Numerical methods and mathematical models of Elmer
mb5
Posts: 20
Joined: 10 Jun 2017, 18:07
Antispam: Yes

### Periodic BC instead of mortar for sliding mesh

Hi all,

I'm simulating an electrical machine. The results are good but the convergence is very bad with mortar for the sliding mesh ( see viewtopic.php?f=3&t=4652&sid=b5bd00e8ee ... f4528b99d8). Often I couldn't get the solver converging.

My question: Is it possible to replace the mortar BC for the sliding airgap mesh with periodic boundaries? I have a structured mesh. In every timestep the nodes from moving part matching the nodes of the fixed part. In which way I have to modify the boundary condition?

Best regard
Martin

Code: Select all

``````\$ p = 1             ! pole pairs
\$ dangle = 45       ! angle for d-axis in degree
\$ skew_angle = 00   ! skewing angle in degree
\$ skew_length = 100 ! base length for skewing (epM: stack length)

\$ speed = 1000      ! rotational speed in rpm
\$ N_period = 1      ! number of electrical periods
\$ Nsteps = 45       ! number of steps

\$ w_mech = 2.0*pi*speed/60.0
\$ T = 1.0/(speed/60.0*p)*N_period
\$ dt = T / Nsteps
\$ Rs = 1.0          ! resistance coil side
\$ Nc = 100          ! number of turns per coil
\$ Acs = 20*40*1e-6  ! surface of the coil sides
\$ curr = 0.0  !20

CHECK KEYWORDS Warn
Mesh DB "mesh" "."
Include Path ""
Results Directory "results"
End

Simulation
Max Output Level = 3
Coordinate System = "Cartesian 3D"
Coordinate Scaling = 0.001

Simulation Type = Transient
Timestep Size = \$dt
Timestep Intervals = \$Nsteps+1
Timestepping Method = BDF
BDF order = 2

Steady State Max Iterations = 1
Output Intervals = 100
Use Mesh Names = Logical True
End

!!!!!!!!!!!!!!!!!!!!!!!!!!  Materials !!!!!!!!!!!!!!!!!!!!!!!!!!!
Material 1
Name = "Air"
Relative Permeability = 1
End

Material 2
Name = "iron"
Relative Permeability = 1000
End

Material 3
Name = "Ferritband"
Relative Permeability = 1.05
Magnetization 1 = 187196.5283
Magnetization 2 = 0
Magnetization 3 = 0
End

!!!!!!!!!!!!!!!!!!!!!!!!!!  Boundary conditions  !!!!!!!!!!!!!!!!!!!!!!!!!!!
Boundary Condition 1
Target Boundaries(15) = 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Name = "Boundary_Outer"
AV {e} = Real 0
End

Boundary Condition 2
Target Boundaries(1) = 1
Name = "airgap"
Discontinuous Boundary = Logical True
Mortar BC = 3
Galerkin Projector = Logical True      ! programm error on step 2
Rotational Projector = Logical True    ! too much mesh skew
Projector Skip Nodes = Logical True
End

!!!!!!!!!!!!!!!!!!!!!!!!!!  Body Forces  !!!!!!!!!!!!!!!!!!!!!!!!!!!
Body Force 1
Name = "BodyForce_Rotation"
Mesh Rotate 3 = Variable time, timestep size
Real MATC "180/pi*w_mech*(tx(0)-tx(1))" ! in degrees
End

Body Force 2
Name = "BodyForce_Rotation"
Mesh Rotate 3 = Variable time, timestep size
Real MATC "180/pi*w_mech*(tx(0)-tx(1))" ! in degrees
Current Density 1 = Real 0
Current Density 2 = Real 0
Current Density 3 = Real MATC "curr/Acs*Nc"
End

Body Force 3
Name = "BodyForce_Rotation"
Mesh Rotate 3 = Variable time, timestep size
Real MATC "180/pi*w_mech*(tx(0)-tx(1))" ! in degrees
Current Density 1 = Real 0
Current Density 2 = Real 0
Current Density 3 = Real MATC "-curr/Acs*Nc"
End

!!!!!!!!!!!!!!!!!!!!!!!!!!  Solver parameters !!!!!!!!!!!!!!!!!!!!!!!!!!!

!mesh rotation
Solver 1
Exec Solver = Before Timestep
Equation = MeshDeform
Procedure = "RigidMeshMapper" "RigidMeshMapper"
End

Solver 2
Equation = "MGDynamics"
Variable = "AV"
Procedure = "MagnetoDynamics" "WhitneyAVSolver"

! Fix Input Current Density = Logical True
!// Export Lagrange Multiplier = Logical True

Nonlinear System Convergence Tolerance = 1.0e-4   !// 1.0e-8
Nonlinear System Max Iterations = 1  !// 50
Nonlinear System Relaxation Factor = 1
Newton-Raphson Iteration = Logical True
Linear System Solver = "Iterative"
Linear System Preconditioning = ILU1
Linear System Residual Output = 20
Linear System Max Iterations = 3000
Linear System Iterative Method = BiCGStab2
BicGStabL Polynomial Degree = 4
Linear System GCR Restart = 600
Linear System Convergence Tolerance = 1e-8    ! 1e-10
Linear System Abort Not Converged = False

Steady State Convergence Tolerance = 1e-09

Edge Basis = Logical True
!// Apply Mortar BCs = Logical True
Optimize Bandwidth = False
End

Solver 3
Equation = "MGDynamicsCalc"
Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
Linear System Symmetric = True
Potential Variable = "AV"

Calculate Magnetic Field Strength = Logical True
Calculate Current Density = Logical True
Calculate nodal forces = logical true
Calculate Magnetic Vector Potential = Logical True

Linear System Solver = "Iterative"
Linear System Preconditioning = ILU1
Linear System Residual Output = 20
Linear System Max Iterations = 3000
Linear System Iterative Method = BiCGStab2
BicGStabL Polynomial Degree = 4
Linear System GCR Restart = 600
Linear System Convergence Tolerance = 1e-8    ! 1e-10
Linear System Abort Not Converged = False

Steady State Convergence Tolerance = 1e-6
Discontinuous Bodies = True
Apply Mortar BCs = True
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
save component results = logical True
End

Component 1
Name = string "inner"
Master Bodies(3) = integer  5 6 7

!// Calculate Magnetic Force = Logical True
Calculate Magnetic Torque = Logical True
End

Component 2
Name = string "outer"
Master Bodies(2) = integer 1 2
Calculate Magnetic Torque = Logical True
End

Equation 1
Name = "ModelDomain"
Active Solvers(5) = 1 2 3 4 5
End

!!!!!!!!!!!!!!!!!!!!!!!!!!  Bodies are here !!!!!!!!!!!!!!!!!!!!!!!!!!!
Body 1
Name = "yoke"
Equation = 1
Material = 2
End

Body 2
Name = "magnet"
Equation = 1
Material = 3
End

Body 3
Name = "air2"
Equation = 1
Material = 1
End

Body 4
Name = "air1"
Equation = 1
Material = 1
Body Force = 1
End

Body 5
Name = "core"
Equation = 1
Material = 2
Body Force = 1
End

Body 6
Name = "c1"
Equation = 1
Material = 1
Body Force = 2
End

Body 7
Name = "c2"
Equation = 1
Material = 1
Body Force = 3
End

``````
Attachments
mesh.zip