3 c-----description-------------------------------------------------------
5 c author/date: mathias bavay 11/04
8 c ----------------------------------------------------------------------
10 c purpose: this subroutines does an energy check at the half
time step.
12 c called by:
Program zdem
16 c include the files with the various keywords and
integer flags.
21 c include the files specifying the array dimensions and the
common blocks.
30 c include
file with version string
34 c -----------------------------------------------------------------------------
37 c -----------------------------------------------------------------------------
39 c energy check at the half
time step.
42 c the energy currently stored in the capacitors(ecap),
43 c the energy currently stored in the inductors(eind),
44 c the energy dissipated in the shunt conductances this step(decon),
45 c the energy dissipated in the series resistors this step(deres),
46 c the total energy dissipated in the shunt conductances(econ),
47 c the total energy dissipated in the series resistors(eres),
48 c the energy dissipated by a variable inductor in this step(dlossind),
49 c the energy dissipated by a variable capacitor in this step(dlosscap),
50 c the total energy dissipated by variable inductors(elossind),
51 c the total energy dissipated by variable capacitors(elosscap).
60 c calculate the energy
associated with each circuit g,
c, l, r.
65 halfi = 0.5 * (zirn(i,ib) + zir(i,ib))
66 halfi2 = halfi * halfi
67 halfv = 0.5 * (vn(i,ib) + v(i,ib))
68 halfv2 = halfv * halfv
69 eind = 0.5 * zlrechk(i,ib) * halfi2 + eind
70 ecap = 0.5 * cechk(i,ib) * halfv2 + ecap
71 decon = ht * g(i,ib) * halfv2 + decon
72 deres = ht * rr(i,ib) * halfi2 + deres
73 dlossind = htd2 * zlrdot(i,ib) * halfi2 + dlossind
74 dlosscap = htd2 * cdot(i,ib) * halfv2 + dlosscap
78 c find the energy added by sources in the last
time step.
83 ibranch = indexvs(2,i)
84 halfv = 0.5 * (v(node,ibranch) + vn(node,ibranch))
89 halfi = 0.5 * (zir(node,ibranch) + zirn(node,ibranch))
90 psource = psource + (halfv * halfi)
96 halfi = 0.5 * (zir(node1,ibranch)+zirn(node1,ibranch))
97 psource = psource - (halfv * halfi)
101 do i = 1, ncurrsource
103 ibranch = indexcs(2,i)
104 halfi = 0.5 * (zir(node,ibranch) + zirn(node,ibranch))
108 if (node .eq. 1)
then
110 halfv = 0.5 * (v(node2,ibranch) + vn(node2,ibranch))
111 psource = psource + (halfv * halfi)
116 halfv = 0.5 * (v(node,ibranch) + vn(node,ibranch))
117 psource = psource - (halfv * halfi)
121 esource = psource * ht
123 c check total energy from all components against the total
128 elossind = elossind + dlossind
129 elosscap = elosscap + dlosscap
130 esour = esour + esource
131 esum = -esour + eind + ecap + eres + econ
132 & + elossind + elosscap
133 error = esum / (esour+1.0e-4)
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 c c c c SW1 c c c158 MFI Insulator CB c c c c161 Z FLOW Plasma Loss Current c c c Applied B Diode c &Ion Ion c c c c Initial c PRINT Output Request for block
subroutine zdem(ifile, clen)
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 This is a Fortran header file