Skip to content

Commit 45b3135

Browse files
committed
changes to several fils
so they can become more readable
1 parent efbdf6f commit 45b3135

File tree

4 files changed

+29
-40
lines changed

4 files changed

+29
-40
lines changed

src/common/m_checker_common.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ contains
253253
@: PROHIBIT(cyl_coord .and. n == 0, "n must be positive (2D or 3D) for cylindrical coordinates")
254254
@: PROHIBIT(sph_coord .and. n == 0, "n must be positive (1D) for axysimmetric spherical coordinates")
255255
@: PROHIBIT(cyl_coord .and. p == 0 .and. bc_y%beg /= -2, "bc_y%beg must be -2 for 2D cylindrical coordinates (p = 0)")
256-
! @: PROHIBIT(sph_coord .and. p == 0 .and. bc_y%beg /= -2, "bc_y%beg must be -2 axysimmetric spherical coordinates (p = 0)")
256+
@: PROHIBIT(sph_coord .and. p == 0 .and. bc_y%beg /= -2, "bc_y%beg must be -2 axysimmetric spherical coordinates (p = 0)")
257257
@: PROHIBIT(cyl_coord .and. p > 0 .and. bc_y%beg /= -14, "bc_y%beg must be -14 for 3D cylindrical coordinates (p > 0)")
258258
@: PROHIBIT(cyl_coord .and. (bc_y%end > -1 .or. bc_y%end < -16), "bc_y%end must be between -1 and -16")
259259
@: PROHIBIT(sph_coord .and. (bc_y%end > -1 .or. bc_y%end < -16), "bc_y%end must be between -1 and -16")

src/common/m_phase_change.fpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,16 @@ contains
110110
! original volume fractions, before any relaxation
111111
alpha0k(i) = q_cons_vf(i + advxb - 1)%sf(j, k, l)
112112

113-
! original mass fractions, before any relaxation
113+
! original partial density, before any relaxation
114114
m0k(i) = q_cons_vf(i + contxb - 1)%sf(j, k, l)
115115

116116
! Mixture density
117-
rho = rho + q_cons_vf(i + contxb - 1)%sf(j, k, l)
117+
rho = rho + m0k(i)
118118

119119
! calculating the total internal energy such that the energy-fraction for each of the
120120
! fluids can be proportionally distributed when the sum of the internal energies differs from the
121-
122-
if ( ieee_is_nan( q_cons_vf(i + contxb - 1)%sf(j, k, l) ) ) then
123-
print *, 'partial densities', q_cons_vf(i + contxb - 1)%sf(j, k, l)
121+
if ( ieee_is_nan( m0k(i) ) ) then
122+
print *, 'partial densities', m0k(i)
124123
end if
125124

126125
if (model_eqns == 3) then
@@ -177,7 +176,7 @@ contains
177176
! if ( ( pS < pCr ) .and. ( pS > 0 ) .and. &
178177
if ( ( pS < pCr ) .and. &
179178
! 2.1 Homogeneous pTg-equilibrium criterium
180-
( ( ( pS < 0 ) .and. ( pS + minval(p_infpT) > 0.0 ) ) &
179+
( ( ( pS < 0 ) .and. ( pS + minval(p_infpT) > 0.0_wp ) ) &
181180
.or. &
182181
! 2.2. Heterogeneous pTg-equilibrium.
183182
( (alphak(lp) > palpha_eps) .and. (alphak(vp) > palpha_eps) ) ) &
@@ -278,7 +277,6 @@ contains
278277

279278
! updating conservative variables through either p- or pT-equilibrium
280279
call update_conservative_vars( j, k, l, pS, q_cons_vf, Tk )
281-
282280
else
283281
!$acc loop seq
284282
do i = 1, num_fluids

src/simulation/m_rhs.fpp

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ contains
624624
real(wp), intent(inout) :: time_avg
625625

626626
real(wp), dimension(0:m, 0:n, 0:p) :: nbub
627-
real(wp) :: t_start, t_finish
627+
real(wp) :: t_start, t_finish, multip
628628
integer :: i, j, k, l, id !< Generic loop iterators
629629

630630
call nvtxStartRange("COMPUTE-RHS")
@@ -644,7 +644,14 @@ contains
644644
end do
645645
end do
646646

647-
! Converting Conservative to Primitive Variables
647+
! determining what the multiplying factor will be for the source terms in the cylindrical/spherical coordinates
648+
if (cyl_coord) then
649+
multip = 5e-1_wp
650+
else if (sph_coord) then
651+
multip = 1.0_wp
652+
else
653+
multip = 0.0_wp
654+
end if
648655

649656
if (mpp_lim .and. bubbles_euler) then
650657
!$acc parallel loop collapse(3) gang vector default(present)
@@ -817,7 +824,8 @@ contains
817824
iden_cons_qp, &
818825
iden_prim_qp, &
819826
nill_cons_qp, &
820-
nill_prim_qp)
827+
nill_prim_qp, &
828+
multip)
821829
call nvtxEndRange
822830

823831
! RHS additions for hypoelasticity
@@ -836,7 +844,8 @@ contains
836844
flux_src_n(id)%vf, &
837845
dq_prim_dx_qp(1)%vf, &
838846
dq_prim_dy_qp(1)%vf, &
839-
dq_prim_dz_qp(1)%vf)
847+
dq_prim_dz_qp(1)%vf, &
848+
multip)
840849
call nvtxEndRange
841850
end if
842851

@@ -937,29 +946,20 @@ contains
937946

938947
end subroutine s_compute_rhs
939948

940-
subroutine s_compute_advection_source_term(idir, rhs_vf, q_cons_vf, q_prim_vf, flux_src_n_vf, iden_cons_vf, iden_prim_vf, nill_cons_vf, nill_prim_vf)
949+
subroutine s_compute_advection_source_term(idir, rhs_vf, q_cons_vf, q_prim_vf, flux_src_n_vf, iden_cons_vf, iden_prim_vf, nill_cons_vf, nill_prim_vf, multip)
941950

942951
integer, intent(in) :: idir
943952
type(scalar_field), dimension(sys_size), intent(inout) :: rhs_vf
944953
type(vector_field), intent(inout) :: q_cons_vf
945954
type(vector_field), intent(inout) :: q_prim_vf
946955
type(vector_field), intent(inout) :: flux_src_n_vf
947956
type(vector_field), intent(in) :: iden_cons_vf, iden_prim_vf, nill_cons_vf, nill_prim_vf
948-
real(wp) :: multip
957+
real(wp), intent(in) :: multip
949958

950959
real(wp), dimension(0:m, 0:n, 0:p) :: KNeg, KNill
951960

952961
integer :: i, j, k, l, q
953962

954-
! determining what the multiplying factor will be for the source terms in the cylindrical/spherical coordinates
955-
if (cyl_coord) then
956-
multip = 5e-1_wp
957-
else if (sph_coord) then
958-
multip = 1.0_wp
959-
else
960-
multip = 0.0_wp
961-
end if
962-
963963
if (alt_soundspeed) then
964964
!$acc parallel loop collapse(3) gang vector default(present)
965965
do l = 0, p
@@ -979,15 +979,14 @@ contains
979979

980980
Kterm(j, k, l) = alpha1(j, k, l)*alpha2(j, k, l)*(blkmod2(j, k, l) - blkmod1(j, k, l))/ &
981981
(alpha1(j, k, l)*blkmod2(j, k, l) + alpha2(j, k, l)*blkmod1(j, k, l))
982-
983-
KNill(j, k, l) = 0.0_wp
984-
985-
KNeg(j, k, l) = -1.0_wp * Kterm(j, k, l)
986982
end do
987983
end do
988984
end do
985+
KNeg(0:m, 0:n, 0:p) = -1.0_wp * Kterm(0:m, 0:n, 0:p)
989986
end if
990-
987+
988+
KNill(0:m, 0:n, 0:p) = 0.0_wp
989+
991990
if (idir == 1) then
992991

993992
if (bc_x%beg <= -5 .and. bc_x%beg >= -13) then
@@ -1034,7 +1033,6 @@ contains
10341033
end if
10351034

10361035
elseif (idir == 2) then
1037-
10381036
! RHS Contribution in y-direction
10391037
! Applying the Riemann fluxes
10401038

@@ -1084,7 +1082,6 @@ contains
10841082
end if
10851083

10861084
if (grid_geometry == 3) then ! Cylindrical Coordinates
1087-
10881085
!$acc parallel loop collapse(4) gang vector default(present)
10891086
do j = 1, sys_size
10901087
do k = 0, p
@@ -1150,6 +1147,7 @@ contains
11501147
! call s_calculate_rhs_operator(idir, 1, sys_size, 0, m, 0, n, 0, p, multip, rhs_vf, flux_n, flux_gsrc_n, &
11511148
! KNill, iden_cons_vf, iden_prim_vf, 0, 1, KNill, iden_cons_vf, iden_prim_vf, 0, 1, 'L')
11521149
else
1150+
11531151
if (alt_soundspeed) then
11541152
do j = advxb, advxe
11551153
if ((j == advxe) .and. (bubbles_euler .neqv. .true.)) then
@@ -1244,24 +1242,17 @@ contains
12441242
end subroutine s_compute_advection_source_term
12451243

12461244
subroutine s_compute_additional_physics_rhs(idir, q_prim_vf, rhs_vf, flux_src_n, &
1247-
dq_prim_dx_vf, dq_prim_dy_vf, dq_prim_dz_vf)
1245+
dq_prim_dx_vf, dq_prim_dy_vf, dq_prim_dz_vf, multip)
12481246

12491247
integer, intent(in) :: idir
12501248
type(scalar_field), dimension(sys_size), intent(in) :: q_prim_vf
12511249
type(scalar_field), dimension(sys_size), intent(inout) :: rhs_vf
12521250
type(scalar_field), dimension(sys_size), intent(in) :: flux_src_n
12531251
type(scalar_field), dimension(sys_size), intent(in) :: dq_prim_dx_vf, dq_prim_dy_vf, dq_prim_dz_vf
1254-
real(wp) :: multip
1252+
real(wp), intent(in) :: multip
12551253

12561254
integer :: i, j, k, l
12571255

1258-
! determining what the multiplying factor will be for the source terms in the cylindrical/spherical coordinates
1259-
if (cyl_coord) then
1260-
multip = 5e-1_wp
1261-
else if (sph_coord) then
1262-
multip = 1.0_wp
1263-
end if
1264-
12651256
if (idir == 1) then ! x-direction
12661257

12671258
if (surface_tension) then

src/simulation/m_time_steppers.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ contains
394394
if (grid_geometry == 3) call s_apply_fourier_filter(q_cons_ts(1)%vf)
395395

396396
if (model_eqns == 3 .and. (.not. relax)) then
397-
call s_pressure_relaxation_procedure(q_cons_ts(2)%vf)
397+
call s_pressure_relaxation_procedure(q_cons_ts(1)%vf)
398398
end if
399399

400400
if (adv_n) call s_comp_alpha_from_n(q_cons_ts(1)%vf)

0 commit comments

Comments
 (0)