1 subroutine zpos_model (time, node, ib, parms, gvar)
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.
7 c changes for version 2.0 (kws):
8 c changed gvar calculation algorithm to
use iup and idown
10 c fixed
model so
it can be used many times in an input deck.
13 c 1989-03-07 mlk: added
END statement
14 c 2014-02-06 rbs: changed
real*4 to real
17 c followed by the
Format statement; variable r1 pos_model
18 c the next
line will have:
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.
25 c zflowmax = maximum
zflow in ohms.
28 c cbswitch = 1.0, the
switch crowbars when the voltage reverses,
29 c anything
else it doesn
't
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
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
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
50 c Define passed variables
52 real time, parms(*), gvar
55 c Include common variable definitions
57 include 'zdemmax.h
' !parameters
58 include 'zdemout.h
' !common blocks
59 include 'zdemwork.h
' !working arrays in Zdem
61 c Define internal variables
64 real ttest, cursw, topen, zflowmax, gswmin, gswmax, CBswitch
65 real skip, tsw, cbtest, CBflag, forward
67 c Set internal variables
69 parameter (vmin=1.0e3)
81 c The following are saved parameters from one time-step to another
90 .ne.
if (skip 1.0) then
94 .eq.
if (gswmax 0.0 ) then
100 c Find the average current and voltage
102 .eq.
if (forward 1.0) then
105 cup = 0.5*(zir(node1,ib)+zirold(node1,ib))
106 cdn = 0.5*(zir(node2,ib)+zirold(node2,ib))
110 cup = 0.5*(zir(node1,ib)+zirold(node1,ib))
111 cdn = 0.5*(zir(node2,ib)+zirold(node2,ib))
115 vsw=0.5*(v(node,ib)+vold(node,ib))
119 .ge..and..ge.
if ((timettest)(abs(cup)ctest)) then
120 .ne.
if (skip1.0) then
125 .eq.
if (topen 0.0) then
126 zv = zflowmax/1.0e-10
132 zflow=min(z2,zflowmax)
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)
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)
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)
174 c Bound the switch conductance by gswmin and gswmax
177 gvar=min(gvar,gswmax)
178 gvar=max(gvar,gswmin)
184 parms(12) = calczflow
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,
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
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
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
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
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into use
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
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
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
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
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
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
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
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