Skip to content

Commit e563f3d

Browse files
committed
Test with Probes
1 parent 6f58eec commit e563f3d

File tree

921 files changed

+49275
-34303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

921 files changed

+49275
-34303
lines changed

src/simulation/m_data_output.fpp

Lines changed: 93 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,8 @@ contains
10751075
real(wp) :: G
10761076
real(wp) :: dyn_p, T
10771077
real(wp) :: damage_state
1078+
character(LEN=15) :: FMT_glb
1079+
character(len=50) :: FMT
10781080

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

@@ -1088,7 +1090,7 @@ contains
10881090
logical :: trigger !< For integral quantities
10891091

10901092
real(wp) :: rhoYks(1:num_species)
1091-
1093+
real(wp) :: pres_mag !< Magnetic pressure for MHD
10921094
T = dflt_T_guess
10931095

10941096
! Non-dimensional time calculation
@@ -1156,7 +1158,8 @@ contains
11561158
Re, G, fluid_pp(:)%G)
11571159
else
11581160
call s_convert_to_mixture_variables(q_cons_vf, j - 2, k, l, &
1159-
rho, gamma, pi_inf, qv)
1161+
rho, gamma, pi_inf, qv, &
1162+
Re)
11601163
end if
11611164
do s = 1, num_vels
11621165
vel(s) = q_cons_vf(cont_idx%end + s)%sf(j - 2, k, l)/rho
@@ -1176,6 +1179,14 @@ contains
11761179
dyn_p, pi_inf, gamma, rho, qv, rhoYks(:), pres, T, &
11771180
q_cons_vf(stress_idx%beg)%sf(j - 2, k, l), &
11781181
q_cons_vf(mom_idx%beg)%sf(j - 2, k, l), G)
1182+
else if (mhd) then
1183+
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)
1184+
1185+
call s_compute_pressure( &
1186+
q_cons_vf(1)%sf(j - 2, k, l), &
1187+
q_cons_vf(alf_idx)%sf(j - 2, k, l), &
1188+
dyn_p, pi_inf, gamma, rho, qv, rhoYks(:), pres, T, &
1189+
pres_mag= pres_mag)
11791190
else
11801191
call s_compute_pressure( &
11811192
q_cons_vf(1)%sf(j - 2, k, l), &
@@ -1243,11 +1254,7 @@ contains
12431254
accel = accel_mag(j - 2, k, l)
12441255
end if
12451256
elseif (p == 0) then ! 2D simulation
1246-
if (chemistry) then
1247-
do d = 1, num_species
1248-
rhoYks(d) = q_cons_vf(chemxb + d - 1)%sf(j - 2, k - 2, l)
1249-
end do
1250-
end if
1257+
12511258

12521259
if ((probe(i)%x >= x_cb(-1)) .and. (probe(i)%x <= x_cb(m))) then
12531260
if ((probe(i)%y >= y_cb(-1)) .and. (probe(i)%y <= y_cb(n))) then
@@ -1264,7 +1271,11 @@ contains
12641271
if (j == 1) j = 2 ! Pick first point if probe is at edge
12651272
if (k == 1) k = 2 ! Pick first point if probe is at edge
12661273
l = 0
1267-
1274+
if (chemistry) then
1275+
do d = 1, num_species
1276+
rhoYks(d) = q_cons_vf(chemxb + d - 1)%sf(j - 2, k - 2, l)
1277+
end do
1278+
end if
12681279
! Computing/Sharing necessary state variables
12691280
call s_convert_to_mixture_variables(q_cons_vf, j - 2, k - 2, l, &
12701281
rho, gamma, pi_inf, qv, &
@@ -1290,6 +1301,13 @@ contains
12901301
T, &
12911302
q_cons_vf(stress_idx%beg)%sf(j - 2, k - 2, l), &
12921303
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l), G)
1304+
else if (mhd) then
1305+
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)
1306+
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l), &
1307+
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
1308+
dyn_p, pi_inf, gamma, rho, qv, &
1309+
rhoYks, pres, T, pres_mag=pres_mag)
1310+
12931311
else
12941312
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l), &
12951313
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
@@ -1329,6 +1347,7 @@ contains
13291347
! Compute mixture sound speed
13301348
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, &
13311349
((gamma + 1._wp)*pres + pi_inf)/rho, alpha, 0._wp, 0._wp, c)
1350+
accel = accel_mag(j - 2, k - 2, l)
13321351

13331352
end if
13341353
end if
@@ -1384,6 +1403,12 @@ contains
13841403
rhoYks, pres, T, &
13851404
q_cons_vf(stress_idx%beg)%sf(j - 2, k - 2, l - 2), &
13861405
q_cons_vf(mom_idx%beg)%sf(j - 2, k - 2, l - 2), G)
1406+
else if (mhd) then
1407+
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)
1408+
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l), &
1409+
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l), &
1410+
dyn_p, pi_inf, gamma, rho, qv, &
1411+
rhoYks, pres, T, pres_mag=pres_mag)
13871412
else
13881413
call s_compute_pressure(q_cons_vf(E_idx)%sf(j - 2, k - 2, l - 2), &
13891414
q_cons_vf(alf_idx)%sf(j - 2, k - 2, l - 2), &
@@ -1437,11 +1462,17 @@ contains
14371462
call s_mpi_allreduce_sum(tmp, damage_state)
14381463
end if
14391464
end if
1465+
if (precision == 1) then
1466+
FMT_glb = "F30.7"
1467+
else
1468+
FMT_glb = "F40.14"
1469+
end if
14401470
if (proc_rank == 0) then
14411471
if (n == 0) then
14421472
if (bubbles_euler .and. (num_fluids <= 2)) then
14431473
if (qbmm) then
1444-
write (i + 30, '(6x,f12.6,14f28.16)') &
1474+
FMT = '(6X,f12.6,14'//FMT_glb//')'
1475+
write (i + 30, FMT) &
14451476
nondim_time, &
14461477
rho, &
14471478
vel(1), &
@@ -1458,7 +1489,8 @@ contains
14581489
M20, &
14591490
M02
14601491
else
1461-
write (i + 30, '(6x,f12.6,8f24.8)') &
1492+
FMT = '(6X,f12.6,8'//FMT_glb//')'
1493+
write (i + 30, FMT) &
14621494
nondim_time, &
14631495
rho, &
14641496
vel(1), &
@@ -1472,8 +1504,8 @@ contains
14721504
! ptot
14731505
end if
14741506
else if (bubbles_euler .and. (num_fluids == 3)) then
1475-
write (i + 30, '(6x,f12.6,f24.8,f24.8,f24.8,f24.8,f24.8,'// &
1476-
'f24.8,f24.8,f24.8,f24.8,f24.8, f24.8)') &
1507+
FMT = '(6X,f12.6,11'//FMT_glb//')'
1508+
write (i + 30, FMT) &
14771509
nondim_time, &
14781510
rho, &
14791511
vel(1), &
@@ -1487,8 +1519,8 @@ contains
14871519
ptilde, &
14881520
ptot
14891521
else if (bubbles_euler .and. num_fluids == 4) then
1490-
write (i + 30, '(6x,f12.6,f24.8,f24.8,f24.8,f24.8,'// &
1491-
'f24.8,f24.8,f24.8,f24.8,f24.8,f24.8,f24.8,f24.8,f24.8)') &
1522+
FMT = '(6X,f12.6,13'//FMT_glb//')'
1523+
write (i + 30, FMT) &
14921524
nondim_time, &
14931525
q_cons_vf(1)%sf(j - 2, 0, 0), &
14941526
q_cons_vf(2)%sf(j - 2, 0, 0), &
@@ -1504,15 +1536,17 @@ contains
15041536
R(1), &
15051537
Rdot(1)
15061538
else
1507-
write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8)') &
1539+
FMT = '(6X,f12.6,3'//FMT_glb//')'
1540+
write (i + 30, FMT) &
15081541
nondim_time, &
15091542
rho, &
15101543
vel(1), &
15111544
pres
15121545
end if
15131546
elseif (p == 0) then
15141547
if (bubbles_euler) then
1515-
write (i + 30, '(6X,10F24.8)') &
1548+
FMT = '(6X,f12.6,9'//FMT_glb//')'
1549+
write (i + 30, FMT) &
15161550
nondim_time, &
15171551
rho, &
15181552
vel(1), &
@@ -1524,8 +1558,8 @@ contains
15241558
R(1), &
15251559
Rdot(1)
15261560
else if (elasticity) then
1527-
write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8,F24.8,'// &
1528-
'F24.8,F24.8,F24.8)') &
1561+
FMT = '(6X,F12.6,7'//FMT_glb//')'
1562+
write (i + 30, FMT) &
15291563
nondim_time, &
15301564
rho, &
15311565
vel(1), &
@@ -1535,28 +1569,54 @@ contains
15351569
tau_e(2), &
15361570
tau_e(3)
15371571
else
1538-
write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8)') &
1572+
FMT = '(6X,F12.6,3'//FMT_glb//')'
1573+
write (i + 30, FMT) &
15391574
nondim_time, &
15401575
rho, &
15411576
vel(1), &
15421577
pres
15431578
print *, 'time =', nondim_time, 'rho =', rho, 'pres =', pres
15441579
end if
15451580
else
1546-
write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8,F24.8,'// &
1547-
'F24.8,F24.8,F24.8,F24.8,F24.8,'// &
1548-
'F24.8)') &
1549-
nondim_time, &
1550-
rho, &
1551-
vel(1), &
1552-
vel(2), &
1553-
vel(3), &
1554-
pres, &
1555-
gamma, &
1556-
pi_inf, &
1557-
qv, &
1558-
c, &
1559-
accel
1581+
if (bubbles_euler) then
1582+
FMT = '(6X,F12.6,10'//FMT_glb//')'
1583+
write (i + 30, FMT) &
1584+
nondim_time, &
1585+
rho, &
1586+
vel(1), &
1587+
vel(2), &
1588+
vel(3), &
1589+
pres, &
1590+
alf, &
1591+
nR(1), &
1592+
nRdot(1), &
1593+
R(1), &
1594+
Rdot(1)
1595+
else if (elasticity) then
1596+
FMT = '(6X,F12.6,8'//FMT_glb//')'
1597+
write (i + 30, FMT) &
1598+
nondim_time, &
1599+
rho, &
1600+
vel(1), &
1601+
vel(2), &
1602+
vel(3), &
1603+
pres, &
1604+
tau_e(1), &
1605+
tau_e(2), &
1606+
tau_e(3)
1607+
else
1608+
FMT = '(6X,F12.6,9'//FMT_glb//')'
1609+
write (i + 30, FMT) &
1610+
nondim_time, &
1611+
rho, &
1612+
vel(1), &
1613+
vel(2), &
1614+
vel(3), &
1615+
pres, & ! Out of tolerance
1616+
gamma, &
1617+
pi_inf, &
1618+
qv
1619+
end if
15601620
end if
15611621
end if
15621622
end do

0 commit comments

Comments
 (0)