Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
cylflmdl.f
Go to the documentation of this file.
1  subroutine cylfoil_model
2 c read only arguments
3  & (time, dt, rdt, ilt2,
4 c read and write arguments
5  & parms,
6 c write only arguments
7  & ldott2, lt1)
8 
9  character(len=80)::buffer
10 c ------------------------------------------------------------------------------
11 c
12 c Modification:
13 c 01/03/94, KWS, add Mosher/Krisnan/Guiliani K-line radiation yield
14 c calculations
15 c 04/29/95, MLK, write(5,999) changed to write (6,999)
16 c unit 5 is stdin, unit 6 is stdout
17 c 08/12/97, KWS, added peak-current diagnostic
18 c 2008-11-05, RBS buffer write error fixed '/' cannot be used
19 c 2014-02-06 RBS: Real*4 to real
20 c
21 c Summary:
22 c
23 c Screamer CYLINDRICAL foil implosion subroutine.
24 c Treats r2 and l2 as variable elements (r2 is dl2/dt).
25 c
26 c Define:
27 c the next full time step as t=i (variable suffix t0)
28 c the current half time step as t=i-1/2 (variable suffix t1)
29 c the previous full time step as t=i-1 (variable suffix t2)
30 c the previous half time step as t=i-3/2 (variable suffix t3)
31 c the previous, previous full time step as t=i-2 (variable suffix t4)
32 c the previous, previous half time step as t=i-5/2 (variable suffix t5)
33 c
34 c Calculates the following values for an imploding foil:
35 c Passed via argument list:
36 c inductance (=lt1) at t=i-1/2
37 c time rate of change of inductance (=ldott2) at t=i-1
38 c Passed via 'zdemout.h' common blocks:
39 c foil kinetic energy (=foilke) at t=i-1/2
40 c foil radius (=foilrad) at t=i-1/2
41 c foil velocity (=foilvel) at t=i-1/2
42 c foil acceleration (=foilacc) at t=i-1
43 c When the calculated foil radius becomes less than or equal to the
44 c minimum radius, the implosion stops and this routine sets:
45 c radt1 = (foilrad =) minrad
46 c lt1 = mu * length * ln (initrad/minrad) (=lminrad)
47 c ldott2 = 0
48 c foilke = 0
49 c foilvel = 0
50 c foilacc = 0
51 c
52 c ------------------------------------------------------------------------------
53 c
54 c Include the file which has a common block for storing some unusual
55 c parameters from this model
56 c
57  include 'zdemmax.h' !parameters
58  include 'zdemout.h' !common blocks
59 c
60 c ------------------------------------------------------------------------------
61 c
62 c Read only passed arguments
63 c
64  real time !simulation time, t=i
65  real dt !time-step
66  real rdt !1/dt
67  real ilt2 !current through this inductor at t=i-1
68 c
69 c Read and write passed arguments
70 c
71  real parms(*) !model parameters for this circuit element
72 c
73 c Write only passed arguments
74 c
75  real ldott2 !time rate of change of inductance at t=i-1/2
76  real lt1 !inductance at t=i-1/2
77 c
78 c
79 c ------------------------------------------------------------------------------
80 c
81 c Set some internal parameters
82 c
83  real implode, end_implode
84  parameter(implode = 0.0, end_implode = 1.0)
85 c
86 c Set internal variables
87 c
88  real initrad !initial radius
89  real minrad !minimum radius
90  real mass !mass in kilograms
91  real aconst !-(mu*length)/(2*mass)
92  real lconst !(mu*length)
93  real lminrad !inductance at minimum radius
94  real lt3 !inductance from t=i-3/2
95  real radt1 !calculated radius, t=i-1/2
96  real radt3 !radius from t=i-3/2
97  real velt1 !calculated velocity, t=i-1/2
98  real velt3 !velocity from t=i-3/2
99  real acct2 !calculated acceleration, t=i-1
100  real testimpl !calculated current state of foil
101  ! (imploding or stagnated)
102  real length !foil length in meters
103  real massg !foil mass in grams
104 c
105 c ------------------------------------------------------------------------------
106 c
107 c Set the model parameters to understandable names.
108 c
109  initrad = parms(1)
110  minrad = parms(2)
111  mass = parms(3)
112  aconst = parms(4)
113  lconst = parms(5)
114  lminrad = parms(6)
115  lt3 = parms(7)
116  radt3 = parms(8)
117  velt3 = parms(9)
118  testimpl = parms(10)
119  length = parms(11)
120  massg = parms(12)
121  peakcur = parms(13)
122 c
123 c ------------------------------------------------------------------------------
124 c
125 c Calculate the acceleration, velocity and radius of the foil.
126 c From these, calculate L and dL/dt (=R)
127 c
128 c The acceleration at t=i-1 is defined by:
129 c acct2 = - ( mu * ilt2**2 *length) / (2 * mass * radt3)
130 c
131 c The time centered velocity is defined by:
132 c (velt1 - velt3) / dt = acct2
133 c
134 c The time centered radius is defined by:
135 c (radt1 - radt3) / dt = 0.5 * (velt1 + velt3)
136 c
137 c L (lt1) is defined by:
138 c (mu * length) * ln(initrad/radt1)
139 c
140 c dL/dt (ldott2) is defined by:
141 c (lt1 - lt3) / dt
142 c
143 c ------------------------------------------------------------------------------
144 c
145  if (abs(ilt2) .gt. peakcur) then
146  peakcur = abs(ilt2)
147  endif
148 c
149 c For an imploding foil:
150 c
151  if (testimpl .eq. implode) then
152 c
153 c a. Foil acceleration
154 c
155  acct2 = (ilt2 * ilt2 * aconst) / (radt3)
156 c
157 c b. Foil velocity
158 c
159  velt1 = velt3 + acct2*dt
160 c
161 c c. Foil radius, check to see if less than minimum radius, if
162 c so, print a message that this has occurred and set values
163 c appropriately. But keep going with the calculation since
164 c the foil radius has changed this time step.
165 c
166  radt1 = radt3 + ((velt1+velt3) * dt * 0.5)
167  if (radt1 .lt. minrad) then
168  radt1 = radt3
169  testimpl = end_implode
170 c velt1 = abs(velt1/1.4142)
171 c velt1 = 0.8944 * abs(velt1)
172  foilke = 0.5 * mass * velt1 * velt1
173 c
174 c Write implosion status to the log file at device 9
175 c
176  write(9,
177  & '(/A/,A/,A,1pe10.3/,A,1pe10.3/,A,1pe10.3/,A,1pe10.3/,A,
178  & 1pe10.3/,A/)')
179  & ' ------------------------------------------------------------',
180  & ' Foil radius has reached the minimum value.',
181  & ' time: ',time,
182  & ' minimum radius: ',minrad,
183  & ' maximum KE: ',foilke,
184  & ' peak velocity: ',velt1,
185  & ' peak current: ',peakcur,
186  & ' ------------------------------------------------------------'
187 
188  write(buffer,'(A)')
189  & ' ------------------------------------------------'
190  call writebuffer(buffer)
191  write(buffer,'(A)')
192  & ' Foil radius has reached the minimum value.'
193  call writebuffer(buffer)
194  write(buffer,'(A,1pe10.3)') ' time: ',time
195  call writebuffer(buffer)
196  write(buffer,'(A,1pe10.3)') ' minimum radius: ',minrad
197  call writebuffer(buffer)
198  write(buffer,'(A,1pe10.3)') ' maximum KE: ',foilke
199  call writebuffer(buffer)
200  write(buffer,'(A,1pe10.3)') ' peak velocity: ',velt1
201  call writebuffer(buffer)
202  write(buffer,'(A,1pe10.3)') ' peak current: ',peakcur
203  call writebuffer(buffer)
204  write(buffer,'(A)')
205  & ' ------------------------------------------------'
206  call writebuffer(buffer)
207  end if
208 c
209 c d. Foil inductance
210 c
211  lt1 = lconst * log(initrad/radt1)
212 c
213 c e. Time rate of change of inductance
214 c
215  ldott2 = (lt1 - lt3) * rdt
216 c
217 c f. Put some values into a common block so that they will be
218 c available for plotting.
219 c
220  foilke = 0.5 * mass * velt1 * velt1
221  foilrad = radt1
222  foilvel = velt1
223  foilacc = acct2
224 c
225 c g. Save all values required for next time step.
226 c
227  parms(7) = lt1
228  parms(8) = radt1
229  parms(9) = velt1
230  parms(10) = testimpl
231  parms(13) = peakcur
232 c
233 c Calculate the radiation yield for aluminum, argon, copper, krypton, and xenon
234 c
235  if (radyields) then
236  call yield(13.,mass,radt1,length,foilke,eta,t,yw_al,ym_al)
237  call yield(18.,mass,radt1,length,foilke,eta,t,yw_ar,ym_ar)
238  call yield(29.,mass,radt1,length,foilke,eta,t,yw_cu,ym_cu)
239  call yield(36.,mass,radt1,length,foilke,eta,t,yw_kr,ym_kr)
240  call yield(54.,mass,radt1,length,foilke,eta,t,yw_xe,ym_xe)
241  endif
242 c
243 c For stagnant foil (constant radius and inductance):
244 c
245  else
246 c
247 c d. Foil inductance
248 c
249  lt1 = lminrad
250 c
251 c e. Time rate of change of inductance
252 c
253  ldott2 = 0.0
254 c
255 c f. Put some values into a common block so that they will be
256 c available for plotting.
257 c
258  foilke = 0.0
259  foilrad = minrad
260  foilvel = 0.0
261  foilacc = 0.0
262 c
263  end if
264 c
265 c ------------------------------------------------------------------------------
266 c
267 c
268 c ------------------------------------------------------------------------------
269 c
270  return
271  end
subroutine cylfoil_model
Definition: cylflmdl.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 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 length
Definition: zdemfmt.h:83
subroutine yield(Z, massm, rfm, Lzm, Kin, eta, T, Yw, Ym)
Definition: yield.f:1