Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
diodemdl.f
Go to the documentation of this file.
1  subroutine sdiode_model
2 c Read-only arguments
3  & (time, voltage,
4 c Read and write arguments
5  & var_parms,
6 c Write-only arguments
7  & conductance)
8 c
9 c ----------------------------------------------------------------------------
10 c
11 c December 10, 1992; hnw
12 c 2014-02-06 RBS: Changed real*4 to real
13 c
14 c Diode model of S.A.Slutz with gap closure and setting resistance to an
15 c open circuit value for negative voltage.
16 c time is the problem time at the half-step,
17 c voltage is the voltage across the diode at the last time step.
18 c (the voltage actually used the the voltage at the last half-step).
19 c conductance is the returned value of the diode conductance (1/R).
20 c
21 c ----------------------------------------------------------------------------
22 c
23 c Declare passed arguments
24 c
25  real time
26  real voltage
27  real var_parms(*)
28  real conductance
29 c
30 c Declare internal parameters
31 c
32  real p
33  parameter(p = 5.5e-8)
34  real condvneg
35  parameter(condvneg = 1.0e-6)
36 c
37 c ----------------------------------------------------------------------------
38 c
39 c Parameters used in this diode model:
40 c tdelay is the time delay before the gap begins to close.
41 c gmin is the minimum conductance the diode may obtain (starts with this
42 c value typically).
43 c gmax is the maximum conductance the diode may obtain (ends with this value
44 c typically).
45 c area is the effective diode area (include enhancement factors here).
46 c gap is the initial diode gap (before closure).
47 c velocity is the gap closure velocity.
48 c gapmin is the minimum allowable effective gap.
49 c pmass_ratio is the ratio of the proton mass to the subject mass
50 c voltlast is the voltage at the last time step.
51 c
52 c Enhancement factors are entered by multiplying the area value (user does it).
53 c
54 c ----------------------------------------------------------------------------
55 c
56 c If the voltage is negative, set the conductance for an open circuit
57 c (so it really is a diode).
58 c
59  voltlast = var_parms(9)
60  volthalf = 0.5 * (voltlast + voltage)
61 c
62  if (volthalf .lt. 0.0) then
63  conductance = condvneg
64 c
65 c If the voltage is nonnegative, set the gap and find conductance.
66 c
67  else
68  tdelay = var_parms(1)
69  gmin = var_parms(2)
70 c
71 c If the gap has not started to close yet, set the diode conductance to
72 c its minimum value (largest resistance with a positive voltage).
73 c
74  if (time .le. tdelay) then
75  conductance = gmin
76 c
77 c Otherwise, find the effective gap. If it is too small, set it
78 c to its minimum value. Then calculate the conductance
79 c and check to see if it is in the bounds of gmin and gmax.
80 c
81  else
82  gmax = var_parms(3)
83  area = var_parms(4)
84  gap = var_parms(5)
85  velocity = var_parms(6)
86  gapmin = var_parms(7)
87  pmass_ratio = var_parms(8)
88 c
89  effgap = gap - velocity * (time-tdelay)
90  effgap = amax1(effgap, gapmin)
91 c
92  effgap2 = effgap * effgap
93  conductance = (p * area * sqrt(volthalf)) / effgap2
94  conductance = conductance * sqrt(pmass_ratio)
95  if (conductance .gt. gmax) then
96  conductance = gmax
97  else if (conductance .lt. gmin) then
98  conductance = gmin
99  end if
100 c
101  end if
102 c
103  end if
104 c
105 c Reset the voltage at the last time step.
106 c
107  var_parms(9) = voltage
108 c
109 c -----------------------------------------------------------------------------
110 c
111  return
112  end
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c c c c SW1 c c c158 MFI Insulator CB c c & gmax
Definition: zdemfmt.h:154
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K gap
Definition: zdemfmt.h:84
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field time
Definition: zdemfmt.h:85
subroutine sdiode_model
Definition: diodemdl.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c c c c SW1 c c c158 MFI Insulator CB c & gmin
Definition: zdemfmt.h:153