Skip to content
Snippets Groups Projects
Commit f7edf46e authored by fontchas5's avatar fontchas5
Browse files

ajout dossier

parent 95c9c41f
Branches
No related tags found
No related merge requests found
Function{
// Materiau magnetique
// Ferrite
Mat_h = {0.000000, 44.635198, 47.996938, 54.360481, 57.254136, 63.513926, 66.205407,
83.184012, 128.638642, 150.321852, 280.295679, 307.761975, 317.501481,
486.037901, 775.608272, 869.477778, 1359.072840, 1373.269136, 2431.451852,
5699.176543, 6389.154321, 8458.007407, 61532.617284, 73419.641975,
197003.703704, 321027.901235, 324350.000000};
Mat_b = {0.000000, 0.068851, 0.079231, 0.096630, 0.104285, 0.117920, 0.123374, 0.150912,
0.191749, 0.202635, 0.239024, 0.243936, 0.245556, 0.267244, 0.290565, 0.296190,
0.312896, 0.313356, 0.335942, 0.364839, 0.368482, 0.376766, 0.477117, 0.494881,
0.666990, 0.828539, 0.832720};
// XC10
If (TypFe == 2)
Mat_h = {0, 43.92451, 87.84902, 145.3502, 214.3516, 297.1533, 396.5154, 515.7499,
658.8312, 830.5289, 1036.566, 1283.811, 1580.504, 1936.536, 2363.775, 2876.462,
3491.686, 4229.955, 5115.877, 6178.984, 7454.712, 8985.587, 10822.64, 13027.09,
15672.45, 18846.87, 22656.17, 27227.34, 32712.74, 35984.02} ;
Mat_b = {0, 0.1116464, 0.2104877, 0.3239492, 0.4408211, 0.5592701, 0.6773683, 0.7932189,
0.9050798, 1.011466, 1.111222, 1.203555, 1.288032, 1.364557, 1.433316, 1.494722, 1.549358,
1.597921, 1.641505, 1.683981, 1.725604, 1.765532, 1.802967, 1.837184, 1.867554, 1.893545,
1.914713, 1.930682, 1.941108, 1.945219} ;
EndIf
// M800
If ( TypFe == 3 )
Mat_h = { 0, 100, 125, 150, 175, 200, 250, 350, 500, 750, 1000, 1250, 1500, 2000, 2500,
5000, 7500, 10000, 15000, 20000, 40000, 50000, 60000, 70000, 80000, 90000, 100000,
200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000} ;
Mat_b = { 0, 0.57521, 0.80524, 0.99704, 1.14392, 1.21025, 1.30311, 1.39454, 1.45633,
1.50824, 1.54066, 1.56507, 1.58528, 1.61581, 1.64054, 1.72818, 1.79222, 1.84547,
1.92998, 1.99233, 2.07277, 2.09943, 2.12151, 2.14092, 2.15865, 2.17525, 2.19105,
2.33142, 2.46203, 2.59017, 2.71733, 2.84399, 2.97036, 3.09656, 3.22264, 3.34864} ;
EndIf
Mat_b2 = Mat_b()^2;
Mat_nu = Mat_h() / Mat_b();
Mat_nu(0) = Mat_nu(1);
Mat_nu_b2 = ListAlt[Mat_b2(), Mat_nu()] ;
nu_1[] = InterpolationLinear[ SquNorm[$1] ]{ Mat_nu_b2() } ;
dnudb2_1[] = dInterpolationLinear[SquNorm[$1]]{ Mat_nu_b2() } ;
h_1[] = nu_1[$1] * $1 ;
dhdb_1[] = TensorDiag[1,1,1] * nu_1[$1#1] + 2*dnudb2_1[#1] * SquDyadicProduct[#1] ;
dhdb_1_NL[] = 2*dnudb2_1[$1#1] * SquDyadicProduct[#1] ;
Mat_h2 = Mat_h()^2;
Mat_mu = Mat_b() / Mat_h();
Mat_mu(0) = Mat_mu(1);
Mat_mu_h2 = ListAlt[Mat_h2(), Mat_mu()] ;
mu_1[] = InterpolationLinear[ SquNorm[$1] ]{ Mat_mu_h2() } ;
dmudh2_1[] = dInterpolationLinear[SquNorm[$1]]{ Mat_mu_h2() } ;
b_1[] = mu_1[$1] * $1 ;
dbdh_1[] = TensorDiag[1,1,1] * mu_1[$1#1] + 2*dmudh2_1[#1] * SquDyadicProduct[#1] ;
dbdh_1_NL[] = 2*dmudh2_1[$1#1] * SquDyadicProduct[#1] ;
}
// Parametres geometriques
//---------------------------
// noyau electroaimant
hea0 = 3e-2;
rea0 = 1e-2;
// bobine
//dfil = 0.5e-3;
section0 = 0.52e-6;
Ns0 = 150;
kr = 0.6;
// aimant permanent
rap0 = 0.5e-2;
hap0 = 1e-2;
// distance inter-aimants
dia0 = 0.5e-2;
// Parametres physiques
//------------------------
Ibob0 = 10;
Br0 = 1.0;
// Interface graphique
//-----------------------
DefineConstant[
TypFe = {1, Choices {1="Ferrite", 2="XC10", 3="M800"},
Name "Modèle/Paramètres/01Bobine/00 Matériau noyau"},
hea = {hea0*1e3, Min 10, Max 100, Step 1,
Name "Modèle/Paramètres/01Bobine/01Hauteur (en mm)"},
rea = {rea0*1e3, Min 5, Max 50, Step 0.5,
Name "Modèle/Paramètres/01Bobine/02Rayon noyau ferreux (en mm)"},
section = {section0*1e6, Choices {0.11="0,11",0.2="0,2",0.33="0,33",
0.4="0,4",0.52="0,52",0.7="0,7",0.82="0,82",1.1="1,1",1.3="1,3",
1.5="1,5",2.5="2,5",3.3="3,3"},
Name"Modèle/Paramètres/01Bobine/03Section fil (en mm^2)"},
Ns = {Ns0, Min 10, Max 250, Step 5,
Name "Modèle/Paramètres/01Bobine/04Nombre de spires"},
Ibob = {Ibob0, Min 0, Max 50, Step 0.1,
Name "Modèle/Paramètres/01Bobine/05Courant (en A)"},
rap = {rap0*1e3, Min 2.5, Max 25, Step 0.1,
Name "Modèle/Paramètres/02Aimant/01Rayon aimant (en mm)"},
hap = {hap0*1e3, Min 5, Max 50, Step 0.5,
Name "Modèle/Paramètres/02Aimant/02Hauteur aimant (en mm)"},
Br = {Br0, Choices {0.4 = "Ferrite", 0.9="NdFeB 0,9 T",
1.0="NdFeB 1,0 T", 1.1="NdFeB 1,1 T", 1.2="NdFeB 1,2 T"},
Name "Modèle/Paramètres/02Aimant/03Type d'aimant"},
dia = {dia0*1e3, Min 1, Max 50, Step 0.1,
Name "Modèle/Paramètres/03Dispositif/04Distance aimant-bobine (en mm)"}
];
// retour en m :
hea = hea*1e-3;
rea = rea*1e-3;
section = section*1e-6;
rap = rap*1e-3;
hap = hap*1e-3;
dia = dia*1e-3;
// calculs grandeurs annexes
//-----------------------------
htot = hea+dia+hap;
epbob = Ns*section/kr/hea;
jeq = Ns*Ibob/(hea*epbob);
rdom = 1.5*Sqrt[(htot/2)^2+(rea+epbob)^2];
rext = 1.2*rdom;
// Parametres maillage
//----------------------
lc = (rap<epbob)?rap:epbob/25;
lcdom = rdom/25;
nehea = 40;
nerea = 20;
neepbob = 12;
nerap = 20;
nehap = 20;
neent = 25;
// regions physiques
//---------------------
BORD = 500;
STM = 501;
AIR = 1000;
NOY = 1001;
BOB = 1002;
AIM = 1003;
INF = 1004;
Ressources-Onelab/Levitation/levitation/ldc.png

54.5 KiB

// geometrie du probleme
Include "data.geo";
Point(1) = {0,htot/2,0,lc};
Point(2) = {0,htot/2-hea,0,lc};
Point(3) = {rea,htot/2-hea,0,lc};
Point(4) = {rea,htot/2,0,lc};
Point(5) = {rea+epbob,htot/2,0,lc};
Point(6) = {rea+epbob,htot/2-hea,0,lc};
Point(7) = {0,-htot/2,0,lc};
Point(8) = {rap,-htot/2,0,lc};
Point(9) = {rap,-htot/2+hap,0,lc};
Point(10) = {0,-htot/2+hap,0,lc};
Point(11) = {0,rdom,0,lcdom};
Point(12) = {rdom,0,0,lcdom};
Point(13) = {0,-rdom,0,lcdom};
Point(14) = {0,rext,0,lcdom};
Point(15) = {rext,0,0,lcdom};
Point(16) = {0,-rext,0,lcdom};
c = newp;
Point(c) = {0,0,0};
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,1};
Line(5) = {4,5};
Line(6) = {5,6};
Line(7) = {6,3};
Line(8) = {7,8};
Line(9) = {8,9};
Line(10) = {9,10};
Line(11) = {10,7};
Line(12) = {11,1};
Line(13) = {2,10};
Line(14) = {7,13};
Circle(15) = {13,c,12};
Circle(16) = {12,c,11};
Line(17) = {11,14};
Circle(18) = {14,c,15};
Circle(19) = {15,c,16};
Line(20) = {16,13};
Transfinite Line {1,3,6} = nehea+1;
Transfinite Line {2,4} = nerea+1;
Transfinite Line {5,7} = neepbob+1;
Transfinite Line {8,10} = nerap+1;
Transfinite Line {9,11} = nehap+1;
Transfinite Line {13,12,14} = neent+1;
Line Loop(1) = {1,2,3,4};
Plane Surface(1) = {1};
Line Loop(2) = {5,6,7,3};
Plane Surface(2) = {2};
Line Loop(3) = {8,9,10,11};
Plane Surface(3) = {3};
Line Loop(4) = {12,-4,5,6,7,-2,13,-10,-9,-8,14,15,16};
Plane Surface(4) = {4};
Line Loop(5) = {15,16,17,18,19,20};
Plane Surface(5) = {5};
//Transfinite Surface {1,2,3};
Physical Surface(NOY) = {1};
Physical Surface(BOB) = {2};
Physical Surface(AIM) = {3};
Physical Surface(AIR) = {4};
Physical Surface(INF) = {5};
Physical Line(BORD) = {18,19,1,13,11,14,12,17,20};
Physical Line(STM) = {8,9,10};
Color White { Surface{4,5}; }
Color Gray { Surface{1}; }
Color Red { Surface{2}; }
Color Blue { Surface{3}; }
\ No newline at end of file
// resolution du probleme
Include "data.geo";
Group{
Domaine = Region[{NOY,BOB,AIM,AIR,INF}];
Air = Region[{AIR}];
Fer = Region[{NOY}];
NonMag = Region[{BOB,AIM,AIR,INF}];
Bobine = Region[{BOB}];
Aimant = Region[{AIM}];
BoiteInf = Region[{INF}];
Bord = Region[{BORD}];
STenseur = Region[{STM}];
Vol_Force = Region[Air, OnOneSideOf STenseur] ;
}
Include "BH.pro";
Function{
mu0 = 4e-7*Pi;
//mur = 500;
//nu[#{NonMag}] = 1.0/mu0;
//nu[#{Fer}] = 1.0/(mu0*mur);
nu[#{NonMag}] = 1.0/mu0;
nu[#{Fer}] = nu_1[$1];
dhdb_NL[#{Fer}] = dhdb_1[$1];
j[#{Bobine}] = Vector[0,0,-jeq];
br[#{Aimant}] = Vector[0,Br,0];
TM[] = ( SquDyadicProduct[$1] - SquNorm[$1] * TensorDiag[0.5, 0.5, 0.5] ) * nu[] ;
}
Jacobian{
{ Name Jvol;
Case {
{ Region BoiteInf ; Jacobian VolAxiSquSphShell{rdom, rext}; }
{ Region All ; Jacobian VolAxiSqu ; }
}
}
}
Integration{
{ Name Integ;
Case {
{Type Gauss;
Case {
{ GeoElement Line ; NumberOfPoints 2; }
{ GeoElement Triangle ; NumberOfPoints 6; } }
}
}
}
}
Constraint {
{ Name Dirichlet ;
Case {
{ Region Bord ; Type Assign ; Value 0. ; }
}
}
{ Name TenseurAimant ;
Case {
{ Region STenseur ; Value 1. ; }
}
}
}
FunctionSpace {
{ Name Hrot ; Type Form1 ;
BasisFunction {
{ Name se ; NameOfCoef ae ; Function BF_PerpendicularEdge ;
Support Region[{Domaine}] ; Entity NodesOf[All] ; }
}
Constraint {
{ NameOfCoef ae ; EntityType NodesOf ; NameOfConstraint Dirichlet ; }
}
}
{ Name TenseurAim ; Type Form0 ;
BasisFunction {
{ Name sn ; NameOfCoef un ; Function BF_GroupOfNodes ;
Support Air ; Entity GroupsOfNodesOf[ STenseur ] ; }
}
Constraint {
{ NameOfCoef un ; EntityType GroupsOfNodesOf ; NameOfConstraint TenseurAimant ; }
}
}
}
Formulation {
{ Name Magnetostat ; Type FemEquation ;
Quantity {
{ Name a ; Type Local ; NameOfSpace Hrot ; }
{ Name un ; Type Local ; NameOfSpace TenseurAim ; }
}
Equation {
Galerkin { [ nu[{Curl a}]*Dof{Curl a} , {Curl a} ] ;
In Domaine ; Jacobian Jvol ; Integration Integ ; }
Galerkin { JacNL [ dhdb_NL[{Curl a}] * Dof{Curl a} , {Curl a} ] ; In Fer ; Jacobian Jvol ; Integration Integ ; }
Galerkin { [ -j[] , {a} ] ;
In Bobine ; Jacobian Jvol ; Integration Integ ; }
Galerkin{ [ -nu[]*br[] , {Curl a} ] ;
In Aimant ; Jacobian Jvol ; Integration Integ ;}
Galerkin { [ 0 * Dof{un} , {un} ] ;
In Air ; Jacobian Jvol ; Integration Integ ; }
}
}
}
Resolution {
{ Name analyse ;
System {
{ Name Sys ; NameOfFormulation Magnetostat ; }
}
Operation {
InitSolution[Sys] ;
GenerateJac[Sys] ;
SolveNL[Sys] ;
SaveSolution[Sys] ;
}
}
}
PostProcessing {
{ Name PostProc ; NameOfFormulation Magnetostat ;
Quantity {
{ Name j ; Value { Local { [ j[] ] ; In Bobine ; Jacobian Jvol ; } } }
{ Name a ; Value { Local { [ {a} ] ; In Domaine ; Jacobian Jvol ; } } }
{ Name az ; Value { Local { [ Norm[{a}] ] ; In Domaine ; Jacobian Jvol ; } } }
{ Name b ; Value { Local { [ {Curl a} ] ; In Domaine ; Jacobian Jvol ; } } }
{ Name normb ; Value { Local { [ Norm[{Curl a}] ] ; In Domaine ; Jacobian Jvol ; } } }
{ Name h ; Value {
Local { [ nu[{Curl a}]*{Curl a} ] ; In Domaine ; Jacobian Jvol ; }
Local { [ -nu[]*br[] ] ; In Aimant ; Jacobian Jvol ; }
}
}
{ Name f ; Value { Integral { [ 2*Pi*CompY[- TM[{Curl a}] * {d un}] ] ;
In Vol_Force ; Jacobian Jvol ; Integration Integ ; } } }
}
}
}
PostOperation PostOp UsingPost PostProc {
Print[ j, OnElementsOf Bobine, File "j.pos"] ;
Print[ a, OnElementsOf Domaine, File "a.pos"] ;
Print[ b, OnElementsOf Domaine, File "b.pos"] ;
Print[ normb, OnElementsOf Domaine, File "normb.pos"] ;
Print[ h, OnElementsOf Domaine, File "h.pos"] ;
Print[ az, OnElementsOf Domaine, File "az.pos"] ;
Echo[ Str["v0 = PostProcessing.NbViews-1;",
"View[v0].IntervalsType = 1;",
"View[v0].NbIso = 40;",
"View[v0].LightLines = 0;"],
File "tmp.geo", LastTimeStepOnly ];
Print[ f[Air], OnGlobal, Format Table, File > "F.dat" ,
SendToServer "Modèle/Sorties/ Force [N]", Color "AliceBlue" ];
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment