DE-R Four Module + PRS Load Simulation
!
! Rick Spielman 2017-12-07
!
Time-step 2.0e-12
Resolution-time 100e-12
End-time 1.0e-6
Number-prints 5
Execute-cycles all
Grids no
Echo-setup no
Max-points 8001
!
!Start circuit definition
!
! DE-R_rev5d.txt is based on DE-R_rev5c.txt but with the Marx parameters of DE-R_rev5final.txt
!
! DE-R_rev5c.txt is based on DE-R_rev5b.txt. In this deck we have removed the A-level branch and
!  replaced the load with an electron-beam diode. This is effectively half of the driver. We will assume
!  a diode with a radius of 6" (15.24 cm) that matches the impedance of the 3.7- disk. Also adding a
!  length scaling factor to correct for the overestimate of the water switch resistance of 40%. Decrease 
!  length by .4.
! 
! DE-R_rev5b.txt is based on DE-R_rev5a.txt. In this run deck we are splitting the two halves
!  of the water lines AND Marxes in half so that we can drive each side of the vacuum disk feed 
!  separately. This allows more accurate treatment of the MITLs and the convolute. MITL and Z_flow
!  models will be incorporated into the deck. We will divide C by 2X and multiply L and R by 2X.
!  Remember that the IOUT/IIN calls are backward in the second branch. We have included the non
!  perturbing MZFlow block that calculates Ic, If, Zfl.
!
! DE-R Rev5a.txt is based on DE-R Rev4a.txt. We are including a PRS load using the general 
!  parameters of the Z51 deck used in Z15_rev2_Z51.txt. The exact inductance numbers have
!  been tweaked a bit to be self consistent. We output V, I before the MITL TR and V,I after the MITL.
!
! DE-R Rev4a is based on DE-R Rev4. I am removing all of the extra branches to speed iteration. 
! This forces me to divide all marx and water line impedances and inductances by four
! and to increase the Marx C by 4.
!
! DE-R Rev 3a is based on DE-R Rev 2a. We are lowering the WL impedance to 0.4  (1.6/4) and
! explicitly putting in the water flare impedance of the stack. In addition, the insulator, vacuum flare, 
! and MITL impedances will be rechecked. Goal - explicit identification of all impedance and 
! inductance components.
!
! DE-R Rev 2a uses the DE-R Rev 2 deck with 4 parallel modules that are driving an insulator stack,
! MITL, and e-beam load. We will use 4, separate modules joined to the insulator stack with
! End Branches. This way we can keep the Rev1b structure exactly. We also allow jitter in the 
! Future. Note: the module end branches are in reverse order away from the branch.
!
! DE-R Rev 1 uses the DE Rev 4 as the baseline. We will be changing all the line impedances to
! 2  and will be changing the line lengths. The goal here is to have a driver that delivers a clean 100-ns
! FWHM pulse to a constant impedance load.
!
! Rev 4 changes the CPL water switch gap to the actual gap 3.75
! also changes the output line to constant 1.3  impedance with a matched load.
!
! Rev 3 Marx switch losses and more accurate water line parameters
! Change marx to 30 stages of 300 nF/stage
!
! Gas switch dimensions from drawings
!
! The sub Marx capacitance is 300 nF/34= 8.82 nF. We operate at a charge voltage of 100 kV.
! We have a 8.82-nF sub Marx with 34 cap pairs in series and 17 switches. Vch = 3.4 MV
! We have 8 sub Marxes in parallel.
! The total Marx capacitance is 70.59 nF.
! Include 130 m individual cap ESR or 65 m per pair of caps in parallel
!   X 34 stages per sub-Marx = 2.21  per sub-Marx
! Assume that there will be 167 nH every two stages. L = 167 nH * 17 = 2.839 H.
! The total Marx inductance (caps and switches) would be 2.338 H/8 = 354.9 nH
!
! We start with a total Marx capacitance of 70.59 nF (exceeds the CPL capacitance). This implies
!   that there will a ringing gain on the CPL. This allows a faster rise time than otherwise to 
!   get to the desired CPL voltage.
!
! CPL capacitance used is 42.85 nF. This is distributed in a TL that is ~60 ns long and
!   has a constant impedance of 1.4 . (C = t/Z = 60/1.4 nF = 42.85 nF)
!
! Energy per Marx at 100 kV = 407.5 kJ, 2 marxes = 816 kJ, 4 marxes = 1.63 MJ
!
! The matched impedance of a sub-Marx = sqrt(L/C) = 17.94 .
!   The total Marx impedance is 17.94 /8 = 2.24 
!   Note CPL impedance is 1.4 .
!   The ESR amounts to ~ 12.3% of the matched impedance.
!
! The switch model will have 17x the length of one switch per sub Marx and then will
! have 8 arc channels (sub Marxes) in parallel. Then there will be two Marxes in parallel.
! 
! We will assume a TOTAL inductance of 380 nH for one Marx and one L1.
! This inductance is needed to get the required rise time of the voltage on the CPL.
! The total inductance for Branch A (and also Branch B) is 190 nH.
!
! 
! Main Branch - Branch #1
!
BRANCH
!
! B LEVEL
!
! Marx capacitance and charge voltage
! CX2 for two modules (70.59 nF each) = 141 nF
! +/-100 kV charge
!
RCGround 1e+12 141e-9
Initial VC1 3.4e6

UFO VC1 SCALE 1.0e-6
$V_marx_B(MV)
UFO EC1
$E_marx_B

!
! Cap inductance, case & parasitic inductance, and ESR
! ESR = 0.276 for the total Marx (2.21  sub Marx/8)
! Divide R and L by 2 for 2 modules (driving one MITL)
!

RLSeries 0.138 177.45e-9

!
! Switch resistance - Martin Model and switch inductance - the total gap for a single
!   switch from DWGs is 0.53 (1.346 cm) gap and 93 psig air X15 = 20.19 cm
!
! Initial switch resistance was chosen to be higher than that printed in the first
! few time steps so as to appear monotonically decreasing in R plots
! A careful few runs showed that 10 G looked best. In any event by 1 ns all of the 
! resistance values are the same.
! 17 switches for 8 sub-Marxes, 2 channels for 2 modules
!  Divide parallel switch inductance for one Marx (~50 nH) by 2 for 2 modules
!

RLSeries 10e9 25e-9
Var R2 Switch
!dielectric switchtime gap        pressure     nswitch  nchannels
AIR           0.0               0.2288  7.3                8             2

UFO IR2 SCALE 1.0e-6
$I_marx_B(MA)
UFO R2
$R_switch_B
UFO ER2
$E_switch_B
UFO QR2
$Q_switch_B

!
! Output Marx header inductance
! Divide 100 nH by 2 for 2 modules in parallel
!

RLSeries 0.00 50e-9

!
! Line 1 (CPL), 60 ns, 1.4 , 60 ns/1.4= 42.85 nF per L1
! Divide Z by 2 for one half of DE-R driving one insulator stack
! Include the radius transition of the L1 
!

TRLine EXP 2.29e-09  2   .7
TRLine LIN 56.0e-09   .7 .7
TRLine EXP 2.29e-09 .7  2

UFO VOUT SCALE 1.0e-6
$V_CPL_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_CPL_out_B(MA)
UFO EOUT
$E_CPL_out_B
UFO POUT
$P_CPL_out_B

!
! Line 1 water switches - gap is scaled by 0.6
! 5 output switches, 4 gap x .6 = 2.4"  (DE today) + switch inductance
!  Increase number of channels x2 for the two modules
!

RLSeries 10e9 5e-9
Var R2 Switch
!dielectric switchtime gap         pressure   nswitch  nchannels
H2O          310e-09     0.06096   1.0              5             2

UFO IR2 SCALE 1.0e-6
$I_CPL_sw_B(MA)
UFO R2
$R_CPL_sw_B
UFO ER2
$E_CPL_sw_B
UFO QR2
$Q_CPL_sw_B

!
! Line 2, 72 ns, 1.4  constant impedance
! Divide by 2 for 2 modules
!

TRLine EXP 2.29e-09 2 .7

UFO VIN SCALE 1.0e-6
$V_PFL_in_B(MV)
UFO IIN SCALE 1.0e-6
$I_PFL_in_B(MA)

TRLine LIN 68e-09 .7 .7
TRLine EXP 2.29e-09 .7 2

UFO VOUT SCALE 1.0e-6
$V_PFL_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_PFL_out_B(MA)
UFO POUT
$P_PFL_out_B
UFO EOUT
$E_PFL_out_B

!
! Line 2 water switches - gap is scaled by 0.6
! 7 output switches, 0.5" x .6 = 0.3 gap + switch inductance
! Increase number of channels to two for two modules
!

RLSeries 10e9 5e-9
Var R2 Switch
!dielectric switchtime gap      pressure     nswitch  nchannels
H2O         385e-09    0.00762   1.0                    7               2

UFO IR2 SCALE 1.0e-6
$I_PFL_sw_B(MA)
UFO R2
$R_PFL_sw_B
UFO ER2
$E_PFL_sw_B

!
! Output Line (OL),  72 ns, 1.4  constant impedance
!  Divide Z by 2 for two modules
!

TRLine EXP 2.29e-09 2 .7

UFO VIN SCALE 1.0e-6
$V_OL_in_B(MV)
UFO IIN SCALE 1.0e-6
$I_OL_in_B(MA)

TRLine LIN 70e-09 .7 .7

UFO VOUT SCALE 1.0e-6
$V_OL_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_OL_out_B(MA)
UFO POUT
$P_OL_out_B
UFO EOUT
$E_OL_out_B

!
!  ********* Water flare transition external to the insulator stack ****************
!  Router = 1.165 m , stack outer = 1.1 m, constant 13.35-cm gap, l = 1.96 ns
!   Divide by 2X for half QE Zouter = 0.76 , Zinner = 0.81 
!

TRLine LIN 1.96e-9 0.76 0.81

!
!   ***********************  Insulator stack  *****************************
! The water/vacuum interface Router=1.1 m, Rinner=1.0 m, height=13.35 cm (0.64-cm grading rings) 
!  Plastic height is 11.43 cm. L per side = 2.1788 nH
!

RLSeries  0.0    2.1788E-9

!
UFO VOUT SCALE 1.0e-6
$V_stack_B(MV)
UFO IOUT SCALE 1.0e-6
$I_stack_B(MA)
UFO POUT
$P_stack_B
UFO EOUT
$E_stack_B

!
!   **************************  First vacuum piece inside insulator  *****************************
!  Constant 13.35 cm height, Router = 1 m, Rinner = 0.975 m
! Inductance = 0.676 nH
!

RLSeries  0.0    0.676E-9

!
!
!   **************************  Vacuum flares  *****************************
! The flare includes the flare itself and the rectangular piece that extends down to the cathode.
! L1=0.639 nH, L2=0.924 nH, L1+L2=1.563 nH
! This section would be better modeled as MITLs as the lower portion of the feed could be 
!  emissive.
!

RLSeries  0.0    1.563E-9

!
! Extra stray L in the flare region 0.5 nH, just a WAG
!

RLSeries  0.0    0.5E-9

!
UFO VOUT SCALE 1.0e-6
$V_vf_B(MV)
UFO IOUT SCALE 1.0e-6
$I_vf_B(MA)
UFO POUT
$P_vf_B
UFO EOUT
$E_vf_B

!
!   *****************************   Constant Z MITLs   ********************************
! Z= 3.7 , length = 2.45 ns (Router = 89.65 cm gap=5.53 cm, Rinner=16.2 cm gap=1 cm)
! L=Zt - 9.25 nH
! I will divide the spacing between Router and Rinner into 10 segments of equal distance
!  and use the mid point of each segment as the circumference for the MITL model.
! 7.345 cm long segments,
! MITL midpoints (cm) - 85.98, 78.63, 71.29, 63.94, 56.60, 49.25, 41.91, 34.56, 27.22, 19.87
! circumferences (m) - 5.40, 4.94, 4.48, 4.017, 3.556, 3.094, 2.633, 2.171, 1.71, 1.248
! vac gap for 3.7  (m) - 5.306e-2, 4.852e-2, 4.4e-2, 3.946e-2, 3.492e-2, 3.039e-2, 2.586e-2, 2.133e-2, 1.68e-2, 1.226e-2
!
!MITL      Circum            Gap            Length-s       Impedance        Resolution       E-Turnon
MITL         5.40            5.306e-02     0.245E-09          3.7                      0.05e-9

UFO VOUT SCALE 1.0e-6
$V_mitl1_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl1_out_B(MA)
UFO CLOS
$I_mitl1_loss_B
UFO ALOS
$J_mitl1_loss_B

!MZFlow 3.7
!UFO ICA
!$Icath_mitl1_B
!UFO IPL
!$Iflow_mitl1_B
!UFO ZOT
!$Zflow_mitl1_B
               
MITL         4.94          4.852e-02        0.245E-09          3.7                      0.05e-9               

UFO VOUT SCALE 1.0e-6
$V_mitl2_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl2_out_B(MA)
UFO CLOS
$I_mitl2_loss_B
UFO ALOS
$J_mitl2_loss_B

MITL         4.48          4.4e-02        0.245E-09          3.7                      0.05e-9               

UFO VOUT SCALE 1.0e-6
$V_mitl3_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl3_out_B(MA)
UFO CLOS
$I_mitl3_loss_B
UFO ALOS
$J_mitl3_loss_B

MITL         4.017        3.946e-02       0.245E-09          3.7                      0.05e-9               

UFO VOUT SCALE 1.0e-6
$V_mitl4_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl4_out_B(MA)
UFO CLOS
$I_mitl4_loss_B
UFO ALOS
$J_mitl4_loss_B

MITL         3.556         3.492e-02        0.245E-09          3.7                      0.05e-9

UFO VOUT SCALE 1.0e-6
$V_mitl5_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl5_out_B(MA)
UFO CLOS
$I_mitl5_loss_B
UFO ALOS
$J_mitl5_loss_B

MITL         3.094         3.039e-02        0.245E-09          3.7                      0.05e-9

UFO VOUT SCALE 1.0e-6
$V_mitl6_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl6_out_B(MA)
UFO CLOS
$I_mitl6_loss_B
UFO ALOS
$J_mitl6_loss_B

MITL         2.633         2.586e-02        0.245E-09          3.7                      0.05e-9

UFO VOUT SCALE 1.0e-6
$V_mitl7_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl7_out_B(MA)
UFO CLOS
$I_mitl7_loss_B
UFO ALOS
$J_mitl7_loss_B

MITL        2.171         2.133e-02        0.245E-09          3.7                      0.05e-9

UFO VOUT SCALE 1.0e-6
$V_mitl8_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl8_out_B(MA)
UFO CLOS
$I_mitl8_loss_B
UFO ALOS
$J_mitl8_loss_B

MITL         1.71         1.678e-02        0.245E-09          3.7                      0.05e-9

UFO VOUT SCALE 1.0e-6
$V_mitl9_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl9_out_B(MA)
UFO CLOS
$I_mitl9_loss_B
UFO ALOS
$J_mitl9_loss_B

MITL         1.248         1.226e-02        0.245E-09          3.7                      0.05e-9

UFO VOUT SCALE 1.0e-6
$V_mitl10_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitl10_out_B(MA)
UFO CLOS
$I_mitl10_loss_B
UFO ALOS
$J_mitl10_loss_B
        
UFO POUT
$P_mitl10_out_B
UFO EOUT
$E_mitl10_out_B

!
! Inductance of the disk MITL - disk plate, 16.2 cm to 15.2 cm (6")
!    Gap = 1 cm at this location, top and bottom 0.127 nH
!    Will need MITL calls here at some point.
!

!RLSeries 0.0       0.127E-9

!
!   *******************  Coax MITL  ********************
!  Cathode radius 15.2 cm, anode radius 16.2 cm, cath circ = 95.5 cm
!

!MITL      Circum            Gap            Length-s       Impedance       ( Resolution)      (E-Turnon)
MITL         0.955            1.0e-02        0.25E-09          3.7                     0.05e-9

UFO VOUT SCALE 1.0e-6
$V_mitlc_out_B(MV)
UFO IOUT SCALE 1.0e-6
$I_mitlc_out_B(MA)
UFO CLOS
$I_mitlc_loss_B
UFO ALOS
$J_mitlc_loss_B

!
! L in the diode gap volume
! Ro=16.2, Rin=15.2, h = diode gap (10mm-0.127 nH, 6.5mm-0.082 nH)
!

RLSeries  0.0      0.127E-9

!     
!    *********   Electron Beam Diode   ****************************
!

RCGround 1e6 0.0
VARiable R1 EDIode
!Diode_type Gap       Enhancement   Velocity       Router     (Rinner)
3                     1.0e-2      3.0                   1.0e4         15.2e-2    14.2e-2
!
UFO R1
$Z_diode
UFO IR1 SCALE 1.0e-6
$I_diode(MA)
UFO VR1 SCALE 1.0e-6
$V_diode(MV)
UFO PR1
$P_diode
UFO ER1
$E_diode

!
! End Main Branch (Branch #1)
!