89 INTEGER I1, I2, J1, J2, K1, K2
92 DOUBLE PRECISION Accumulation_old, Accumulation_delta, flux, flux_in_tot
93 DOUBLE PRECISION fin, fout
119 flux_in_x_s(l, m, nn) =
zero 256 IF(
dmp_log)
WRITE(
unit_log,
'(/A,G12.5,A,G12.5)')
'Mass balance for interval '' to ' 262 IF(
dmp_log)
WRITE(
unit_log,
'(4(A,G12.5))')
' Old = ', accumulation_old
', New = ' 263 ', Production = ',
integral_sum_r_g,
', net accu(New - Old - Production) = ' 266 IF(
dmp_log)
WRITE(
unit_log,
'(A, T8, A, T21, A, T34, A)')
' BC#',
'in''out''(in - out)' 278 if((flux - accumulation_delta) /=
zero)
then 280 if(flux_in_tot /=
zero) error_percent = (flux - accumulation_delta
284 IF(
dmp_log)
WRITE(
unit_log,
'(2X, A, 1X, 3(G12.5, 1x))')
'Total', flux_in_tot
285 IF(
dmp_log)
WRITE(
unit_log,
'(A, G12.5, A, G12.5)')
'Error (net influx - net accu) = ' 286 ' %Error_g = ', error_percent
292 IF(
dmp_log)
WRITE(
unit_log,
'(/A, I1, A)')
'Total Solids-', m,
' Accumulation (g)' 293 IF(
dmp_log)
WRITE(
unit_log,
'(4(A,G12.5))')
' Old = ', accumulation_old
', New = ' 294 ', Production = ',
integral_sum_r_s(m),
', net accu(New - Old - Production) = ' 297 IF(
dmp_log)
WRITE(
unit_log,
'(A, T8, A, T21, A, T34, A)')
' BC#''in''out''(in - out)' 304 WRITE(
unit_log,
'(2X, I5, 1X, 3(G12.5, 1x))')l, &
309 flux_in_tot = flux_in_tot +
flux_in_s(l,m)
312 if((flux - accumulation_delta) /=
zero)
then 313 if(flux_in_tot /=
zero)
then 314 error_percent = (flux - accumulation_delta)*100./flux_in_tot
316 error_percent = (flux - accumulation_delta)*100./accumulation_old
322 IF(
dmp_log)
WRITE(
unit_log,
'(A, G12.5, A, I1, A, G12.5)')
'Error (net influx - net accu) = ' 323 ' %Error_',m,
' = ', error_percent
336 IF(
dmp_log)
WRITE(
unit_log,
'(4(A,G12.5))')
' Old = ', accumulation_old
', New = ' 337 ', Production = ',
integral_r_g(nn),
', net accu(New - Old - Production) = ' 340 IF(
dmp_log)
WRITE(
unit_log,
'(A, T8, A, T21, A, T34, A)')
' BC#''in''out''(in - out)' 353 if((flux - accumulation_delta) /=
zero)
then 355 if(flux_in_tot /=
zero)
then 356 error_percent = (flux - accumulation_delta)*100./flux_in_tot
358 error_percent = (flux - accumulation_delta)*100./
integral_r_g 364 IF(
dmp_log)
WRITE(
unit_log,
'(A, G12.5, A, I2, A, G12.5)')
'Error (net influx - net accu) = ' 365 ' %Error_g(',nn,
') = ', error_percent
374 IF(
dmp_log)
WRITE(
unit_log,
'(/A,I1, A, I2)')
'Solids-', m,
' species - ' 380 IF(
dmp_log)
WRITE(
unit_log,
'(4(A,G12.5))')
' Old = ', accumulation_old
', New = ' 382 ', net accu(New - Old - Production) = ', accumulation_delta
385 IF(
dmp_log)
WRITE(
unit_log,
'(A, T8, A, T21, A, T34, A)')
' BC#''in''out''(in - out)' 394 flux = flux + flux_in_x_s(l, m, nn) -
flux_out_x_s(l, m,
398 if((flux - accumulation_delta) /=
zero)
then 400 if(flux_in_tot /=
zero)
then 401 error_percent = (flux - accumulation_delta)*100./flux_in_tot
403 error_percent = (flux - accumulation_delta)*100./
integral_r_s 409 IF(
dmp_log)
WRITE(
unit_log,
'(A, G12.5, A, I1, A, I2, A, G12.5)''Error (net influx - net accu) = ' 410 ' %Error_',m,
'(',nn,
') = ',
435 flux_in_x_s(l, m, nn) =
zero 479 SUBROUTINE calc_mass_flux(I1, I2, J1, J2, K1, K2, Plane, U, V, W, ROP, flux_in, flux_out, IER)
486 INTEGER :: I1, I2, J1, J2, K1, K2
503 DOUBLE PRECISION :: flux_in, flux_out
508 call calc_mass_flux_sp(i1, i2, j1, j2, k1, k2, plane, u, v, w, rop
529 SUBROUTINE calc_mass_flux_sp(I1, I2, J1, J2, K1, K2, Plane, U, V, W, ROP, Xn, flux_in, flux_out, IER)
542 INTEGER :: I1, I2, J1, J2, K1, K2
559 DOUBLE PRECISION :: flux_in, flux_out
574 IF(.NOT.is_on_mype_owns(i, j, k)) cycle
577 SELECT CASE (trim(plane))
579 ijk = im_of(funijk(i,j,k))
580 IF(u(ijk) >
zero)
THEN 581 flux_out = flux_out +
ayz(ijk) * u(ijk) * rop(ijk) * xn
583 flux_in = flux_in -
ayz(ijk) * u(ijk) * rop(ip_of(ijk)
588 IF(u(ijk) >
zero)
THEN 589 flux_in = flux_in +
ayz(ijk) * u(ijk) * rop(ijk) * xn
591 flux_out = flux_out -
ayz(ijk) * u(ijk) * rop(ip_of(ijk
595 ijk = jm_of(funijk(i,j,k))
596 IF(v(ijk) >
zero)
THEN 597 flux_out = flux_out +
axz(ijk) * v(ijk) * rop(ijk) * xn
599 flux_in = flux_in -
axz(ijk) * v(ijk) * rop(jp_of(ijk)
604 IF(v(ijk) >
zero)
THEN 605 flux_in = flux_in +
axz(ijk) * v(ijk) * rop(ijk) * xn
607 flux_out = flux_out -
axz(ijk) * v(ijk) * rop(jp_of(ijk
611 ijk = km_of(funijk(i,j,k))
612 IF(w(ijk) >
zero)
THEN 613 flux_out = flux_out +
axy(ijk) * w(ijk) * rop(ijk) * xn
615 flux_in = flux_in -
axy(ijk) * w(ijk) * rop(kp_of(ijk)
620 IF(w(ijk) >
zero)
THEN 621 flux_in = flux_in +
axy(ijk) * w(ijk) * rop(ijk) * xn
623 flux_out = flux_out -
axy(ijk) * w(ijk) * rop(kp_of(ijk
659 SUBROUTINE calc_mass_fluxhr(I1, I2, J1, J2, K1, K2, Plane, Flux_E, Flux_N, Flux_T, flux_in, flux_out, IER)
666 INTEGER :: I1, I2, J1, J2, K1, K2
680 DOUBLE PRECISION :: flux_in, flux_out
706 SUBROUTINE calc_mass_flux_sphr(I1, I2, J1, J2, K1, K2, Plane, Flux_E, Flux_N, Flux_T, Xn, disc, flux_in, flux_out, IER)
720 INTEGER :: I1, I2, J1, J2, K1, K2
738 DOUBLE PRECISION :: flux_in, flux_out
741 DOUBLE PRECISION :: Flux, PHI_HO
748 DOUBLE PRECISION,
DIMENSION(DIMENSION_3) :: XSI_e, XSI_n, XSI_t
753 CALL calc_xsi (disc, xn, flux_e, flux_n, flux_t, xsi_e, xsi_n, xsi_t
762 IF(.NOT.is_on_mype_owns(i, j, k)) cycle
765 SELECT CASE (trim(plane))
767 ijk = im_of(funijk(i,j,k))
768 phi_ho = xsi_e(ijk)*xn(ip_of(ijk))+(1.0-xsi_e(ijk))*xn(ijk
773 phi_ho = xsi_e(ijk)*xn(ip_of(ijk))+(1.0-xsi_e(ijk))*xn(ijk
777 ijk = jm_of(funijk(i,j,k))
778 phi_ho = xsi_n(ijk)*xn(jp_of(ijk))+(1.0-xsi_n(ijk))*xn(ijk
783 phi_ho = xsi_n(ijk)*xn(jp_of(ijk))+(1.0-xsi_n(ijk))*xn(ijk
787 ijk = km_of(funijk(i,j,k))
788 phi_ho = xsi_t(ijk)*xn(kp_of(ijk))+(1.0-xsi_t(ijk))*xn(ijk
793 phi_ho = xsi_t(ijk)*xn(kp_of(ijk))+(1.0-xsi_t(ijk))*xn(ijk
803 flux_out = flux_out + flux * phi_ho
805 flux_in = flux_in - flux * phi_ho
911 IF(.NOT.is_on_mype_wobnd(
i_of(ijk),
j_of(ijk),
k_of(ijk))) cycle
912 IF (fluid_at(ijk)) sum = sum + ro(ijk) * xn(ijk) *
vol(ijk)
941 INTEGER IJK, IMJK, IJMK, IJKM, IPJK, IJPK, IJKP
951 + phi(ipjk) * a_m(ijk,
east, 0) &
952 + phi(imjk) * a_m(ijk,
west, 0) &
953 + phi(ijpk) * a_m(ijk,
north, 0) &
954 + phi(ijmk) * a_m(ijk,
south, 0) &
955 + phi(ijkp) * a_m(ijk,
top, 0) &
956 + phi(ijkm) * a_m(ijk,
bottom, 0) &
integer, dimension(dimension_bc) bc_k_b
double precision accumulation_g
double precision, dimension(:), allocatable flux_ge
integer, parameter dim_n_g
double precision, dimension(dimension_b!c) flux_in_g
double precision function check_conservation(Phi, A_m, B_m, IJK)
integer, dimension(:), allocatable i_of
double precision report_time
double precision, dimension(:), allocatable flux_gst
double precision, dimension(:,:), allocatable flux_st
double precision, parameter one
subroutine check_mass_balance(init)
double precision, dimension(:), allocatable axy
double precision, dimension(dime!nsion_bc, dim_m) flux_in_s
integer, dimension(dimension_bc) bc_i_w
integer, dimension(dimension_bc) bc_j_n
logical, dimension(0:dim_m) species_eq
double precision, dimension(:), allocatable flux_ssn
subroutine calc_mass_fluxhr(I1, I2, J1, J2, K1, K2, Plane, Flux_E
double precision start_time
double precision integral_sum_r_g
double precision flux_in_x_g
double precision, dimension(:), allocatable sum_r_g
double precision, dimension(:,:), allocatable sum_r_s
double precision, dimension(dim_m) accumulation_s
integer, parameter dimension_bc
subroutine calc_xsi(DISCR, PHI, U, V, W, XSI_E, XSI_N, XSI_T, incr)
double precision, dimension(:,:,:), allocatable rox_sc
double precision, parameter undefined
double precision, dimension(:), allocatable ayz
subroutine calc_mass_flux_sphr(I1, I2, J1, J2, K1, K2, Plane, Flu
double precision report_mass_balance_dt
character, dimension(dimension_bc) bc_plane
integer, dimension(:), allocatable k_of
double precision, dimension(dim_m) integral_sum_r_s
double precision, dimension(:), allocatable flux_gse
integer, dimension(dimension_bc) bc_k_t
double precision function accumulation_sp(ro, Xn)
double precision function accumulation(ro)
logical, dimension(:,:,:), allocatable dead_cell_at
double precision, dimension(:,:,:), allocatable x_s
integer, dimension(:), allocatable j_of
double precision, dimension(:), allocatable flux_gn
double precision, dimension(:,:), allocatable x_g
integer, dimension(dimension_bc) bc_j_s
double precision, dimension(:,:,:), allocatable r_sp
logical, dimension(dimension_bc) bc_defined
integer, parameter unit_log
double precision, dimension(:), allocatable axz
double precision, dimension(dim_n_g) integral_r_g
double precision, dimension(dim_m, di!m_n_s) integral_r_s
double precision, dimension(:), allocatable flux_gt
double precision, dimension(:,:), allocatable rox_gc
integer, dimension(0:dim_m) nmax
double precision, dimension(dim_n_g) accumulation_x_g
integer, parameter dim_n_s
integer, dimension(dim_eqs) discretize
double precision, dimension(:,:), allocatable rop_s
subroutine calc_mass_flux(I1, I2, J1, J2, K1, K2, Plane, U, V, W,
double precision, dimension(:,:), allocatable flux_se
double precision, dimension(:), allocatable flux_gsn
double precision, dimension(dimension_bc, dim_n_g) flux_out_x_g
double precision, dimension(dim_m,!dim_n_s) accumulation_x_s
double precision, dimension(:), allocatable vol
subroutine calc_mass_flux_sp(I1, I2, J1, J2, K1, K2, Plane, U, V,
double precision, dimension(:), allocatable rop_g
double precision, dimension(:,:), allocatable flux_sn
double precision, dimension(dimension_bc, dim_m, dim_n_s) flux_out_x_s
integer, dimension(dimension_bc) bc_i_e
double precision, dimension(dimension_bc) flux_out_g
double precision, parameter zero
double precision, dimension(:), allocatable flux_sst
double precision, dimension(:,:), allocatable r_gp
double precision, dimension(dimension_bc, dim_m) flux_out_s
double precision, dimension(:), allocatable flux_sse