From d0f978cce3402c3fecff235f3e7d75a0bf8fbc03 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sun, 6 Jan 2019 14:45:02 +0100
Subject: [PATCH] add little resistance modelling end-winding effects on
 primary coil to be a bit more realistic (this also makes the R-L system
 transient shorter, which makes the voltage-driven time-domain results easier
 to understand)

---
 Magnetodynamics/transfo.pro | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Magnetodynamics/transfo.pro b/Magnetodynamics/transfo.pro
index d9df73d..3d7cd43 100644
--- a/Magnetodynamics/transfo.pro
+++ b/Magnetodynamics/transfo.pro
@@ -122,6 +122,8 @@ ElseIf (type_Source == 2) // voltage
     // Primary side
     E_in = Region[10001]; // arbitrary region number (not linked to the mesh)
     SourceV_Cir += Region[{E_in}];
+    R_in = Region[10002]; // arbitrary region number (not linked to the mesh)
+    Resistance_Cir += Region[{R_in}];
 
     // Secondary side
     R_out = Region[10101]; // arbitrary region number (not linked to the mesh)
@@ -134,9 +136,14 @@ ElseIf (type_Source == 2) // voltage
     // are defined)
     val_E_in = 1.;
     phase_E_in = 90 *deg; // Phase in radian (from phase in degree)
+
     // High value for an open-circuit test; Low value for a short-circuit test;
     // any value in-between for any charge
     Resistance[R_out] = 1e6;
+
+    // End-winding primary winding resistance for more realistic primary coil
+    // model
+    Resistance[R_in] = 1;
   }
 
   Constraint {
@@ -157,7 +164,8 @@ ElseIf (type_Source == 2) // voltage
         // PLUS and MINUS coil portions to be connected in series, together with
         // E_in (an additional resistor should be defined to represent the
         // Coil_1 end-winding (not considered in the 2D model))
-        { Region E_in; Branch {1,2}; }
+        { Region E_in; Branch {1,4}; }
+        { Region R_in; Branch {4,2}; }
 
         { Region Coil_1_P; Branch {2,3} ; }
         { Region Coil_1_M; Branch {3,1} ; }
-- 
GitLab