Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
gaspfmdl.f
Go to the documentation of this file.
1  subroutine gaspuff_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 Summary:
13 c
14 c Screamer gas puff implosion subroutine.
15 c
16 c Define:
17 c the next full time step as t=i (variable suffix t0)
18 c the current half time step as t=i-1/2 (variable suffix t1)
19 c the previous full time step as t=i-1 (variable suffix t2)
20 c the previous half time step as t=i-3/2 (variable suffix t3)
21 c the previous, previous full time step as t=i-2 (variable suffix t4)
22 c the previous, previous half time step as t=i-5/2 (variable suffix t5)
23 c
24 c Calculates the following values for an imploding gas puff:
25 c Passed via argument list:
26 c inductance (=lt1) at t=i-1/2
27 c time rate of change of inductance (=ldott2) at t=i-1
28 c Passed via 'zdemout.h' common blocks:
29 c gas puff kinetic energy (=gaske) at t=i-1/2
30 c gas puff radius (=gasrad) at t=i-1/2
31 c gas puff velocity (=gasvel) at t=i-1/2
32 c gas puff acceleration (=gasacc) at t=i-1
33 c When the calculated gas puff radius becomes less than or equal to the
34 c minimum radius, the implosion stops and this routine sets:
35 c radt1 = (gpuffrad =) minrad
36 c lt1 = mu * length * ln (initrad/minrad) (=lminrad)
37 c ldott2 = 0
38 c gaske = 0
39 c gasvel = 0
40 c gasacc = 0
41 c
42 c ------------------------------------------------------------------------------
43 c
44 c Modifications:
45 c MLK, 3/23/95, Moved printing of 999 format message to point where
46 c masst1 was defined. Also, fixed 999 message so that
47 c it is not misleading -- achieving min-radius does not
48 c imply max kinetic energy, nor max velocity.
49 c
50 c MLK, 4/29/95, write(5,999) changed to write (6,999)
51 c unit 5 is stdin, unit 6 is stdout
52 c 2014-02-06 RBS: Changed real*4 to real
53 c
54 c ------------------------------------------------------------------------------
55 c
56 c Include the file which has a common block for storing some unusual
57 c parameters from this model
58 c
59  include 'zdemmax.h' !parameters
60  include 'zdemout.h' !common blocks
61 c
62 c ------------------------------------------------------------------------------
63 c
64 c Read only passed arguments
65 c
66  real time !simulation time, t=i
67  real dt !time-step
68  real rdt !1/dt
69  real ilt2 !current through this inductor at t=i-1
70 c
71 c Read and write passed arguments
72 c
73  real parms(*) !model parameters for this circuit element
74 c
75 c Write only passed arguments
76 c
77  real ldott2 !time rate of change of inductance at t=i-1/2
78  real lt1 !inductance at t=i-1/2
79 c
80 c
81 c ------------------------------------------------------------------------------
82 c
83 c Set some internal parameters
84 c
85  real implode, end_implode
86  parameter(implode = 0.0, end_implode = 1.0)
87 c
88 c Set internal variables
89 c
90  real initrad !initial radius
91  real minrad !minimum radius
92  real innerrad !inner radius
93  real massri !mass when radius=rinner
94  real masst3 !mass at t=i-3/2
95  real masst1 !calculated mass at t=i-1/2
96  real density !density
97  real aconst !-(mu*length)/2
98  real dconst !(2*pi*length*density)
99  real lconst !(mu*length)
100  real mconst !(pi*length*density)
101  real lminrad !inductance at minimum radius
102  real lt3 !inductance from t=i-3/2
103  real radt1 !calculated radius, t=i-1/2
104  real radt3 !radius from t=i-3/2
105  real velt1 !calculated velocity, t=i-1/2
106  real velt3 !velocity from t=i-3/2
107  real accilt2 !calculated acceleration term due to current, t=i-1
108  real dragt2 !calculated acceleration term due to drag, t=i-1
109  real acct2 !calculated total acceleration term, t=i-1
110  real testimpl !calculated current state of foil
111  ! (imploding or stagnated)
112  real initmass !initial mass term
113 c
114 c ------------------------------------------------------------------------------
115 c
116 c Set the model parameters to understandable names.
117 c
118  initrad = parms(1)
119  innerrad = parms(2)
120  minrad = parms(3)
121  massri = parms(4)
122  masst3 = parms(5)
123  density = parms(6)
124  aconst = parms(7)
125  dconst = parms(8)
126  lconst = parms(9)
127  mconst = parms(10)
128  lminrad = parms(11)
129  lt3 = parms(12)
130  radt3 = parms(13)
131  velt3 = parms(14)
132  testimpl = parms(15)
133  initmass = parms(16)
134 c
135 c ------------------------------------------------------------------------------
136 c
137 c Calculate the acceleration, velocity and radius of the gas puff.
138 c From these, calculate L, dL/dt, d(LI)/dI.
139 c
140 c The acceleration at t=i-1 is defined by the sum of:
141 c accilt2 = - ( mu * ilt2**2 *length) / (2 * masst3 * radt3)
142 c dragt2 = (2 * pi * length * density) * radt3 * velt3**2 / masst3
143 c
144 c The time centered velocity is defined by:
145 c (velt1 - velt3) / dt = acct2
146 c
147 c The time centered radius is defined by:
148 c (radt1 - radt3) / dt = 0.5 * (velt1 + velt3)
149 c
150 c L (lt1) is defined by:
151 c (mu * length) * ln(initrad/radt1)
152 c
153 c dL/dt (ldott2) is defined by:
154 c (lt1 - lt3) / dt
155 c
156 c ------------------------------------------------------------------------------
157 c
158 c For an imploding gas puff:
159 c
160  if (testimpl .eq. implode) then
161 c
162 c a. Gas puff acceleration terms
163 c
164  if (radt3 .gt. innerrad) then
165  accilt2 = (ilt2 * ilt2 * aconst) / (radt3 * masst3)
166  dragt2 = (dconst * radt3 * velt3 * velt3 ) / (masst3)
167  acct2 = accilt2 + dragt2
168  else
169  accilt2 = (ilt2 * ilt2 * aconst) / (radt3 * masst3)
170  acct2 = accilt2
171  end if
172 c
173 c b. Gas puff velocity
174 c
175  velt1 = velt3 + acct2*dt
176 c
177 c c. Gas puff radius, check to see if less than minimum radius, if
178 c so, print a message that this has occurred and set values
179 c appropriately. But keep going with the calculation since
180 c the gas puff radius has changed this time step.
181 c
182  radt1 = radt3 + ((velt1+velt3) * dt * 0.5)
183  if (radt1 .lt. minrad) then
184  radt1 = minrad
185  testimpl = end_implode
186  end if
187 c
188 c d. Gas puff inductance
189 c
190  lt1 = lconst * log(initrad/radt1)
191 c
192 c e. Time rate of change of inductance
193 c
194  ldott2 = (lt1 - lt3) * rdt
195 c
196 c
197 c f. New gas puff mass for acceleration terms. Stop increasing it
198 c if radius drops below inner radius allowed.
199 c
200  if (radt1 .gt. innerrad) then
201  masst1 = mconst * (initrad * initrad - radt1 * radt1)
202  & + initmass
203  else
204  masst1 = massri
205  end if
206 c
207 c g. Put some values into the common block so that they will be
208 c available for plotting.
209 c
210  gaske = 0.5 * masst1 * velt1 * velt1
211  gasrad = radt1
212  gasvel = velt1
213  gasacc = acct2
214 c
215 c Print out an informational message about reaching the min-radius
216 c
217  if (testimpl .eq. end_implode) then
218  write(9,
219  & '(/A/,A/,A,1pe10.3/,A,1pe10.3/,A,1pe10.3/,A,1pe10.3/,A/)')
220  & ' ------------------------------------------------------------',
221  & ' Foil radius has reached the minimum value.',
222  & ' time: ',time,
223  & ' minimum radius: ',minrad,
224  & ' KE at min-radius: ',gaske,
225  & ' velocity at min-radius: ',velt1,
226  & ' ------------------------------------------------------------'
227 
228  write(buffer,'(A)')
229  & ' ------------------------------------------------'
230  call writebuffer(buffer)
231  write(buffer,'(A)')
232  & ' Foil radius has reached the minimum value.'
233  call writebuffer(buffer)
234  write(buffer,'(A,1pe10.3)') ' time: ',time
235  call writebuffer(buffer)
236  write(buffer,'(A,1pe10.3)') ' minimum radius: ',minrad
237  call writebuffer(buffer)
238  write(buffer,'(A,1pe10.3)') ' KE at min-radius: ',gaske
239  call writebuffer(buffer)
240  write(buffer,'(A,1pe10.3)') ' velocity at min-radius: ',velt1
241  call writebuffer(buffer)
242  write(buffer,'(A)')
243  & ' ------------------------------------------------'
244  call writebuffer(buffer)
245  end if
246 c
247 c h. Save all values required for next time step.
248 c
249  parms(5) = masst1
250  parms(12) = lt1
251  parms(13) = radt1
252  parms(14) = velt1
253  parms(15) = testimpl
254 c
255 c For stagnant gas puff (constant radius and inductance):
256 c
257  else
258 c
259 c d. Gas puff inductance
260 c
261  lt1 = lminrad
262 c
263 c e. Time rate of change of inductance
264 c
265  ldott2 = 0.0
266 c
267 c f. Put some values into a common block so that they will be
268 c available for plotting.
269 c
270  gaske = 0.0
271  gasrad = minrad
272  gasvel = 0.0
273  gasacc = 0.0
274  end if
275 c
276 c ------------------------------------------------------------------------------
277 c
278  return
279  end
subroutine gaspuff_model
Definition: gaspfmdl.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