|
10 | 10 | from ......Classes.Simu1 import Simu1 |
11 | 11 | from ......Classes.OPdq import OPdq |
12 | 12 | from ......Classes.OPslip import OPslip |
| 13 | +from ......Classes.InputCurrent import InputCurrent |
13 | 14 | from ......definitions import config_dict |
14 | 15 | from ......loggers import GUI_LOG_NAME |
15 | 16 | from ......Functions.FEMM.update_FEMM_simulation import update_FEMM_simulation |
@@ -118,28 +119,28 @@ def draw_FEMM(self): |
118 | 119 | if save_file_path is [None, ""]: |
119 | 120 | return |
120 | 121 |
|
121 | | - femm = _FEMMHandler() |
122 | | - output = Output(simu=Simu1(machine=self.machine)) |
123 | | - # Periodicity |
124 | | - sym, is_antiper = self.machine.comp_periodicity_spatial() |
125 | | - if is_antiper: |
126 | | - sym *= 2 |
127 | | - # Set Current (constant J in a layer) |
128 | | - S_slot = self.machine.stator.slot.comp_surface_active() |
129 | | - (Nrad, Ntan) = self.machine.stator.winding.get_dim_wind() |
130 | | - Ntcoil = self.machine.stator.winding.Ntcoil |
131 | | - Sphase = S_slot / (Nrad * Ntan) |
132 | | - J = 5e6 |
133 | | - if self.machine.is_synchronous(): |
134 | | - op = OPdq(felec=60) |
135 | | - else: |
136 | | - op = OPslip(felec=60) |
137 | | - op.set_Id_Iq(Id=J * Sphase / Ntcoil, Iq=0) |
138 | | - output.simu.input = InputCurrent(OP=op, Nt_tot=20) |
139 | | - output.simu.input.gen_input() |
140 | | - Is = output.elec.get_Is().get_along("phase", "time")["I_s"].transpose() |
141 | | - alpha = output.get_angle_rotor_initial() |
142 | 122 | try: |
| 123 | + femm = _FEMMHandler() |
| 124 | + output = Output(simu=Simu1(machine=self.machine)) |
| 125 | + # Periodicity |
| 126 | + sym, is_antiper = self.machine.comp_periodicity_spatial() |
| 127 | + if is_antiper: |
| 128 | + sym *= 2 |
| 129 | + # Set Current (constant J in a layer) |
| 130 | + S_slot = self.machine.stator.slot.comp_surface_active() |
| 131 | + (Nrad, Ntan) = self.machine.stator.winding.get_dim_wind() |
| 132 | + Ntcoil = self.machine.stator.winding.Ntcoil |
| 133 | + Sphase = S_slot / (Nrad * Ntan) |
| 134 | + J = 5e6 |
| 135 | + if self.machine.is_synchronous(): |
| 136 | + op = OPdq(felec=60) |
| 137 | + else: |
| 138 | + op = OPslip(felec=60) |
| 139 | + op.set_Id_Iq(Id=J * Sphase / Ntcoil, Iq=0) |
| 140 | + output.simu.input = InputCurrent(OP=op, Nt_tot=20) |
| 141 | + output.simu.input.gen_input() |
| 142 | + Is = output.elec.get_Is().get_along("phase", "time")["I_s"].transpose() |
| 143 | + alpha = output.get_angle_rotor_initial() |
143 | 144 | # Draw the machine |
144 | 145 | FEMM_dict = draw_FEMM( |
145 | 146 | femm, |
@@ -185,12 +186,12 @@ def draw_GMSH(self): |
185 | 186 | if save_file_path is [None, ""]: |
186 | 187 | return |
187 | 188 | # Create the Simulation |
188 | | - mySimu = Simu1(name="test_gmsh_ipm", machine=self.machine) |
189 | | - myResults = Output(simu=mySimu) |
190 | | - sym, is_antiper = self.machine.comp_periodicity_spatial() |
191 | | - if is_antiper: |
192 | | - sym *= 2 |
193 | 189 | try: |
| 190 | + mySimu = Simu1(name="test_gmsh_ipm", machine=self.machine) |
| 191 | + myResults = Output(simu=mySimu) |
| 192 | + sym, is_antiper = self.machine.comp_periodicity_spatial() |
| 193 | + if is_antiper: |
| 194 | + sym *= 2 |
194 | 195 | draw_GMSH( |
195 | 196 | output=myResults, |
196 | 197 | sym=sym, |
|
0 commit comments