Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
sphflmdl.f
Go to the documentation of this file.
1  subroutine sphfoil_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 c ----------------------------------------------------------------------
9 c Modifications:
10 c 08/21/95, MLK, removed use of tand intrinsic and replaced with tan
11 c by converting degree argument to radians
12 c 2014-02-06 RBS: Changed real*4 to real
13 c ----------------------------------------------------------------------
14 c
15 c Summary:
16 c
17 c Screamer SPHERICAL foil implosion subroutine.
18 c Treats r2 and l2 as variable elements (r2 is dl2/dt).
19 c
20 c Define:
21 c the next full time step as t=i (variable suffix t0)
22 c the current half time step as t=i-1/2 (variable suffix t1)
23 c the previous full time step as t=i-1 (variable suffix t2)
24 c the previous half time step as t=i-3/2 (variable suffix t3)
25 c the previous, previous full time step as t=i-2 (variable suffix t4)
26 c the previous, previous half time step as t=i-5/2 (variable suffix t5)
27 c
28 c Calculates the following values for an imploding foil:
29 c Passed via argument list:
30 c inductance (=lt1) at t=i-1/2
31 c time rate of change of inductance (=ldott2) at t=i-1
32 c Passed via 'zdemout.h' common blocks:
33 c foil kinetic energy (=foilke) at t=i-1/2
34 c foil radius (=foilrad) at t=i-1/2
35 c foil velocity (=foilvel) at t=i-1/2
36 c foil acceleration (=foilacc) at t=i-1
37 c When the calculated foil radius becomes less than or equal to the
38 c minimum radius, the implosion stops and this routine sets:
39 c radt1 = (foilrad =) minrad
40 c lt1 = lminrad
41 c ldott2 = 0
42 c foilke = 0
43 c foilvel = 0
44 c foilacc = 0
45 c
46 c ------------------------------------------------------------------------------
47 c
48 c Include the file which has a common block for storing some unusual
49 c parameters from this model
50 c
51  include 'zdemmax.h' !parameters
52  include 'zdemout.h' !common blocks
53 c
54 c ------------------------------------------------------------------------------
55 c
56 c Read only passed arguments
57 c
58  real time !simulation time, t=i
59  real dt !time-step
60  real rdt !1/dt
61  real ilt2 !current through this inductor at t=i-1
62 c
63 c Read and write passed arguments
64 c
65  real parms(*) !model parameters for this circuit element
66 c
67 c Write only passed arguments
68 c
69  real ldott2 !time rate of change of inductance at t=i-1/2
70  real lt1 !inductance at t=i-1/2
71 c
72 c ------------------------------------------------------------------------------
73 c
74 c Internal parameter
75 c
76  real mu, pi
77  parameter(mu = 2.0e-7)
78  parameter(pi = 3.14159265359)
79 c
80  real implode, end_implode
81  parameter(implode = 0.0, end_implode = 1.0)
82 c
83 c Set internal variables
84 c
85  real initrad !initial radius
86  real angl !foil included angle
87  real mass !mass
88  real minrad !minimum radius
89  real arc !arc length
90  real lminrad !inductance at minimum radius
91  real lt3 !inductance from t=i-3/2
92  real radt1 !calculated radius, t=i-1/2
93  real radt3 !radius from t=i-3/2
94  real velt1 !calculated velocity, t=i-1/2
95  real velt3 !velocity from t=i-3/2
96  real acct2 !calculated acceleration, t=i-1
97  real testimpl !calculated current state of foil
98  !(imploding or stagnated)
99  real theta !angl/2
100  real beta !(theta + 90)/2
101 c
102 c ------------------------------------------------------------------------------
103 c
104 c Set the model parameters to understandable names.
105 c
106  initrad = parms(1)
107  angl = parms(2)
108  mass = parms(3)
109  minrad = parms(4)
110 c
111  lt3 = parms(5)
112  radt3 = parms(6)
113  velt3 = parms(7)
114  testimpl = parms(8)
115 c
116 c ------------------------------------------------------------------------------
117 c
118 c Calculate the acceleration, velocity and radius of the foil.
119 c From these, calculate L and dL/dt (=R)
120 c
121 c The acceleration at t=i-1 is defined by:
122 c acct2 = -(mu * ilt2**2 * arc ) / ( 2 * mass * radt3 )
123 c
124 c The time centered velocity is defined by:
125 c (velt1 - velt3) / dt = acct2
126 c
127 c The time centered radius is defined by:
128 c (radt1 - radt3) / dt = 0.5 * (velt1 + velt3)
129 c
130 c L (lt1) is defined by:
131 c theta = angl/2
132 c beta = (theta + 90)/2
133 c 2*mu*(initrad-radt1)*(log(tan(beta*pi/180.0)))
134 c
135 c dL/dt (ldott2) is defined by:
136 c (lt1 - lt3) / dt
137 c
138 c ------------------------------------------------------------------------------
139 c
140 c For an SPHERICAL imploding foil:
141 c
142  theta = angl/2
143  beta = (theta + 90)/2
144  lminrad = 2*mu*(initrad-minrad)*(log(tan(beta*pi/180.0)))
145 c
146 c ------------------------------------------------------------------------------
147  if (testimpl .eq. implode) then
148 c
149 c a. Foil acceleration
150 c
151  arc = pi * radt3 * (angl/180.0)
152  acct2 = -(mu * ilt2**2 * arc ) / ( 2 * mass * radt3 )
153 c
154 c b. Foil velocity
155 c
156  velt1 = velt3 + acct2*dt
157 c
158 c c. Foil radius, check to see if less than minimum radius, if
159 c so, print a message that this has occurred and set values
160 c appropriately. But keep going with the calculation since
161 c the foil radius has changed this time step.
162 c
163  radt1 = radt3 + ((velt1+velt3) * dt * 0.5)
164  if (radt1 .lt. minrad) then
165  radt1 = minrad
166  testimpl = end_implode
167  write(9,999) time, minrad
168  end if
169 c
170 c d. Foil inductance
171 c
172  lt1 = 2*mu*(initrad-radt1)*(log(tan(beta*pi/180.0)))
173 
174 c e. Time rate of change of inductance
175 c
176  ldott2 = (lt1 - lt3) * rdt
177 c
178 c f. Put some values into a common block so that they will be
179 c available for plotting.
180 c
181  foilke = 0.5 * mass * velt1 * velt1
182  foilrad = radt1
183  foilvel = velt1
184  foilacc = acct2
185 c
186 c g. Save all values required for next time step.
187 c
188  parms(5) = lt1
189  parms(6) = radt1
190  parms(7) = velt1
191  parms(8) = testimpl
192 c
193 c ------------------------------------------------------------------------------
194 c For stagnant foil (constant radius and inductance):
195 c
196  else
197 c
198 c d. Foil inductance
199 c
200  lt1 = lminrad
201 c
202 c e. Time rate of change of inductance
203 c
204  ldott2 = 0.0
205 c
206 c f. Put some values into a common block so that they will be
207 c available for plotting.
208 c
209  foilke = 0.0
210  foilrad = minrad
211  foilvel = 0.0
212  foilacc = 0.0
213 c
214  end if
215 c
216 c ------------------------------------------------------------------------------
217  999 format
218  & ('1 '/
219  & ' ------------------------------------------------------------'/
220  & ' Foil radius has reached the minimum value.'/
221  & ' time: ', 1pe10.3/
222  & ' minimum radius: ', 1pe10.3/
223  & ' ------------------------------------------------------------'/
224  & //////////)
225 c ------------------------------------------------------------------------------
226  return
227  end
subroutine sphfoil_model
Definition: sphflmdl.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