61 toa, rb, ts, fr, tn, tnp1)
70 REAL(DBL),
INTENT(IN) :: delt, p, qr, to, rhoc
71 REAL(DBL),
INTENT(IN) :: qr_old, fr_old
72 REAL(DBL),
INTENT(INOUT) :: toa
73 REAL(DBL),
INTENT(INOUT) :: rb, ts, fr
74 REAL(DBL),
INTENT(IN) :: tn(:)
75 REAL(DBL),
INTENT(OUT) :: tnp1(:)
82 INTEGER :: iter, itrmx,
i, mpi_comm_rocburn
83 REAL(DBL) :: rblast, tslast
84 REAL(DBL) :: fs, rb_old
85 REAL(DBL) :: first(1:g_zn%nxmax), second(1:g_zn%nxmax)
86 REAL(DBL) :: da(1:g_zn%nxmax), db(1:g_zn%nxmax), dc(1:g_zn%nxmax)
93 IF(g_zn%Model_combustion == 3)
THEN
100 rb=g_zn%a_p*p**g_zn%n_p
109 fs=rb*(ts-toa)/g_zn%alfac-fr_old*qr_old/g_zn%lamc
111 DO iter=0,g_zn%itermax
117 CALL
cmpct1(g_zn%nx,g_zn%delz,tn,first, da, db, dc)
118 CALL
cmpct2(g_zn%nx,g_zn%delz,tn,second, da, db, dc)
125 tnp1(
i)=tn(
i)+delt*( &
126 (g_zn%alfac*g_zn%zxx(
i)-rb_old*g_zn%zx(
i))*first(
i) + &
127 g_zn%alfac*g_zn%zx(
i)**2*second(
i) + &
128 fr_old*qr_old/rhoc/g_zn%C*g_zn%Ka*exp(g_zn%Ka*g_zn%x(
i)))
131 tnp1(g_zn%nx)=g_zn%To
137 tnp1(1)=(18.0*tnp1(2)-9.0*tnp1(3)+2.0*tnp1(4) &
138 -6.0*g_zn%delz*fs/g_zn%zx(1))/11.0
149 CALL
zn(p, qr, to, ts, toa, rb, fr)
154 fs=rb*(ts-toa)/g_zn%alfac-fr*qr/g_zn%lamc
157 IF(abs(ts-tslast).lt.g_zn%tol_Ts.and.abs(rb-rblast).lt.g_zn%tol_Ts)
THEN
167 print *,
' ROCBURN_ZN: rank=',g_zn%rank
168 print *,
' ROCBURN_ZN: Error - burning rate: Maximum # of iterations '
169 print *,
' ROCBURN_ZN: itrmx=', g_zn%itermax,
'reached'
170 print *,
' ROCBURN_ZN: tol_Ts=',g_zn%tol_Ts
171 print *,
' ROCBURN_ZN: Tn=',tn
172 print *,
' ROCBURN_ZN: Tnp1=',tnp1
216 SUBROUTINE zn(P, qr, To, Ts, Toa, rb, fr)
220 REAL(DBL) :: p, qr, to
221 REAL(DBL) :: ts, rb, toa, fr
223 REAL(DBL) :: delta_t2, ag
226 REAL(DBL),
parameter :: tol=1.
d-5
233 REAL(DBL) ::
j(2,2),xx(2),e(2)
235 REAL(DBL) :: term0, term1, term2, term3, term4, term5
236 REAL(DBL) :: xcd, da, xg
241 term1=g_zn%Ac*g_zn%R*(ts*rhoc)**2*g_zn%alfac*g_zn%C* &
242 exp(-g_zn%Ec/g_zn%R/ts)/g_zn%Ec
252 IF(g_zn% Model_combustion == 1)
THEN
259 ag=g_zn%Bg/(g_zn%R*g_zn%R)*g_zn%MW*g_zn%MW
262 DO iter=0,g_zn%itermax
268 xreac=2.0*rhoc*g_zn%alfac*g_zn%R*ts/xx(1)/g_zn%Ec
269 term0=1.0-g_zn%Ka*xreac
271 fr=dexp(-xreac*g_zn%Ka)
272 term2=g_zn%C*(ts-xx(2))-g_zn%Qc/2.0-fr*qr/xx(1)
276 j(1,1)=2.0*xx(1)+term3/term2*fr*qr/xx(1)**2*term0
277 j(1,2)=-term3*g_zn%C/term2
284 xcd=g_zn%lamg/g_zn%C/xx(1)
285 da=4.0*g_zn%Bg*g_zn%C/g_zn%lamg*(p*g_zn%MW*xcd/g_zn%R)**2
287 xg=2.0*xcd/(term4-1.0)
288 term5=g_zn%Qc-g_zn%C*(ts-xx(2))
289 tf=(qr/xx(1)+g_zn%Qc+g_zn%Qg)/g_zn%C+xx(2)
291 e(2)=(tf-ts)/xg+(qr+xx(1)*term5)/g_zn%lamg
292 j(2,1)=-qr/xg/xx(1)**2/g_zn%C-(tf-ts)/xg/xx(1)/term4+term5/g_zn%lamg
300 if(xx(1).lt.0.0)
then
301 print *,
' ROCBURN_ZN: rank=',g_zn%rank, &
302 ' rb negative xx(1)=',xx(1),
' Ts=',ts
306 if(abs(e(1)).lt.tol .and. abs(e(2)).lt.tol)
then
313 fr=dexp(-xreac*g_zn%Ka)
319 WRITE(*,*)
' ROCBURN_ZN: in ZN rank=',g_zn%rank, &
320 ' Error-WSB: Maximum # of iterations reached'
325 if(g_zn%Model_combustion.eq.2)
then
333 DO iter=0,g_zn%itermax
339 xreac=2.0*rhoc*g_zn%alfac*g_zn%R*ts/xx(1)/g_zn%Ec
340 term0=1.0-g_zn%Ka*xreac
342 fr=dexp(-xreac*g_zn%Ka)
343 term2=g_zn%C*(ts-xx(2))-g_zn%Qc/2.0-fr*qr/xx(1)
347 j(1,1)=2.0*xx(1)+term3/term2*fr*qr/xx(1)**2*term0
348 j(1,2)=-term3*g_zn%C/term2
356 delta_t2 = ts - 300.0
357 e(2)=g_zn%a_T*((ts-xx(2)-qr/(xx(1)*g_zn%C))/delta_t2)**g_zn%n_T - &
358 rhoc*g_zn%a_p*p**g_zn%n_p/xx(1)
359 j(2,1)=rhoc*g_zn%a_p*p**g_zn%n_p/(xx(1)*xx(1))
360 j(2,2)=-g_zn%n_T*g_zn%a_T*(ts-xx(2)-qr/(xx(1)*g_zn%C))**(g_zn%n_T-1.0)/ &
371 if(xx(1).lt.0.0)
then
372 print *,
' ROCBURN_ZN: inside ZN rank=',g_zn%rank, &
373 ' rb negative xx(1)=',xx(1),
' Ts=',ts
377 if(abs(e(1)).lt.tol .and. abs(e(2)).lt.tol)
then
384 fr=dexp(-xreac*g_zn%Ka)
390 WRITE(*,*)
' ROCBURN_ZN: in ZN rank=',g_zn%rank, &
391 ' Error-Composite: Maximum # of iterations reached'
396 IF(g_zn%Model_combustion == 3)
THEN
405 rb=g_zn%a_p*p**g_zn%n_p
412 WRITE(*,*)
' ROCBURN_ZN: in ZN rank=',g_zn%rank, &
413 ' Error-ZN: No appropriate combustion model'
414 WRITE(*,*)
' ROCBURN_ZN: Combustion Model= ', g_zn%Model_combustion
436 REAL(DBL) ::
x(2),
j(2,2),e(2),detj,delx(2),dum
439 detj=
j(1,1)*
j(2,2)-
j(2,1)*
j(1,2)
442 print *,
' ROCBURN_ZN: in Newton rank=',g_zn%rank, &
443 ' Error: singular matrix encountered'
444 print *,
' ROCBURN_ZN: P=', p
445 print *,
' ROCBURN_ZN: J=',
j
462 delx(
i)=
j(
i,1)*e(1)+
j(
i,2)*e(2)
484 REAL(DBL) :: h,u(imax),f(imax)
486 REAL(DBL) ::
a(:),
b(:),cc(:)
499 f(1)=(-25.0*u(1)+48.0*u(2)-36.0*u(3)+16.0*u(4)-3.0*u(5))/(12.0*h)
505 f(
i)=3.0*(u(
i+1)-u(
i-1))/h
539 REAL(DBL) :: h,h2,u(imax),
s(imax)
540 REAL(DBL) ::
a(:),
b(:),cc(:)
555 s(1)=(45.0*u(1)-154.0*u(2)+214.0*u(3)-156.0*u(4)+61.0*u(5)- &
562 s(
i)=12.0*(u(
i+1)-2.0*u(
i)+u(
i-1))/h2
597 REAL(DBL) ::
a(:),
b(:),
c(:),
d(:)
608 d(imax)=
d(imax)/
b(imax)
subroutine tridg(imax, a, b, c, d)
subroutine zn(P, qr, To, Ts, Toa, rb, fr)
subroutine cmpct1(imax, h, u, f, a, b, cc)
subroutine newton(x, J, e)
subroutine cmpct2(imax, h, u, s, a, b, cc)
subroutine zn_calc_burning_rate(G_ZN, delt, P, qr, To, rhoc, qr_old, fr_old, Toa, rb, Ts, fr, Tn, Tnp1)