Loading...
 

FEMAGTools

femagtools ist eine Open-Source Python-API für FEMAG und bietet folgende Funktionen:

  • Femag Betrieb mit FSL file: Lokal (single und multi-core), remote (ZMQ), HT Condor, Cloud (Amazon AWS, Google Cloud)
  • Einlesen von BCH/BATCH Files
  • Erstellen von FSL-Dateien aus Modell- und Berechnungsvorlagen und / oder benutzerspezifischen FSLs
  • Berechnen der Maschineneigenschaften mittels analytischer Maschinenmodelle
  • Durchführung von Parameterstudien und Mehrzieloptimierung

Femagtools Modules

mcv, tks, jhb, losscoeffs: BH Curves, Iron Losses,
erg, bch, isa7:processing I7/ISA7, ERG, BCH/BATCH Files,
forcedens:processing PLT files
dxfsl:convert DXF to FSL,
model, fsl:create machine and simulation models,
femag:Running Calculations
machine:analytical machine models,
grid:parameter variations,
opt: multi-objective optimization
plot:graphical presentations
amazon, google, condor, multiproc:engines for parallel calculation

 

Femagtools: Executable Modules

 

bch:Convert BCH/BATCH files into JSON Format,
bchxml:Convert BCH/BATCH files into XML-Format,
plot:Create a graphical presentation of a BCH/BATCH file,
mcv :Convert MCV files into JSON Format
dxfsl.conv:convert DXF to FSL

 

Example (as Command Line Tool):
femagtools-plot TEST_001.BCH

Model Creation With FEMAG Templates

  machine = dict (poles=8, ..
    stator= dict (
      num_slots=48,..
       statorRotor3 = dict (
         slot_height=0.0335,..)
    ),
    magnet= dict (
      magnetIronV = dict (
      magn_height=0.00648,
    ),
   windings= dict (
   num_wires=9,..)
  )

 

Creating User Specific Models with FML/FSL

  machine = dict (
    stator= dict (
      num_slots=48, ..
      statorRotor3= dict (..)
    ),
    magnet= dict (
      ipmfml = dict (
        magn_height =0.004,
          magn_
            slot_
            gamma=49))
            ..

File ipmfml.mako :
hm = ${model' magn_height '}*1e3
bm = ${model'magn_width'}*1e3
sw = ${model'slot_width}*1e3
h1 = ${model'slot_h1}*1e3
gam = ${model'gamma'}
r = da2/2 -h1 -hm
P = m.num_poles
Pm = m.npols_gen
taup = 2*360/P --pole pitch in degree

 

User Specific Model from DXF

  machine = dict (
    name="VMOT" ,
    dxffile =dict (name='Drawing.dxf' ),
    lfe =0.08356,
    stator=dict (
      mcvkey_yoke='M270 -35A' ),
    magnet=dict (
      mcvkey_yoke="M270-35A"),
   
    windings=dict (
      num_phases=3,
      num_layers=2,
      num_wires=10,
      coil_span=5
      )
    )

Material: BH Curves, Losses, Magnets

  • Reading MCV Files:
    mcvreader = femagtools.mcv . Reader ( )
    mcvreader . readMcv ( 'M270 -35A.MC' )
  • Writing MCV Files:
    mcvData = dict ( curve =[ dict ( b i =[] , h i = ) ] . . )
    mcv = femagtools.mcv . MagnetizingCurve ( mcvData )
    mcv . writefile ( 'M270 -35A.MC' )
  • Reading and Writing TKS files:
    mcv = femagtools.tks.read ( 'TKS -M400 -65A.txt' )
    mcv . writefile ( 'M270 -35A.MC' )
  • Define Magnet material:
    magn = dict (name='MX' , remanenc =1.2 , . . )

Material Handling: Attach Material to Models

  machine = dict (
    name="PM 225 8" ,
    . . .
    stator=dict (
      num_slots =48,
      mcvkey_yoke=" m270-35a " ,
      fillfac =1.0 ,
      statorRotor3=dict ( . . . )
    ) ,
    magnet=dict (
      mcvkey_shaft="dummy" ,
      material=' BM38H ' ,
      mcvkey_yoke=' m270-35a ' ,
      magnetSector=dict ( . . . )
    ) ,

 Run FEMAG locally

  workdir = os . path . join (
    os . path . expanduser ( '~' ) ,
    'femag ' )
  femag = femagtool . Femag(
    workdir ,
    magcurves ,
    magnets )

  pmMachine = dict (
    name="PM 270 L8" ,
    poles =8,
    npols_gen =2,
    outer_diam =269.24e-3,
    bore_diam =161.92e-3,
    airgap =7.5e-3,
    lfe =83.56e-3
    ... )

simulation = dict (
  angl_i_up =0.0 ,
  calculationMode="pm_sym_fast" ,
  wind_temp =60.0 ,
  magn_temp=60.0 ,
  current =50.0 ,
  speed =50.0)

r = femag ( pmMachine ,
                     simulation )
print ( 'Torque Nm = {}' . format (
            r . machine 'torque ' ) )

Postprocessing: I7/ISA7 Files

  • read I7/ISA7 Files
    isa = femagtools.isa7.read('PM -130 -4')
  • Access Values (Print Element Properties)
    el = isa.elements 0
    print("Induct {}, LossDens {} Area {}".format(
       el.induction (),
       el.loss_density (),
       el.area)
  • Name of Subregions:
    print (([[sr.name for sr in isa.subregions |sr.name for sr in isa.subregions ]]))
  • Plot Superelements, Mesh (Matplotlib):
    femagtools.plot.spel(isa)
    femagtools.plot.mesh(isa)

 

Postprocessing: Gmsh MSH/GEO Export

  femagtools.convert.to_msh(isa , 'pm.msh')
  femagtools.convert.to_geo(isa , 'pm.geo')
  femagtools.convert.to_geo(isa , 'pm3d.geo',
                   extrude =0.01 , layers=3, recombine=True)