Skip to content

Commit 4dd7f25

Browse files
authored
Fix pressure in probe output files (#454)
1 parent da71580 commit 4dd7f25

File tree

1 file changed

+33
-16
lines changed

1 file changed

+33
-16
lines changed

src/simulation/m_data_output.fpp

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ contains
10491049
real(kind(0d0)) :: E_e
10501050
real(kind(0d0)), dimension(6) :: tau_e
10511051
real(kind(0d0)) :: G
1052+
real(kind(0d0)) :: dyn_p
10521053

10531054
integer :: i, j, k, l, s, q !< Generic loop iterator
10541055

@@ -1128,22 +1129,20 @@ contains
11281129
vel(s) = q_cons_vf(cont_idx%end + s)%sf(j - 2, k, l)/rho
11291130
end do
11301131

1132+
dyn_p = 0.5d0*rho*dot_product(vel, vel)
1133+
11311134
if (hypoelasticity) then
11321135
call s_compute_pressure( &
11331136
q_cons_vf(1)%sf(j - 2, k, l), &
11341137
q_cons_vf(alf_idx)%sf(j - 2, k, l), &
1135-
0.5d0*(q_cons_vf(2)%sf(j - 2, k, l)**2.d0)/ &
1136-
q_cons_vf(1)%sf(j - 2, k, l), &
1137-
pi_inf, gamma, rho, qv, pres, &
1138+
dyn_p, pi_inf, gamma, rho, qv, pres, &
11381139
q_cons_vf(stress_idx%beg)%sf(j - 2, k, l), &
11391140
q_cons_vf(mom_idx%beg)%sf(j - 2, k, l), G)
11401141
else
11411142
call s_compute_pressure( &
11421143
q_cons_vf(1)%sf(j - 2, k, l), &
11431144
q_cons_vf(alf_idx)%sf(j - 2, k, l), &
1144-
0.5d0*(q_cons_vf(2)%sf(j - 2, k, l)**2.d0)/ &
1145-
q_cons_vf(1)%sf(j - 2, k, l), &
1146-
pi_inf, gamma, rho, qv, pres)
1145+
dyn_p, pi_inf, gamma, rho, qv, pres)
11471146
end if
11481147

11491148
if (model_eqns == 4) then
@@ -1230,14 +1229,20 @@ contains
12301229
vel(s) = q_cons_vf(cont_idx%end + s)%sf(j - 2, k - 2, l)/rho
12311230
end do
12321231

1233-
call s_compute_pressure( &
1234-
q_cons_vf(1)%sf(j - 2, k - 2, l), &
1235-
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
1236-
0.5d0*(q_cons_vf(2)%sf(j - 2, k - 2, l)**2.d0)/ &
1237-
q_cons_vf(1)%sf(j - 2, k - 2, l), &
1238-
pi_inf, gamma, rho, qv, pres, &
1239-
q_cons_vf(stress_idx%beg)%sf(j - 2, k - 2, l), &
1240-
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l), G)
1232+
dyn_p = 0.5d0*rho*dot_product(vel, vel)
1233+
1234+
if (hypoelasticity) then
1235+
call s_compute_pressure( &
1236+
q_cons_vf(1)%sf(j - 2, k - 2, l), &
1237+
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
1238+
dyn_p, pi_inf, gamma, rho, qv, pres, &
1239+
q_cons_vf(stress_idx%beg)%sf(j - 2, k - 2, l), &
1240+
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l), G)
1241+
else
1242+
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l), &
1243+
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
1244+
dyn_p, pi_inf, gamma, rho, qv, pres)
1245+
end if
12411246

12421247
if (model_eqns == 4) then
12431248
lit_gamma = 1d0/fluid_pp(1)%gamma + 1d0
@@ -1307,8 +1312,20 @@ contains
13071312
vel(s) = q_cons_vf(cont_idx%end + s)%sf(j - 2, k - 2, l - 2)/rho
13081313
end do
13091314

1310-
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l - 2), &
1311-
0d0, 0.5d0*rho*dot_product(vel, vel), pi_inf, gamma, rho, qv, pres)
1315+
dyn_p = 0.5d0*rho*dot_product(vel, vel)
1316+
1317+
if (hypoelasticity) then
1318+
call s_compute_pressure( &
1319+
q_cons_vf(1)%sf(j - 2, k - 2, l - 2), &
1320+
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l - 2), &
1321+
dyn_p, pi_inf, gamma, rho, qv, pres, &
1322+
q_cons_vf(stress_idx%beg)%sf(j - 2, k - 2, l - 2), &
1323+
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l - 2), G)
1324+
else
1325+
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l - 2), &
1326+
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l - 2), &
1327+
dyn_p, pi_inf, gamma, rho, qv, pres)
1328+
end if
13121329

13131330
! Compute mixture sound speed
13141331
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, &

0 commit comments

Comments
 (0)