Skip to content

Commit

Permalink
Convert square-convection-1e6 to h5part
Browse files Browse the repository at this point in the history
  • Loading branch information
angus-g committed May 27, 2021
1 parent 7035dbd commit 8af3723
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions square-convection-1e6/square-convection-1e6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,25 @@ for i, coord in enumerate(coords):
psi_max = (coord[:2], abs(psi[i]))
</variable>
<variable name = "psi_mid" language = "python">
import fluidity_tools
s = fluidity_tools.stat_parser("square-convection.detectors")
psi_mid = s["Fluid"]["StreamFunction"]["MidPoint"][-1]
import h5py
import numpy as np
f = h5py.File("square-convection.detectors.h5part", "r")
d = f["/Step#{}".format(len(f) - 1)]
det_id, = np.where(d["id"][:] == f.attrs["MidPoint%ids"][0])
psi_mid = d["Fluid%StreamFunction"][det_id[0]]
</variable>
<variable name = "left_boundary_average_nu" language = "python">
import fluidity_tools
s = fluidity_tools.stat_parser("square-convection.stat")
left_boundary_average_nu = s["Fluid"]["Temperature"]["surface_integral%LeftH"][-1]
</variable>
<variable name = "left_boundary_mid_height_nu" language = "python">
import fluidity_tools
s = fluidity_tools.stat_parser("square-convection.detectors")
left_boundary_mid_height_nu = -s["Fluid"]["TemperatureGradient"]["LeftBoundaryMidHeight"][0][-1]
import h5py
import numpy as np
f = h5py.File("square-convection.detectors.h5part", "r")
d = f["/Step#{}".format(len(f) - 1)]
det_id, = np.where(d["id"][:] == f.attrs["LeftBoundaryMidHeight%ids"][0])
left_boundary_mid_height_nu = d["Fluid%TemperatureGradient%x"][det_id[0]]
</variable>
<variable name = "left_boundary_nus" language = "python">
import fluidity.diagnostics.fluiditytools as fluidity_tools
Expand Down Expand Up @@ -162,7 +168,7 @@ fluidity_tools.compare_variable(left_boundary_average_nu, 8.800, 0.03)
</test>
<test name = "Left boundary mid-height Nu benchmark" language = "python">
import fluidity_tools
fluidity_tools.compare_variable(left_boundary_mid_height_nu, 8.799, 0.1)
fluidity_tools.compare_variable(left_boundary_mid_height_nu, -8.799, 0.1)
</test>
<test name = "Final left boundary Nu extrema benchmarks" language = "python">
import fluidity_tools
Expand Down

0 comments on commit 8af3723

Please sign in to comment.