Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
zposmdl.f
Go to the documentation of this file.
1  subroutine zpos_model (time, node, ib, parms, gvar)
2 c
3 c changes for version 2.1 (kws):
4 c allows both forward and reverse direction of current.
5 c time-averaged current and voltage values are now used.
6 c
7 c changes for version 2.0 (kws):
8 c changed gvar calculation algorithm to use iup and idown
9 c instead of vsw.
10 c fixed model so it can be used many times in an input deck.
11 c
12 c modification
13 c 1989-03-07 mlk: added END statement
14 c 2014-02-06 rbs: changed real*4 to real
15 c
16 c pos zflow switch subroutine for screamer. to use, set up rcground
17 c followed by the Format statement; variable r1 pos_model
18 c the next line will have:
19 c tsw, cursw, topen, zflowmax, gswmin, gswmax.
20 c
21 c tsw = start time for triggered pos opening(seconds);
22 c cursw = current(amperes) into pos node for current switching;
23 c note; current into pos node not current to ground.
24 c topen = opening time in seconds.
25 c zflowmax = maximum zflow in ohms.
26 c gswmin = the minimum switch conductance in mhos.
27 c gswmax = the maximum switch conductance in mhos.
28 c cbswitch = 1.0, the switch crowbars when the voltage reverses,
29 c anything else it doesn't
30 c
31 c
32 c IMPORTANT: This model will switch the POS with either current or
33 c time depending on how you set TSW and CURSW. The switch opens
34 c when BOTH TSW and CURSW are exceeded!
35 c For example, if you set the current to a high value, but still
36 c less than the maximum expected current, and set the switch time
37 c to a small value, the POS will open when the switch current
38 c exceeds CURSW. The switch time will be the time that CURSW is
39 c first exceeded for any t > TSW. Conversely, if CURSW is set to a
40 c small value that is easily exceeded, the switch will open when
41 c t = TSW.
42 c
43 c zv is the calculated opening rate, zv = zflowmax / topen.
44 c The MINIMUM resistance of the switch is set to be 1/gswmax
45 c
46 c A note on convention: Any variable starting with a "g" is a
47 c conductance, and any variable starting with a "z" is a resistance
48 c or impedance.
49 c
50 c Define passed variables
51 c
52  real time, parms(*), gvar
53  integer node, ib
54 c
55 c Include common variable definitions
56 c
57  include 'zdemmax.h' !parameters
58  include 'zdemout.h' !common blocks
59  include 'zdemwork.h' !working arrays in Zdem
60 c
61 c Define internal variables
62 c
63  real vmin
64  real ttest, cursw, topen, zflowmax, gswmin, gswmax, CBswitch
65  real skip, tsw, cbtest, CBflag, forward
66 c
67 c Set internal variables
68 c
69  parameter (vmin=1.0e3)
70 c
71 c
72 c
73  ttest = parms(1)
74  cursw = parms(2)
75  topen = parms(3)
76  zflowmax = parms(4)
77  gswmin = parms(5)
78  gswmax = parms(6)
79  CBswitch = parms(7)
80 c
81 c The following are saved parameters from one time-step to another
82 c
83  skip = parms(8)
84  tsw = parms(9)
85  ctest = parms(10)
86  CBflag = parms(11)
87  forward = parms(14)
88 c
89 c
90 .ne. if (skip 1.0) then
91  ctest=cursw
92  endif
93 c
94 .eq. if (gswmax 0.0 ) then
95  zmin=5.0e-5
96  else
97  zmin=1/gswmax
98  endif
99 c
100 c Find the average current and voltage
101 c
102 .eq. if (forward 1.0) then
103  node1 = node - 1
104  node2 = node
105  cup = 0.5*(zir(node1,ib)+zirold(node1,ib))
106  cdn = 0.5*(zir(node2,ib)+zirold(node2,ib))
107  else
108  node1 = node
109  node2 = node - 1
110  cup = 0.5*(zir(node1,ib)+zirold(node1,ib))
111  cdn = 0.5*(zir(node2,ib)+zirold(node2,ib))
112  endif
113  csw=cup-cdn
114 c
115  vsw=0.5*(v(node,ib)+vold(node,ib))
116 c
117 c Calculate zflow(t)
118 c
119 .ge..and..ge. if ((timettest)(abs(cup)ctest)) then
120 .ne. if (skip1.0) then
121  tsw=time
122  ctest=0.0
123  skip=1.0
124  endif
125 .eq. if (topen 0.0) then
126  zv = zflowmax/1.0e-10
127  else
128  zv = zflowmax/topen
129  endif
130  z1=zv*(time-tsw)
131  z2=max(z1,zmin)
132  zflow=min(z2,zflowmax)
133  else
134  gvar=gswmax
135  goto 200
136  endif
137 c
138 c Find the equivalent conductance of the switch consistent with the
139 c specified zflow(t).
140 c Set crowbarflag to one (CBflag := 1.0) if voltage reverses and the
141 .eq.c crowbarswitch equals 1.0 (CBswitch 1.0)
142 c
143 .eq. if (CBswitch 1.0) then
144 .ge..and..ne. if ((vsw -vmin) (CBflag 1.0)) then
145 .gt. if (abs(cup) abs(cdn)) then
146  gvar=abs(csw/sqrt(cup**2-cdn**2)) / zflow
147  calczflow=vsw/(sqrt(cup**2-cdn**2)+ 1.0e-12)
148  else
149  gvar=gswmax
150  calczflow=0.0
151  endif
152  goto 200
153  else
154  gvar=gswmax
155  CBflag=1.0
156  calczflow=0.0
157  goto 200
158  endif
159  else
160  goto 100
161  endif
162 c
163 c
164 c
165 100 continue
166 .gt. if (abs(cup) abs(cdn)) then
167  gvar=abs(csw/sqrt(cup**2-cdn**2)) / zflow
168  calczflow=vsw/(sqrt(cup**2-cdn**2)+ 1.0e-12)
169  else
170  gvar=gswmin
171  calczflow=0.0
172  endif
173 c
174 c Bound the switch conductance by gswmin and gswmax
175 c
176 200 continue
177  gvar=min(gvar,gswmax)
178  gvar=max(gvar,gswmin)
179 c
180  parms(8) = skip
181  parms(9) = tsw
182  parms(10) = ctest
183  parms(11) = CBflag
184  parms(12) = calczflow
185  parms(13) = gvar
186 c
187 c write(9,'(e12.4,4i6,6x,11e12.4)')
188 c & time,node,node1,node2,ib,cup,zir(node1,ib),zirold(node1,ib),
189 c & cdn,zir(node2,ib),zirold(node2,ib),vsw,gvar,zflow,calczflow,
190 c & forward
191 c
192  return
193  end
194 
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 tsw
Definition: zdemfmt.h:132
c *****************************************************************************c Parameters for output selections c Added MFI CB parameters c Added callouts for the radiation yield in the c cylindrical foil model c Added line
Definition: zdempprm.h:7
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 & gswmax
Definition: zdemfmt.h:134
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 topen
Definition: zdemfmt.h:132
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into use
Definition: zdemfmt.h:7
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
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 model
Definition: zdemfmt.h:131
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 gswmin
Definition: zdemfmt.h:133
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 it(branch ', i2, ')*****') c 17 format(' '
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 cursw
Definition: zdemfmt.h:132
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 & zflow
Definition: zdemfmt.h:133
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line c
Definition: zdemfmt.h:7
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 & forward
Definition: zdemfmt.h:135
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 switch
Definition: zdemfmt.h:118