Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
pos2mdl.f
Go to the documentation of this file.
1  subroutine sps2_model (timestep, current, voltage, parms, gvar)
2 c
3 c Define passed variables
4 c
5  real timestep, current, voltage, parms(*), gvar
6 c
7 c December 10, 1992; hnw
8 c 2014-02-06 RBS: Changed real*4 to real
9 c
10 c Calculates value of variable shunt conductance based on a PEOS model
11 c from a SCEPTRE model of DHM and LXS.
12 c Switches by charge pointer.
13 c parms is an array containing parameters of the specific switch,
14 c gvar is the returned conductance.
15 c voltage is the voltage across the switch,
16 c current is the current flowing into the switch.
17 c
18  real ig
19 c
20  qswitch = parms(1)
21  constant = parms(2)
22  gmin = parms(3)
23  gmax = parms(4)
24  charge = parms(5)
25  vold = parms(6)
26  chargesw = parms(7)
27  vnew = voltage
28  parms(6) = vnew
29 c
30 c Accumulate charge and see if we have switched.
31 c
32  ig = abs(current)
33  chargesw = chargesw + ig*timestep
34  parms(7) = chargesw
35 c
36 c If already switched, then integrate the current to get the charge to
37 c find the conductance.
38 c
39  if (chargesw .gt. qswitch) then
40  charge = charge + ig*timestep
41  parms(5) = charge
42  end if
43 c
44 c Now find the conductance and limit if necessary.
45 c
46  if (charge .lt. 1.0e-10) then
47  gvar = gmax
48  else
49 c
50 c Use the voltage at the previous half time step for stability.
51 c
52  vg = 0.5 * abs(vnew + vold)
53  gvar = (constant * sqrt(vg)) / (charge*charge)
54  if (gvar .lt. gmin) then
55  gvar = gmin
56  else if (gvar .gt. gmax) then
57  gvar = gmax
58  end if
59  end if
60 c
61  return
62  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 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
subroutine sps2_model(timestep, current, voltage, parms, gvar)
Definition: pos2mdl.f:1