Skip to content

Test with Probe #943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions src/post_process/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,8 @@ contains
if (precision == ${PRECISION}$) then
if (p > 0) then
err = DBMKOPTLIST(2, optlist)
err = DBADDIOPT(optlist, DBOPT_LO_OFFSET, lo_offset)
err = DBADDIOPT(optlist, DBOPT_HI_OFFSET, hi_offset)
err = DBADDIAOPT(optlist, DBOPT_LO_OFFSET, lo_offset)
err = DBADDIAOPT(optlist, DBOPT_HI_OFFSET, hi_offset)
if (grid_geometry == 3) then
err = DBPUTQM(dbfile, 'rectilinear_grid', 16, &
'x', 1, 'y', 1, 'z', 1, &
Expand All @@ -738,8 +738,8 @@ contains
err = DBFREEOPTLIST(optlist)
else
err = DBMKOPTLIST(2, optlist)
err = DBADDIOPT(optlist, DBOPT_LO_OFFSET, lo_offset)
err = DBADDIOPT(optlist, DBOPT_HI_OFFSET, hi_offset)
err = DBADDIAOPT(optlist, DBOPT_LO_OFFSET, lo_offset)
err = DBADDIAOPT(optlist, DBOPT_HI_OFFSET, hi_offset)
err = DBPUTQM(dbfile, 'rectilinear_grid', 16, &
'x', 1, 'y', 1, 'z', 1, &
x_cb${SFX}$, y_cb${SFX}$, DB_F77NULL, dims, 2, &
Expand Down
125 changes: 92 additions & 33 deletions src/simulation/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,8 @@ contains
real(wp) :: G
real(wp) :: dyn_p, T
real(wp) :: damage_state
character(LEN=15) :: FMT_glb
character(len=50) :: FMT

integer :: i, j, k, l, s, d !< Generic loop iterator

Expand All @@ -1087,7 +1089,7 @@ contains
logical :: trigger !< For integral quantities

real(wp) :: rhoYks(1:num_species)

real(wp) :: pres_mag !< Magnetic pressure for MHD
T = dflt_T_guess

! Non-dimensional time calculation
Expand Down Expand Up @@ -1155,7 +1157,8 @@ contains
Re, G, fluid_pp(:)%G)
else
call s_convert_to_mixture_variables(q_cons_vf, j - 2, k, l, &
rho, gamma, pi_inf, qv)
rho, gamma, pi_inf, qv, &
Re)
end if
do s = 1, num_vels
vel(s) = q_cons_vf(cont_idx%end + s)%sf(j - 2, k, l)/rho
Expand All @@ -1175,6 +1178,14 @@ contains
dyn_p, pi_inf, gamma, rho, qv, rhoYks(:), pres, T, &
q_cons_vf(stress_idx%beg)%sf(j - 2, k, l), &
q_cons_vf(mom_idx%beg)%sf(j - 2, k, l), G)
else if (mhd) then
pres_mag = 0.5_wp*(Bx0**2 + q_cons_vf(B_idx%beg)%sf(j - 2, k, l)**2 + q_cons_vf(B_idx%beg + 1)%sf(j - 2, k, l)**2)

call s_compute_pressure( &
q_cons_vf(1)%sf(j - 2, k, l), &
q_cons_vf(alf_idx)%sf(j - 2, k, l), &
dyn_p, pi_inf, gamma, rho, qv, rhoYks(:), pres, T, &
pres_mag=pres_mag)
else
call s_compute_pressure( &
q_cons_vf(1)%sf(j - 2, k, l), &
Expand Down Expand Up @@ -1242,11 +1253,6 @@ contains
accel = accel_mag(j - 2, k, l)
end if
elseif (p == 0) then ! 2D simulation
if (chemistry) then
do d = 1, num_species
rhoYks(d) = q_cons_vf(chemxb + d - 1)%sf(j - 2, k - 2, l)
end do
end if

if ((probe(i)%x >= x_cb(-1)) .and. (probe(i)%x <= x_cb(m))) then
if ((probe(i)%y >= y_cb(-1)) .and. (probe(i)%y <= y_cb(n))) then
Expand All @@ -1263,7 +1269,11 @@ contains
if (j == 1) j = 2 ! Pick first point if probe is at edge
if (k == 1) k = 2 ! Pick first point if probe is at edge
l = 0

if (chemistry) then
do d = 1, num_species
rhoYks(d) = q_cons_vf(chemxb + d - 1)%sf(j - 2, k - 2, l)
end do
end if
! Computing/Sharing necessary state variables
call s_convert_to_mixture_variables(q_cons_vf, j - 2, k - 2, l, &
rho, gamma, pi_inf, qv, &
Expand All @@ -1289,6 +1299,13 @@ contains
T, &
q_cons_vf(stress_idx%beg)%sf(j - 2, k - 2, l), &
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l), G)
else if (mhd) then
pres_mag = 0.5_wp*(q_cons_vf(B_idx%beg)%sf(j - 2, k - 2, l)**2 + q_cons_vf(B_idx%beg + 1)%sf(j - 2, k - 2, l)**2 + q_cons_vf(B_idx%beg + 2)%sf(j - 2, k - 2, l)**2)
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l), &
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
dyn_p, pi_inf, gamma, rho, qv, &
rhoYks, pres, T, pres_mag=pres_mag)

else
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l), &
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
Expand Down Expand Up @@ -1328,6 +1345,7 @@ contains
! Compute mixture sound speed
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, &
((gamma + 1._wp)*pres + pi_inf)/rho, alpha, 0._wp, 0._wp, c)
accel = accel_mag(j - 2, k - 2, l)

end if
end if
Expand Down Expand Up @@ -1383,6 +1401,12 @@ contains
rhoYks, pres, T, &
q_cons_vf(stress_idx%beg)%sf(j - 2, k - 2, l - 2), &
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l - 2), G)
else if (mhd) then
pres_mag = 0.5_wp*(q_cons_vf(B_idx%beg)%sf(j - 2, k - 2, l - 2)**2 + q_cons_vf(B_idx%beg + 1)%sf(j - 2, k - 2, l - 2)**2 + q_cons_vf(B_idx%beg + 2)%sf(j - 2, k - 2, l - 2)**2)
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l), &
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
dyn_p, pi_inf, gamma, rho, qv, &
rhoYks, pres, T, pres_mag=pres_mag)
else
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l - 2), &
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l - 2), &
Expand Down Expand Up @@ -1436,11 +1460,17 @@ contains
call s_mpi_allreduce_sum(tmp, damage_state)
end if
end if
if (precision == 1) then
FMT_glb = "F30.7"
else
FMT_glb = "F40.14"
end if
if (proc_rank == 0) then
if (n == 0) then
if (bubbles_euler .and. (num_fluids <= 2)) then
if (qbmm) then
write (i + 30, '(6x,f12.6,14f28.16)') &
FMT = '(6X,f12.6,14'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
Expand All @@ -1457,7 +1487,8 @@ contains
M20, &
M02
else
write (i + 30, '(6x,f12.6,8f24.8)') &
FMT = '(6X,f12.6,8'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
Expand All @@ -1471,8 +1502,8 @@ contains
! ptot
end if
else if (bubbles_euler .and. (num_fluids == 3)) then
write (i + 30, '(6x,f12.6,f24.8,f24.8,f24.8,f24.8,f24.8,'// &
'f24.8,f24.8,f24.8,f24.8,f24.8, f24.8)') &
FMT = '(6X,f12.6,11'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
Expand All @@ -1486,8 +1517,8 @@ contains
ptilde, &
ptot
else if (bubbles_euler .and. num_fluids == 4) then
write (i + 30, '(6x,f12.6,f24.8,f24.8,f24.8,f24.8,'// &
'f24.8,f24.8,f24.8,f24.8,f24.8,f24.8,f24.8,f24.8,f24.8)') &
FMT = '(6X,f12.6,13'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
q_cons_vf(1)%sf(j - 2, 0, 0), &
q_cons_vf(2)%sf(j - 2, 0, 0), &
Expand All @@ -1503,15 +1534,17 @@ contains
R(1), &
Rdot(1)
else
write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8)') &
FMT = '(6X,f12.6,3'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
pres
end if
elseif (p == 0) then
if (bubbles_euler) then
write (i + 30, '(6X,10F24.8)') &
FMT = '(6X,f12.6,9'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
Expand All @@ -1523,8 +1556,8 @@ contains
R(1), &
Rdot(1)
else if (elasticity) then
write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8,F24.8,'// &
'F24.8,F24.8,F24.8)') &
FMT = '(6X,F12.6,7'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
Expand All @@ -1534,28 +1567,54 @@ contains
tau_e(2), &
tau_e(3)
else
write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8)') &
FMT = '(6X,F12.6,3'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
pres
print *, 'time =', nondim_time, 'rho =', rho, 'pres =', pres
end if
else
write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8,F24.8,'// &
'F24.8,F24.8,F24.8,F24.8,F24.8,'// &
'F24.8)') &
nondim_time, &
rho, &
vel(1), &
vel(2), &
vel(3), &
pres, &
gamma, &
pi_inf, &
qv, &
c, &
accel
if (bubbles_euler) then
FMT = '(6X,F12.6,10'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
vel(2), &
vel(3), &
pres, &
alf, &
nR(1), &
nRdot(1), &
R(1), &
Rdot(1)
else if (elasticity) then
FMT = '(6X,F12.6,8'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
vel(2), &
vel(3), &
pres, &
tau_e(1), &
tau_e(2), &
tau_e(3)
else
FMT = '(6X,F12.6,11'//FMT_glb//')'
write (i + 30, FMT) &
nondim_time, &
rho, &
vel(1), &
vel(2), &
vel(3), &
pres, & ! Out of tolerance
gamma, &
pi_inf, &
qv
end if
end if
end if
end do
Expand Down
2 changes: 0 additions & 2 deletions src/simulation/m_derived_variables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ subroutine s_compute_derived_variables(t_step)
end do

call s_derive_center_of_mass(q_prim_ts(3)%vf, c_mass)

call s_write_probe_files(t_step, q_cons_ts(1)%vf, accel_mag)

call s_write_com_files(t_step, c_mass)
end if

Expand Down
Loading
Loading