34 REAL(DBL),
INTENT(IN) :: rb,toa
35 REAL(DBL),
INTENT(OUT) :: dt_max
55 INTEGER,
INTENT(IN) :: comm
56 REAL(DBL),
INTENT(OUT) :: to_read
57 INTEGER ,
INTENT(OUT) :: nx_read
58 INTEGER :: ierror,
rank
59 CHARACTER(*),
INTENT(IN) :: in_dir
62 CALL mpi_comm_rank(comm,
rank, ierror)
79 if(bp%TABUSE == 1) CALL
readtable(bp, in_dir)
94 CHARACTER*(*),
INTENT(IN) :: in_dir
96 CHARACTER(LEN=90) :: filnam
97 INTEGER :: ioerr,
rank,ierror
100 CALL mpi_comm_rank(bp%comm,
rank, ierror)
102 filnam =
'RocburnPYControl.txt'
103 IF (in_dir(len_trim(in_dir):len_trim(in_dir)) ==
'/')
THEN
104 filnam = trim(in_dir) // trim(filnam)
106 filnam = trim(in_dir) //
'/' // trim(filnam)
109 filnam = trim(filnam)
113 OPEN (
unit=ir,file=filnam,
status=
'old',iostat=ioerr)
115 write(*,*)
'LOOKING FOR file ',filnam
116 write(*,*)
'FILE NOT FOUND'
117 CALL mpi_abort(bp%comm, 1, ierror)
123 IF (
rank==0)
WRITE(*,*)
'ROCBURN: a_p =', bp%a_p
126 IF (
rank==0)
WRITE(*,*)
'ROCBURN: n_p =', bp%n_p
129 IF (
rank==0)
WRITE(*,*)
'ROCBURN: Pref =', bp%Pref
132 IF (
rank==0)
WRITE(*,*)
'ROCBURN: Ac= ',bp%Ac
135 IF (
rank==0)
WRITE(*,*)
'ROCBURN: eg_ru= ',bp%eg_ru
138 IF (
rank==0)
WRITE(*,*)
'ROCBURN: ec_ru ',bp%ec_ru
141 IF (
rank==0)
WRITE(*,*)
'ROCBURN: alfac= ',bp%alfac
144 IF (
rank==0)
WRITE(*,*)
'ROCBURN: C= ',bp%C
147 IF (
rank==0)
WRITE(*,*)
'ROCBURN: lamg= ',bp%lamg
150 IF (
rank==0)
WRITE(*,*)
'ROCBURN: delt= ',bp%delt
153 IF (
rank==0)
WRITE(*,*)
'ROCBURN: igrid= ',bp%igrid
156 IF (
rank==0)
WRITE(*,*)
'ROCBURN: numx= ',bp%numx
159 IF (
rank==0)
WRITE(*,*)
'ROCBURN: xmax= ',bp%xmax
162 IF (
rank==0)
WRITE(*,*)
'ROCBURN: beta= ',bp%beta
165 IF (
rank==0)
WRITE(*,*)
'ROCBURN: Tf_adiabatic= ', bp%Tstar0
168 IF (
rank==0)
WRITE(*,*)
'ROCBURN: To= ',bp%To
170 READ(ir,*) bp%Tignition
171 IF (
rank==0)
WRITE(*,*)
'ROCBURN: Tignition= ',bp%Tignition
174 IF (
rank==0)
WRITE(*,*)
'ROCBURN: Initial Temp = ',bp%Tsurf
176 read(ir,*) bp%film_cons
177 IF (
rank==0)
WRITE(*,*)
'ROCBURN: film_cons= ',bp%film_cons
180 IF (
rank==0)
WRITE(*,*)
'ROCBURN: ixsymm = ',bp%ixsymm
182 read(ir,*) bp%x_surf_burn
183 IF (
rank==0)
WRITE(*,*)
'ROCBURN: x_surf_burn = ',bp%x_surf_burn
185 read(ir,*, err = 101,
END = 101) bp%P_range(2)
186 IF (
rank==0)
WRITE(*,*)
'ROCBURN: press_max = ',bp%P_range(2)
187 read(ir,*, err = 101,
END = 101) bp%P_range(1)
188 IF (
rank==0)
WRITE(*,*)
'ROCBURN: press_min = ',bp%P_range(1)
189 if(bp%P_range(2) + bp%P_range(1) < 100.0) goto 101
191 read(ir,*, err = 101,
END = 101) bp%rb_range(2)
192 IF (
rank==0)
WRITE(*,*)
'ROCBURN: rb_max = ',bp%rb_range(2)
193 read(ir,*, err = 101,
END = 101) bp%rb_range(1)
194 IF (
rank==0)
WRITE(*,*)
'ROCBURN: rb_min = ',bp%rb_range(1)
196 read(ir,*, err = 101,
END = 101) bp%Tf_range(2)
197 IF (
rank==0)
WRITE(*,*)
'ROCBURN: Tf_max = ',bp%Tf_range(2)
198 read(ir,*, err = 101,
END = 101) bp%Tf_range(1)
199 IF (
rank==0)
WRITE(*,*)
'ROCBURN: Tf_min = ',bp%Tf_range(1)
201 READ(ir,*, err = 102,
END = 102) bp%TABUSE
202 IF (
rank==0)
WRITE(*,*)
'ROCBURN: TABUSE =', bp%TABUSE
204 READ(ir,*, err = 102,
END = 102) bp%TABNAM
205 IF (
rank==0)
WRITE(*,*)
'ROCBURN: TABNAM =', bp%TABNAM
214 IF (
rank==0)
WRITE(*,*)
'MISSING variable RANGES, ...&
215 & probably you are using an OLD input deck'
216 IF (
rank==0)
WRITE(*,*)
'Hardwiring limits'
217 bp%P_range = (/1.d3,1.d8/)
218 bp%rb_range = (/-1.
d-9,1.d2/)
219 bp%Tf_range = (/290.0d0,10000.0d0/)
225 IF (
rank==0)
WRITE(*,*)
'MISSING TABNAM TABUSE'
263 INTEGER :: gridtype, numx
264 REAL(DBL) :: bpm,bp1,bm1,czx
265 REAL(DBL) :: czxx,
term,term2
266 REAL(DBL) :: beta,
xmax
267 REAL(DBL),
POINTER ::
x(:),
z(:), zx(:), zxx(:)
268 INTEGER ::
i,
rank,ierror
271 CALL mpi_comm_rank(bp%comm,
rank, ierror)
277 bp%delz = one/dble(numx-1)
282 ALLOCATE(bp%zx(numx))
283 ALLOCATE(bp%zxx(numx))
295 print *,
' ROCBURN: delz=',bp%delz
296 print *,
' ROCBURN: nxmax=',numx
299 IF (gridtype.eq.1)
THEN
304 z(
i) = dble(
i-1)*bp%delz
305 x(
i) = log(one-
z(
i))/beta
309 zx(
i) = -beta*exp(beta*
x(
i))
310 zxx(
i) = -beta**two*exp(beta*
x(
i))
321 czx=2.0*beta/log(bpm)/
xmax
324 z(
i)=dble(
i-1)*bp%delz
327 term2=beta**2-(one-
x(
i)/
xmax)**2
329 zxx(
i)= czxx*(one-
x(
i)/
xmax)/term2**2
336 bp%delt_max = half*bp%delz*bp%delz/maxval(abs(zx))**2/bp%alfac
337 bp%delz2inv = half/bp%delz
338 bp%delzsqinv = one / (bp%delz*bp%delz)
339 bp%dx1 = bp%delz/zx(1)
343 WRITE (*,*)
' ROCBURN: Smallest delta x = ',
x(1)-
x(2)
344 WRITE (*,*)
' ROCBURN: Largest delta x = ',
x(numx-1)-
x(numx)
345 WRITE (*,*)
' ROCBURN: MAXIMUM DELTA t = ',bp%delt_max
363 REAL(DBL) :: ts,pread,
g,rb,fx2,alfaeff
364 REAL(DBL) :: tss,rss,alptab
365 REAL(DBL) :: out0,out1,out_1,err
366 REAL(DBL),
POINTER :: vtmp(:)
367 INTEGER ::
i,
j,l,inttmp,n1,n2,n3,n4,count, ierror,
rank,ioerr
368 CHARACTER*(*),
INTENT(IN) :: in_dir
369 CHARACTER(LEN=90) :: filnam
372 CALL mpi_comm_rank(bp%comm,
rank, ierror)
376 filnam = trim(bp%TABNAM)
377 IF (in_dir(len_trim(in_dir):len_trim(in_dir)) ==
'/')
THEN
378 filnam = trim(in_dir) // trim(filnam)
380 filnam = trim(in_dir) //
'/' // trim(filnam)
384 open(32,file=filnam,
status=
'old',iostat=ioerr)
386 write(*,*)
'LOOKING FOR file ',filnam
387 write(*,*)
'FILE NOT FOUND'
388 write(*,*)
'Use table flag:: ',bp%TABUSE
389 CALL mpi_abort(bp%comm, 1, ierror)
393 read(32,*)bp%TABLE%nx_table,bp%TABLE%ny_table,bp%TABLE%nfield,inttmp
394 n1 = bp%TABLE%nx_table; n2 = bp%TABLE%ny_table;
395 n3 =
max(n1,n2); n4 = bp%TABLE%nfield
398 allocate(bp%TABLE%tsurf00 (n1))
399 allocate(bp%TABLE%press00 (n2))
400 allocate(bp%TABLE%heatflux00 (n1,n2))
401 allocate(bp%TABLE%rb00 (n1,n2))
402 allocate(bp%TABLE%fxsq00 (n1,n2))
403 allocate(bp%TABLE%Tgas00 (n1,n2))
404 allocate(bp%TABLE%Tstd00 (n2))
405 allocate(bp%TABLE%rstd00 (n2))
406 allocate(bp%TABLE%alph00 (n1,n2))
408 allocate(bp%TABLE%wrk1 (n3))
409 allocate(bp%TABLE%wrk2 (n3))
410 allocate(bp%TABLE%wrk3 (n3))
411 allocate(bp%TABLE%wrk4 (n3))
412 allocate(bp%TABLE%wrk5 (n3))
413 allocate(bp%TABLE%wrk6 (n3))
414 allocate(bp%TABLE%wrk7 (n3))
415 allocate(bp%TABLE%wrk8 (n3))
416 allocate(bp%TABLE%wrk9 (n3))
417 allocate(bp%TABLE%wrk10 (n3))
423 read(32,*)alptab,bp%TABLE%chi
425 if(
rank == 0 .and. abs(alptab-bp%alfac) > 1
d-10 ) &
426 write(*,*)
'WARNING changing ALPHA',bp%alfac,alptab
430 do j=1,bp%TABLE%ny_table
431 do i=1,bp%TABLE%nx_table
432 read(32,*) (vtmp(l),l=1,n4)
434 bp%TABLE%tsurf00(
i) = vtmp(1)
435 bp%TABLE%press00(
j) = vtmp(2)
436 bp%TABLE%heatflux00(
i,
j) = vtmp(3)
437 bp%TABLE%rb00(
i,
j) = vtmp(4)
438 bp%TABLE%fxsq00(
i,
j) = vtmp(5)
439 alfaeff = bp%alfac*( one + bp%TABLE%chi + bp%TABLE%fxsq00(
i,
j) )
440 bp%TABLE%alph00(
i,
j) = alfaeff
442 bp%TABLE%Tgas00(
i,
j) = vtmp(6)
444 bp%TABLE%Tgas00(
i,
j) = bp%Tstar0 - bp%To + bp%TABLE&
445 %tsurf00(
i) - alfaeff/bp%TABLE%rb00(
i,
j)*bp%TABLE%heatflux00(
i,
j)
448 bp%TABLE%Tstd00(
j) = vtmp(7)
449 bp%TABLE%rstd00(
j) = vtmp(8)
454 bp%TABLE%spline = inttmp == 1
455 bp%TABLE%small_1 = (bp%TABLE%tsurf00(2)-bp%TABLE%tsurf00(1))/100.d0
456 bp%TABLE%small_2 = (bp%TABLE%press00(2)-bp%TABLE%press00(1))&
461 do j = 1,bp%TABLE%ny_table
466 tss = (bp%TABLE%tsurf00(1) + bp%TABLE%tsurf00(bp%TABLE&
469 tss = bp%TABLE%Tstd00(
j-1) + &
470 (bp%TABLE%Tstd00(
j-1) - bp%TABLE%Tstd00(
j-2))/&
471 (bp%TABLE%press00(
j-1) - bp%TABLE%press00(
j-2))*&
472 (bp%TABLE%press00(
j) - bp%TABLE%press00(
j-1))
475 do while (count < 20 .and. err > bp%TABLE%small_1)
478 call
steadytemp(bp,tss-bp%TABLE%small_1/2d0,bp%TABLE&
479 %press00(
j),out_1,rss,
g)
480 call
steadytemp(bp,tss+bp%TABLE%small_1/2d0,bp%TABLE&
481 %press00(
j),out1,rss,
g)
482 tss = tss - out0/(out1-out_1)*bp%TABLE%small_1
485 bp%TABLE%Tstd00(
j) = tss
487 bp%TABLE%rstd00(
j) = rss
488 if(
rank == 0)
write(*,
'(i3,1p3e12.3,0p,A11,1p5e12.3)')count,bp%TABLE%press00(
j),tss,rss, &
511 REAL(DBL) ::
g,rb,to,
dy,alfa,fx2
518 call
polin2(bp,bp%TABLE%tsurf00,bp%TABLE%press00,bp%TABLE%heatflux00,&
519 bp%TABLE%nx_table,bp%TABLE%ny_table,tin,
pin,
g,jj,kk)
520 call
polin2(bp,bp%TABLE%tsurf00,bp%TABLE%press00,bp%TABLE%rb00, &
521 bp%TABLE%nx_TABLE,bp%TABLE%ny_table,tin,
pin,rb,jj,kk)
522 call
polin2(bp,bp%TABLE%tsurf00,bp%TABLE%press00,bp%TABLE%fxsq00, &
523 bp%TABLE%nx_TABLE,bp%TABLE%ny_table,tin,
pin,fx2,jj,kk)
524 alfa = bp%alfac*( one + bp%TABLE%chi + fx2)
526 out =
g - (tin - to)*rb/alfa
542 check(1) = bp%a_p >
zero
543 check(2) = bp%n_p >
zero .AND. bp%n_p < 10.0
544 check(3) = bp%Pref >
zero .AND. bp%Pref < 200.0
545 check(4) = bp%Ac > 100.0
546 check(5) = bp%eg_ru > 100.0
547 check(6) = bp%ec_ru >100.0
548 check(7) = bp%alfac >
zero .AND. bp%alfac < 1.0
549 check(8) = bp%C >
zero .AND. bp%C < 1.0
550 check(9) = bp%lamg >
zero .AND. bp%lamg < 1.0
551 check(10) = bp%To > 100.0 .AND. bp%To < 1000.0
552 check(11) = bp%Tignition > bp%To
553 check(12) = bp%Tstar0 > bp%Tignition .AND. bp%Tstar0 < 1.d4
554 check(13) = bp%ixsymm >= 0 .AND. bp%ixsymm < 3
555 check(14) = bp%Tsurf > 100.0 .AND. bp%Tsurf < bp%Tstar0
557 IF(.NOT. all(check) )
THEN
558 write(*,*)
'ROCBURN CHECK_INPUT_RANGE'
559 write(*,*)
'INPUTS OUT OF RANGE'
560 write(*,*)
'CHECK', check
561 CALL mpi_abort(bp%comm, 1, ierror)
564 write(*,*)
'ALL VARIABLES IN SPECIFIED range'
void zero()
Sets all entries to zero (more efficient than assignement).
subroutine check_input_range(bp)
subroutine burn_init_0d(bp, comm, IN_DIR, nx_read, To_read)
subroutine get_time_step_1d(bp, rb, Toa, dt_max)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
int status() const
Obtain the status of the attribute.
subroutine read_properties(bp, IN_DIR)
const std::string & unit() const
Obtain the unit of the attribute.
subroutine steadytemp(bp, TIN, pIN, out, rb, g)
void int int int REAL REAL REAL * z
subroutine polin2(bp, x1a, x2a, y12a, m, n, x1, x2, y, j, k)
blockLoc pin(const blockLoc &l) const
subroutine burn_finalize_0d(bp)
subroutine readtable(bp, IN_DIR)