GetDP, cyl.axis

Samuel Kvasnica kvasnica at iaee.tuwien.ac.at
Mon Jul 17 13:26:51 CEST 2000


> > ok, I just changed VolAxi to VolAxiSqu and I didn't see a big difference.
> > I'm also getting a message Zero Determinant in xyz2uvwInAnElement when
>
> Could you send the problematic files? (It should work, so there is maybe
> a bug somewhere...)

Hi Christophe,

sorry for a delay, I'm travelling quite a lot now. The files are attached to this
email,
take a look please.

Thanks a lot for your help,

Sam


--
--------------------------------------------------------------
Mag.Samuel Kvasnica
IEMW TU-WIEN
Gusshausstrase 27-29 / 366   email: kvasnica at iaee.tuwien.ac.at
1040 Wien                    tel:   +43-1-58801-36639
Austria                      fax:   +43-1-58801-36695
--------------------------------------------------------------


-------------- next part --------------
/* -------------------------------------------------------------------
   File "electrode.pro"

   This file defines the problem dependant data structures for the
   static inductor problem.

   To compute the solution: getdp CoreSta -msh Core.msh -solve MagSta_a_2D
   To compute post-results: getdp CoreSta -msh Core.msh -pos Map_a
                         or getdp CoreSta -msh Core.msh -pos Cutb_a
   ------------------------------------------------------------------- */


Group {

  Air        = # 2100 ;
  AirInf     = # 2101 ; 
  Core       = # 2002;
/*  Ind      = # 2000 ;*/
  Magnet1 = # 2000 ;
  Magnet2 = # 2001 ;

  SurfaceGh0  = # 1100 ;
  SurfaceGInf = # 1102 ;

  DomainCC_Mag = Region[ {Air, AirInf, Magnet1, Magnet2, Core} ] ;
  DomainC_Mag  = Region[ {} ] ;

  Domain_S  = Region[ {} ] ;  // Stranded inductor

  DomainInf = Region[ {AirInf} ] ;
  Val_Rint = 349.999999e-3 ;  Val_Rext = 450.00000001e-3 ;

  Domain = Region[ {DomainCC_Mag} ] ;
  
  Domain_M = Region [ {Magnet2} ];
  Domain_O = Region [ {Air,AirInf,Magnet1,Magnet2,Core} ];


}

Function {

  mu0 = 4.e-7 * Pi ;
  murCore = 10000.;

  nu [ #{Air, AirInf, Magnet2} ]  = 1. / mu0 ;
  nu [ Core] = 1./(mu0 * murCore);
  nu [ Magnet1 ] = 1./(murCore*mu0);

/*  Sc[ #{Magnet} ] = 2.3e-4 ;*/
/*nu [ Magnet2 ] = 1./(mu0 * murCore);*/

  js[ Domain_S ] = Vector[0,0,1];
  P[ Magnet1 ] = Vector[0,0,0];
  P[ Magnet2 ] = Vector[0,-.23,0];

}

Constraint {

  { Name MagneticVectorPotential_2D ;
    Case {
/*      { Region SurfaceGe0  ; Value 0. ; }*/
      { Region SurfaceGh0  ; Value 0. ; }
      { Region SurfaceGInf ; Value 0. ; }
    }
  }

/*  Val_I_1_ = 7 * 150.   ;

  { Name SourceCurrentDensityZ ;
    Case {
      { Region Magnet; Value +Val_I_1_/Sc[] ; }
    }
  }
*/
}

Include "Jacobian2_Lib.pro"
Include "Integration_Lib.pro"
Include "MagSta_a_2D.pro"

PostOperation Map_a UsingPost MagSta_a {
  Plot[ az, OnRegion Domain, File "Electrode_az.pos"] ;
  Plot[ a, OnRegion Domain_O, File "Electrode_a.pos"] ;
  Plot[ b, OnRegion Domain_O, File "Electrode_b.pos", Depth 0] ;  
  Plot[ h, OnRegion Domain_O, File "Electrode_h.pos", Depth 0] ;
}

e = 1.e-5 ;

PostOperation Cutb_a UsingPost MagSta_a {
  Plot[ az, OnPlane {{0,-100,0}{0,100,0}{100,-100,0}}{200,100} , File "az_a", Format gnuplot ];
  Plot[ h, OnPlane {{0,-80,0}{70,-80,0}{0,80,0}}{30,60} , File "h_a", Format gnuplot] ;
  Plot[ h, OnLine {{17,-160,0}{17,160,0}}{200} , File "bl_a", Format
gnuplot, Depth 2] ;
}

PostOperation line UsingPost MagSta_a {
  Plot[ b, OnLine {{0.025,-0.160,0}{0.025,0.160,0}}{200} , File "line_b", Format
gnuplot] ;
}

PostOperation line_r UsingPost MagSta_a {
  Plot[ b, OnLine {{0.017,0,0}{0.1,0,0}}{200} , File "line_r0", Format gnuplot] ;
  Plot[ b, OnLine {{0.017,0.03,0}{0.1,0.03,0}}{200} , File "line_r1", Format gnuplot] ;
  Plot[ b, OnLine {{0.017,-0.03,0}{0.1,-0.03,0}}{200} , File "line_r-1",Format gnuplot] ;
  Plot[ b, OnLine {{0.017,0.06,0}{0.1,0.06,0}}{200} , File "line_r2", Format gnuplot] ;
  Plot[ b, OnLine {{0.017,-0.06,0}{0.1,-0.06,0}}{200} , File "line_r-2",Format gnuplot] ;
  Plot[ b, OnLine {{0.017,0.09,0}{0.1,0.09,0}}{200} , File "line_r3", Format gnuplot] ;
}

PostOperation line_z UsingPost MagSta_a {
  Plot[ b, OnLine {{45e-3,0,0}{45e-3,-50e-3,0}}{200} , File "line_z", Format gnuplot] ;
  Plot[ b, OnLine {{3e-3,10e-3,0}{3e-3,-50e-3,0}}{200} , File "line_r3", Format gnuplot] ;
  Plot[ b, OnLine {{0,10e-3,0}{0,-50e-3,0}}{200} , File "line_r0", Format gnuplot] ;
  Plot[ b, OnLine {{1e-3,0,0}{45e-3,0,0}}{200} , File "line_z0", Format gnuplot] ;
}


PostOperation field UsingPost MagSta_a {
  Plot[ b, OnPlane {{0.017,0.11,0}{0.017,-0.11,0}{0.11,0.11,0}}{512,256},
        File "field_all", Format gnuplot] ;
}

PostOperation field2 UsingPost MagSta_a {
  Plot[ b, OnPlane {{0.017,0.11,0}{0.017,-0.11,0}{0.11,0.11,0}}{160,80},
        File "field_all", Format gnuplot, Depth 2] ;
}

PostOperation field256 UsingPost MagSta_a {
  Plot[ b, OnPlane {{0.017,0.0025,0}{0.017,-0.0325,0}{0.05,0.0025,0}}{256,256},
        File "field_256x256", Format gnuplot] ;
}
PostOperation field128 UsingPost MagSta_a {
  Plot[ b, OnPlane {{0.017,0.0025,0}{0.017,-0.0325,0}{0.05,0.0025,0}}{128,128},
        File "field_128x128", Format gnuplot] ;
}
PostOperation field64 UsingPost MagSta_a {
  Plot[ b, OnPlane {{0.017,0.0025,0}{0.017,-0.0325,0}{0.05,0.0025,0}}{64,64},
        File "field_64x64", Format gnuplot] ;
}
PostOperation field512 UsingPost MagSta_a {
  Plot[ b, OnPlane {{0.017,0.0025,0}{0.017,-0.0325,0}{0.05,0.0025,0}}{512,512},
        File "field_512x512", Format gnuplot] ;
}
-------------- next part --------------
yInt = 350e-3;
yExt = 450e-3;

l=20e-3;
w=5e-3;
d=3e-3;

r1=10e-3;
r2=36e-3;
r3=54e-3;
d1=30e-3;
d2=15e-3;
d3=50e-3;
d4=60e-3;

/* 0.4,5,12,1 */
pCore = 1.5e-3;
pInt=10e-3;
pExt = 15e-3;
pAxis = 1e-3;

Point(0) = {0,0,0,pAxis};
Point(1) = {r1,0,0,pCore};
Point(2) = {r2,0,0,pCore};
Point(3) = {r3,0,0,pCore};
Point(4) = {0,d1,0,pAxis};
Point(5) = {r1,d1,0,pCore};
Point(6) = {r2,d2,0,pCore};
Point(7) = {r3,d2,0,pCore};
Point(8) = {r1,d3,0,pCore};
Point(9) = {r2,d3,0,pCore};
Point(10) = {0,d4,0,pAxis};
Point(11) = {r3,d4,0,pCore};

Line(1) = {0,1};
Line(2) = {1,5};
Line(3) = {5,4};
Line(4) = {4,0};
Line(5) = {1,2};
Line(6) = {2,3};
Line(7) = {3,7};
Line(8) = {7,6};
Line(9) = {6,2};
Line(10) = {7,11};
Line(11) = {11,10};
Line(12) = {10,4};
Line(13) = {5,8};
Line(14) = {8,9};
Line(15) = {9,6};

Line Loop(1) = {1,2,3,4};
Plane Surface(101) = {1}; /* magn 1 */
Line Loop(2) = {6,7,8,9};
Plane Surface(102) = {2}; /* magn 2 */
Line Loop(3) = {-8,10,11,12,-3,13,14,15};
Plane Surface(103) = {3}; /* core */

Point(100)={0,-yInt,0,pInt};
Point(101)={0,-yExt,0,pExt};
Point(102)={0,yInt,0,pInt};
Point(103)={0,yExt,0,pExt};

Line(104)={10,102};
Line(105)={0,100};
Line(106)={102,103};
Line(107)={100,101};

Circle(200)={101,0,103}; /*infinity*/
Circle(201)={100,0,102}; /*internal border*/

Line Loop(4) = {-104,-11,-10,-7,-6,-9,-15,-14,-13,-2,-1,105,201};
Line Loop(5) = {-106,-201,107,200};

Plane Surface(104) = {4};
Plane Surface(105) = {5};


Physical Surface(2000) = {101}; /* magnet 1 */
Physical Surface(2001) = {102}; /* magnet 2 */
Physical Surface(2002) = {103}; /* core */

Physical Surface(2100) = {104}; /* air */
Physical Surface(2101) = {105}; /* infinity air */

Physical Line(1100) = {-106,-104,12,4,105,107}; /* SurfaceGh0 */
Physical Line(1102) = {200}; /* SurfaceGInf */

-------------- next part --------------
/* -------------------------------------------------------------------
   File "MagSta_a_2D.pro"

    Magnetostatics - Magnetic vector potential a formulation (2D)
   -------------------------------------------------------------------

   I N P U T
   ---------

   GlobalGroup :  (Extension '_Mag' is for Magnetic problem)
   -----------
   Domain               Whole magnetic domain
   Domain_S              Inductor regions (Source)

   Function :
   --------
   nu[]                     Magnetic reluctivity

   Constraint :
   ----------
   MagneticVectorPotential_2D
                            Fixed magnetic vector potential (2D)
                            (classical boundary condition)
   SourceCurrentDensityZ    Fixed source current density (in Z direction)
*/

Group {
  DefineGroup[ Domain, Domain_S ] ;
}

Function {
  DefineFunction[ nu, js, P ] ;
}

FunctionSpace {

  // Magnetic vector potential a (b = curl a)
  { Name Hcurl_a; Type Form1P ;
    BasisFunction {
      // a = a  s
      //      e  e
      { Name se ; NameOfCoef ae ; Function BF_PerpendicularEdge ;
        Support Domain; Entity NodesOf[ All ] ; }
	{Name se2; NameOfCoef ae2; Function HBF_PerpendicularEdge_2E;
	Support Domain; Entity EdgesOf[ All ]; }
}
    Constraint {
      { NameOfCoef ae ;
        Entity NodesOf UsingConstraint MagneticVectorPotential_2D ; }
      { NameOfCoef ae2 ;
        Entity EdgesOf UsingConstraint MagneticVectorPotential_2D ; }
    }
  }

  // Source current density js (fully fixed space)
/*  { Name Hregion_j_Mag_2D ; Type Vector ;
    BasisFunction {
      { Name sr ; NameOfCoef jsr ; Function BF_RegionZ ;
        Support DomainS_Mag ; Entity DomainS_Mag ; }
    }
    Constraint {
      { NameOfCoef jsr ;
       Entity Region UsingConstraint SourceCurrentDensityZ ; }
    }

}*/

}

Formulation {
  { Name MagSta_a ; Type FemEquation ;
    DefineQuantity {
      { Name a  ; Type Local ; NameOfSpace Hcurl_a; }
/*      { Name js ; Type Local ; NameOfSpace Hregion_j_Mag_2D ; }*/
    }
    Equation {
      Galerkin { [ nu[] * Dof{d a}, {d a} ]  ; In Domain ;
                 Jacobian Vol ; Integration CurlCurl ; }
      Galerkin { [ -nu[] * P[], {d a} ] ; In Domain_M ;
       Jacobian Vol ; Integration CurlCurl ; }
/*      Galerkin { [ -js[], {a} ] ; In Domain_S ;
       Jacobian Vol ; Integration CurlCurl ; }*/
    }
  }
}

Resolution {
  { Name MagSta_a;
    System {
      { Name Sys_Mag ; NameOfFormulation MagSta_a ; }
    }
    Operation {
      Generate Sys_Mag ; Solve Sys_Mag ; SaveSolution Sys_Mag ;
    }
  }
}

PostProcessing {
  { Name MagSta_a ; NameOfFormulation MagSta_a ;
    PostQuantity {
      { Name a  ; Value { Term { [ {a} ]          ; In Domain ; Jacobian
Vol;} } }
      { Name az ; Value { Term { [ CompZ[{a}] ]   ; In Domain ; Jacobian
Vol;} } }
      { Name b  ; Value { Term { [ {d a} ]        ; In Domain ; Jacobian
Vol;} } }
      { Name h  ; Value { Term { [ nu[] * {d a} ] ; In Domain ;Jacobian Vol;} 
/*                          Term { [ P[] ]; In Domain_M ;Jacobian Vol;} */
} }
    }
  }
}
-------------- next part --------------
/* -------------------------------------------------------------------
   File "Integration_Lib.pro"

   Definition of integration methods
   ------------------------------------------------------------------- */

Integration {
  { Name GradGrad ;
    Case { {Type Gauss ;
            Case { { GeoElement Triangle    ; NumberOfPoints  4 ; }
                   { GeoElement Quadrangle  ; NumberOfPoints  4 ; }
                   { GeoElement Tetrahedron ; NumberOfPoints  4 ; }
                   { GeoElement Hexahedron  ; NumberOfPoints  6 ; }
                   { GeoElement Prism       ; NumberOfPoints  9 ; } }
           }
         }
  }
  { Name CurlCurl ;
    Case { {Type Gauss ;
            Case { { GeoElement Triangle    ; NumberOfPoints  4 ; }
                   { GeoElement Quadrangle  ; NumberOfPoints  4 ; }
                   { GeoElement Tetrahedron ; NumberOfPoints  4 ; }
                   { GeoElement Hexahedron  ; NumberOfPoints  6 ; }
                   { GeoElement Prism       ; NumberOfPoints  9 ; } }
           }
         }
  }
}
-------------- next part --------------
/* -------------------------------------------------------------------
   File "Jacobian_Lib.pro"

   Definition of a jacobian method
   -------------------------------------------------------------------

   I N P U T
   ---------

   GlobalGroup :
   -----------
   DomainInf                Regions with Spherical Shell Transformation

   Parameters :
   ----------
   Val_Rint, Val_Rext       Inner and outer radius of the Spherical Shell
                            of DomainInf
*/

Group {
  DefineGroup[ DomainInf ] ;
  DefineVariable[ Val_Rint, Val_Rext ] ;
}

JacobianMethod {
  { Name Vol ;
    Case { { Region DomainInf ;
             Jacobian VolAxiSquSphShell {Val_Rint, Val_Rext} ; }
           { Region All ; Jacobian VolAxiSqu ; }
    }
  }
}