Two magnets covered by a layer of insulator material (stiff plastic) are coming into contact with each other (snapping) due to electromagnetic forces. This example shows how magnets can be simulated using the EM solver and how dynamic motion due to magnetic forces can be simulated. It uses the FEM-BEM monolithic magnetostatics solver (used for zero-conductivity ferromagnetic materials) and a AMS preconditionner.
Two magnets covered by a layer of insulator material (stiff plastic) are coming into contact with each other (snapping) due to electromagnetic forces. This example shows how magnets can be simulated using the EM solver and how dynamic motion due to magnetic forces can be simulated. It uses the FEM-BEM monolithic magnetostatics solver (used for zero-conductivity ferromagnetic materials) and a AMS preconditionner.
*CONTROL_TERMINATION *CONTROL_TIMESTEP *DATABASE_BINARY_D3PLOT *DEFINE_CURVE_TITLE *EM_CIRCUIT *EM_CONTROL *EM_CONTROL_COUPLING *EM_CONTROL_TIMESTEP *EM_MAT_001 *EM_MAT_002 *EM_OUTPUT *EM_PERMANENT_MAGNET *EM_SOLVER_BEM *EM_SOLVER_BEMMAT *EM_SOLVER_FEM *EM_SOLVER_FEMBEM_MONOLITHIC *END *KEYWORD *MAT_RIGID *PARAMETER *PART *SECTION_SOLID *TITLE
*keyword $ **************************************************************************** $ electromagnetism $ **************************************************************************** *EM_CONTROL $--------1---------2---------3---------4---------5---------6---------7---------8 $ emsol numls dt 1 &emdt &em_femmtx&em_bemmtx *EM_CONTROL_COUPLING ,2 *EM_SOLVER_FEM $--------1---------2---------3---------4---------5---------6---------7---------8 $ reltol maxiter stype precon uselast ncyclfem msglvlFem 1.e-4 10000 1 1 1 0 *EM_SOLVER_BEM $--------1---------2---------3---------4---------5---------6---------7---------8 $ reltol maxiter solvetype precon uselast ncyclbem &btol 10000 2 2 1 $*EM_SOLVER_FEMBEM $$--------1---------2---------3---------4---------5---------6---------7---------8 $$ reltol maxiter forcon $ 1.e-6 50 3 *EM_SOLVER_BEMMAT $--------1---------2---------3---------4---------5---------6---------7---------8 $ matId relTol 1 &ptol *EM_SOLVER_BEMMAT $--------1---------2---------3---------4---------5---------6---------7---------8 $ matId relTol 2 &qtol *EM_SOLVER_BEMMAT $--------1---------2---------3---------4---------5---------6---------7---------8 $ matId relTol 3 &wtol *EM_PERMANENT_MAGNET $--------1---------2---------3---------4---------5---------6---------7---------8 $ ID Part ID - North South M=0.38/mu0 1 1 1 2 9.e5 *DEFINE_CURVE 100, 0,9.e5 5e-3,9.e5 1.,9.e5 *EM_PERMANENT_MAGNET $--------1---------2---------3---------4---------5---------6---------7---------8 $ ID Part ID - North South M=0.38/mu0 3 3 3 4 9.e5 *EM_MAT_002 $ Magnetic material 1 $ mid mtype sigma eosid murel eosmu 1 4 0. 0 &murel1 $ 1 4 &sigma1 0 &murel1 *EM_MAT_002 $ Magnetic material 2 $--------1---------2---------3---------4---------5---------6---------7---------8 $ mid mtype sigma eosid murel eosmu 3 4 0. 0 &murel3 $ 3 4 &sigma3 0 &murel3 *EM_MAT_001 $ Dummy coil material $--------1---------2---------3---------4---------5---------6---------7---------8 $ mid mtype sigma eosid 2 1 *EM_MAT_001 $ Dummy coil material $--------1---------2---------3---------4---------5---------6---------7---------8 $ mid mtype sigma eosid 4 1 *EM_OUTPUT $--------1---------2---------3---------4---------5---------6---------7---------8 $ matS matF solS solF mesh memory timing d3plotAsc 2 2 2 2 0 0 0 $ mf2 gmv d3plotFor timeHist 0 1 0 *EM_SOLVER_FEMBEM_MONOLITHIC $--------1---------2---------3---------4---------5---------6---------7---------8 $ COUPLING KSP_TYPE KSP_ATOL KSP_RTOL KSP_MAXIT GMRES_RST FEM_PC DEBUG 0 1.e-9 1.e-5 100000 1 $--------1---------2---------3---------4---------5---------6---------7---------8 $ FORCE NEWT_STOL NEWT_ATOL NEWT_RTOL NEWT_MAXI 1.e-9 1.e-9 1.e-5 $--------1---------2---------3---------4---------5---------6---------7---------8 $ LS_ON LS_FTOL LS_GTOL LS_RTOL LS_SAMPL LS_NUM_SP LS_MAXFUN 1 1.e-9 0.01 1.e-5 30000 $--------1---------2---------3---------4---------5---------6---------7---------8 $$USE_ENERG STOP_ERR WIDTH_ERR XTRAPF $ *EM_EOS_PERMEABILITY $ eostype=1 --> B = B(H), eostype=2 --> H = H(B) $--------1---------2---------3---------4---------5---------6---------7---------8 $ eosid eostype lcid 101 2 102 *DEFINE_CURVE $ Dummy current $ LCID SIDR SFA SFO OFFA OFFO DATTYP $--------1---------2---------3---------4---------5---------6---------7 999 0.0 0.000,0.00 9.000,0.00 $ *define_curve $B=B(H) 101 0.0,0.00000 1757.0,0.01287 3515.0,0.14758 4173.0,0.15738 5894.0,0.16830 8640.0,0.18008 12348.0,0.19246 16935.0,0.20516 22297.0,0.21789 28313.0,0.23036 34847.0,0.24230 41751.0,0.25343 48870.0,0.26350 138035.0,0.38115 227200.0,0.49880 316364.0,0.61645 405529.0,0.73410 494694.0,0.85175 583859.0,0.96940 673024.0,1.08705 762188.0,1.20470 851353.2,1.32235 940518.0,1.43999 $ *define_curve $ H=H(B) 102 0.0,0.00000 0.01287,1757.0 0.14758,3515.0 0.15738,4173.0 0.16830,5894.0 0.18008,8640.0 0.19246,12348.0 0.20516,16935.0 0.21789,22297.0 0.23036,28313.0 0.24230,34847.0 0.25343,41751.0 0.26350,48870.0 0.38115,138035.0 0.49880,227200.0 0.61645,316364.0 0.73410,405529.0 0.85175,494694.0 0.96940,583859.0 1.08705,673024.0 1.20470,762188.0 1.32235,851353.2 1.43999,940518.0 $ *DEFINE_CURVE 333 0.,1. 0.04,1. 0.04001,-1. 1.,-1. *end