diff --git a/.github/workflows/phoenix/bench.sh b/.github/workflows/phoenix/bench.sh index 78df3dd13..a2ef778cd 100644 --- a/.github/workflows/phoenix/bench.sh +++ b/.github/workflows/phoenix/bench.sh @@ -8,4 +8,8 @@ if [ "$job_device" == "gpu" ]; then device_opts="--gpu -g $gpu_ids" fi -./mfc.sh bench -j $(nproc) -o "$job_slug.yaml" -- -c phoenix $device_opts -n $n_ranks +if ["$job_device" == "gpu"]; then + ./mfc.sh bench --mem 8 -j $(nproc) -o "$job_slug.yaml" -- -c phoenix $device_opts -n $n_ranks +else + ./mfc.sh bench --mem 1 -j $(nproc) -o "$job_slug.yaml" -- -c phoenix $device_opts -n $n_ranks +fi \ No newline at end of file diff --git a/.gitignore b/.gitignore index aa1d9dcdf..c7a2ed8fe 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,26 @@ examples/*/*.err examples/*/viz/ examples/*.jpg examples/*.png + +benchmarks/*batch/*/ +benchmarks/*/D/* +benchmarks/*/p* +benchmarks/*/D_* +benchmarks/*/*.inf +benchmarks/*/*.inp +benchmarks/*/*.dat +benchmarks/*/*.o* +benchmarks/*/silo* +benchmarks/*/restart_data* +benchmarks/*/*.out +benchmarks/*/binary +benchmarks/*/fort.1 +benchmarks/*/*.sh +benchmarks/*/*.err +benchmarks/*/viz/ +benchmarks/*.jpg +benchmarks/*.png + *.mod # Video Files diff --git a/benchmarks/3D_shockdroplet/case.py b/benchmarks/5eq_rk3_weno3_hllc/case.py similarity index 84% rename from benchmarks/3D_shockdroplet/case.py rename to benchmarks/5eq_rk3_weno3_hllc/case.py index 650bdf89d..ee8950d4e 100644 --- a/benchmarks/3D_shockdroplet/case.py +++ b/benchmarks/5eq_rk3_weno3_hllc/case.py @@ -1,7 +1,32 @@ #!/usr/bin/env python3 -import math -import json +# Benchmark model_equations_2_time_stepper_3_weno_order_3_riemann_solver_2 +# Additional Benchmarked Features +# - model_equations : 2 +# - time_stepper : 3 +# - weno_order : 3 +# - riemann_solver : 2 + +import json, math, argparse + +parser = argparse.ArgumentParser( + prog="Benchmarking Case 1", + description="This MFC case was created for the purposes of benchmarking MFC.", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + +parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS) +parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.") + +ARGS = vars(parser.parse_args()) +DICT = json.loads(ARGS["dict"]) + +size = 1 if DICT["gpu"] else 0 + +ppg = 8000000 / 16.0 +procs = DICT["nodes"] * DICT["tasks_per_node"] +ncells = math.floor(ppg * procs * ARGS["gbpp"]) +s = math.floor((ncells / 2.0) ** (1/3)) +Nx, Ny, Nz = 2*s, s, s # athmospheric pressure - Pa (used as reference value) patm = 101325 @@ -13,10 +38,9 @@ CtD = 0.06 # cavity relative eccentricity (distance between radii) -ecc = 0.564 +ecc = 0.564 -# initial shock distance from the y axis. Note that the droplet center is located at y = 0. -# Thus, the distance from the shock to +# initial shock distance from the y axis. Note that the droplet center is located at y = 0. Thus, the distance from the shock to # the droplet is about D0/8 ISD = 5.0/8 * D0 @@ -26,10 +50,10 @@ p0a = patm # density - kg/m3 -rho0a = 1.204 +rho0a = 1.204 # gamma -gama = 1.40 +gama = 1.40 # pi infinity - Pa pia = 0 @@ -52,7 +76,7 @@ rho0w = 1000 # gama -gamw = 6.12 +gamw = 6.12 # pi infty - Pa piw = 3.43E+08 @@ -60,7 +84,7 @@ # speed of sound - m/s c_w = math.sqrt( gamw * ( p0w + piw ) / rho0w ) -# Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either +# Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either # Min or psOp0a. Just comment/uncomment appropriatelly Min = 2.4 @@ -71,7 +95,7 @@ # psOp0a = 4.5 # density -rhosOrho0a = ( 1 + ( gama + 1 ) / ( gama - 1) * psOp0a ) / ( ( gama + 1 ) / ( gama - 1) + psOp0a ) +rhosOrho0a = ( 1 + ( gama + 1 ) / ( gama - 1) * psOp0a ) / ( ( gama + 1 ) / ( gama - 1) + psOp0a ) # Mach number of the shocked region - just a checker, as it must return "Min" Ms = math.sqrt( ( gama + 1. ) / ( 2. * gama ) * ( psOp0a - 1. ) * ( p0a / ( p0a + pia ) ) + 1. ) @@ -88,7 +112,7 @@ rhos = rhosOrho0a * rho0a # post shock speed of sound - m/s -c_s = math.sqrt( gama * (ps + pia) / rhos ) +c_s = math.sqrt( gama * (ps + pia) / rhos ) # velocity at the post shock - m/s vel = c_a/gama * (psOp0a - 1.) * p0a / ( p0a + pia ) / Ms @@ -111,21 +135,12 @@ ze = 10 * D0 # Stretching factor, to make sure the domaing is sufficiently large after the mesh stretch -StF = 4.0 - -# number of elements into y direction -Ny = 100 - -# number of elements into z direction -Nz = 100 - -# number of elements into x direction -Nx = Ny * 2 +StF = 4.0 # grid delta x if mesh were uniform in x direction - m. Note that I do not need a measure for dy dx = ( xe - xb ) / Nx -# I calculating tend twice; first is an estimate, second is +# I calculate tend twice; first is an estimate, second is # the actual value used. This is because I am getting errors in the # post process part every time I approximate the actual Nt by an integer # number (think of a smarter way). @@ -137,12 +152,10 @@ # mismatches in simulation and post_process parts. Note that I wrote it this way so I have better control over the # of autosaves tendA = ttilde * D0 / vel -# "CFL" number that I use to control both temporal and spatial discretizations, such that the ratio dx/dt remains constant for a given -# simulation -cfl = 0.05 +cfl = 0.1 # time-step - s -dt = cfl * dx/ ss +dt = dx * cfl/ ss # Save Frequency. Note that the number of autosaves will be SF + 1, as th IC (0.dat) is also saved SF = 400 @@ -173,26 +186,14 @@ 'y_domain%end' : ye, 'z_domain%beg' : zb, 'z_domain%end' : ze, - 'stretch_x' : 'T', - 'a_x' : 20, - 'x_a' : -1.2 * D0, - 'x_b' : 1.2 * D0, - 'stretch_y' : 'T', - 'a_y' : 20, - 'y_a' : -0.0 * D0, - 'y_b' : 1.2 * D0, - 'stretch_z' : 'T', - 'a_z' : 20, - 'z_a' : -0.0 * D0, - 'z_b' : 1.2 * D0, 'm' : Nx, 'n' : Ny, 'p' : Nz, 'cyl_coord' : 'F', 'dt' : dt, 't_step_start' : 0, - 't_step_stop' : 100, - 't_step_save' : 100, + 't_step_stop' : int(60*(95*size + 5)), + 't_step_save' : int(12*(95*size + 5)), # ========================================================== # Simulation Algorithm Parameters ========================== @@ -211,7 +212,7 @@ 'mapped_weno' : 'T', 'riemann_solver' : 2, 'wave_speeds' : 1, - 'avg_state' : 2, + 'avg_state' : 2, 'bc_x%beg' : -6, 'bc_x%end' : -6, 'bc_y%beg' : -2, @@ -226,7 +227,7 @@ 'prim_vars_wrt' :'T', 'parallel_io' :'T', # ========================================================== - # I will use 1 for WATER properties, and 2 for AIR properties + # I will use 1 for WATER properties, and 2 for AIR properties # Patch 1: Background (AIR - 2) ============================= 'patch_icpp(1)%geometry' : 9, 'patch_icpp(1)%x_centroid' : (xb+xe) / 2 * StF, @@ -280,7 +281,6 @@ 'patch_icpp(3)%alpha(1)' : 1.0E+00, 'patch_icpp(3)%alpha(2)' : 0.0E+00, # ========================================================== - # Fluids Physical Parameters =============================== 'fluid_pp(1)%gamma' : 1.0E+00/(gamw-1), @@ -291,3 +291,4 @@ })) # ============================================================================== + diff --git a/benchmarks/hypo_hll/case.py b/benchmarks/hypo_hll/case.py new file mode 100644 index 000000000..f064a15a6 --- /dev/null +++ b/benchmarks/hypo_hll/case.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python3 + +# Benchmark hypoelasticity_T_riemann_solver_1 +# Additional Benchmarked Features +# - hypoelasticity : T +# - riemann_solver : 1 + +import json, math, argparse + +parser = argparse.ArgumentParser( + prog="Benchmarkin Case 3", + description="This MFC case was created for the purposes of benchmarking MFC.", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + +parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS) +parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.") + +ARGS = vars(parser.parse_args()) +DICT = json.loads(ARGS["dict"]) + +size = 1 if DICT["gpu"] else 0 + +ppg = 8000000 / 16.0 +procs = DICT["nodes"] * DICT["tasks_per_node"] +ncells = math.floor(ppg * procs * ARGS["gbpp"]) +s = math.floor((ncells / 2.0) ** (1/3)) +Nx, Ny, Nz = 2*s, s, s + +Mu = 1.84E-05 +gam_a = 1.4 + +D = 0.1 + +# Configuring case dictionary +print(json.dumps({ + # Logistics ================================================================ + 'run_time_info' : 'T', + # ========================================================================== + + # Computational Domain Parameters ========================================== + # x direction + 'x_domain%beg' : -5*D, + 'x_domain%end' : 5.0*D, + # y direction + 'y_domain%beg' : -2.5*D, + 'y_domain%end' : 2.5*D, + # z direction + 'z_domain%beg' : -2.5*D, + 'z_domain%end' : 2.5*D, + + 'cyl_coord' : 'F', + 'm' : Nx, + 'n' : Ny, + 'p' : Nz, + 'dt' : 1.0E-7, + 't_step_start' : 0, + 't_step_stop' : int(20*(45*size + 5)), + 't_step_save' : int(4*(45*size + 5)), + # ========================================================================== + + # Simulation Algorithm Parameters ========================================== + # Only one patches are necessary, the air tube + 'num_patches' : 1, + # Use the 5 equation model + 'model_eqns' : 2, + # 6 equations model does not need the K \div(u) term + 'alt_soundspeed' : 'F', + # One fluids: air + 'num_fluids' : 1, + # Advect both volume fractions + 'adv_alphan' : 'T', + # No need to ensure the volume fractions sum to unity at the end of each + # time step + 'mpp_lim' : 'F', + # Correct errors when computing speed of sound + 'mixture_err' : 'T', + # Use TVD RK3 for time marching + 'time_stepper' : 3, + # Reconstruct the primitive variables to minimize spurious + # Use WENO5 + 'weno_order' : 5, + 'weno_eps' : 1.E-16, + 'weno_Re_flux' : 'T', + 'weno_avg' : 'T', + 'avg_state' : 2, + 'mapped_weno' : 'T', + 'null_weights' : 'F', + 'mp_weno' : 'T', + 'riemann_solver' : 2, + 'wave_speeds' : 1, + # We use ghost-cell extrapolation + 'bc_x%beg' : -3, + 'bc_x%end' : -3, + 'bc_y%beg' : -3, + 'bc_y%end' : -3, + 'bc_z%beg' : -3, + 'bc_z%end' : -3, + # Set IB to True and add 1 patch + 'ib' : 'T', + 'num_ibs' : 1, + # ========================================================================== + + # Formatted Database Files Structure Parameters ============================ + 'format' : 1, + 'precision' : 2, + 'prim_vars_wrt' :'T', + 'E_wrt' :'T', + 'parallel_io' :'T', + # ========================================================================== + + # Patch: Constant Tube filled with air ===================================== + # Specify the cylindrical air tube grid geometry + 'patch_icpp(1)%geometry' : 9, + 'patch_icpp(1)%x_centroid' : 0.0, + # Uniform medium density, centroid is at the center of the domain + 'patch_icpp(1)%y_centroid' : 0.0, + 'patch_icpp(1)%z_centroid' : 0.0, + 'patch_icpp(1)%length_x' : 10*D, + 'patch_icpp(1)%length_y' : 5*D, + 'patch_icpp(1)%length_z' : 5*D, + # Specify the patch primitive variables + 'patch_icpp(1)%vel(1)' : 527.2E+00, + 'patch_icpp(1)%vel(2)' : 0.0E+00, + 'patch_icpp(1)%vel(3)' : 0.0E+00, + 'patch_icpp(1)%pres' : 10918.2549, + 'patch_icpp(1)%alpha_rho(1)' : 0.2199, + 'patch_icpp(1)%alpha(1)' : 1.E+00, + # # ======================================================================== + + # Patch: Sphere Immersed Boundary ======================================== + 'patch_ib(1)%geometry' : 8, + 'patch_ib(1)%x_centroid' : -3.0E-3, + 'patch_ib(1)%y_centroid' : 0.0, + 'patch_ib(1)%z_centroid' : 0.0, + 'patch_ib(1)%radius' : D/2, + 'patch_ib(1)%slip' : 'T', + # ========================================================================== + + # Fluids Physical Parameters =============================================== + 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40) + 'fluid_pp(1)%pi_inf' : 0, + 'fluid_pp(1)%Re(1)' : 7535533.2, + # ========================================================================== +})) diff --git a/benchmarks/ibm/case.py b/benchmarks/ibm/case.py new file mode 100644 index 000000000..9b127d69d --- /dev/null +++ b/benchmarks/ibm/case.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python3 + +# Benchmark ibm_T +# Additional Benchmarked Features +# - ibm : T + +import json, math, argparse + +parser = argparse.ArgumentParser( + prog="Benchmarking Case 4", + description="This MFC case was created for the purposes of benchmarking MFC.", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + +parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS) +parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.") + +ARGS = vars(parser.parse_args()) +DICT = json.loads(ARGS["dict"]) + +size = 1 if DICT["gpu"] else 0 + +ppg = 8000000 / 16.0 +procs = DICT["nodes"] * DICT["tasks_per_node"] +ncells = math.floor(ppg * procs * ARGS["gbpp"]) +s = math.floor((ncells / 2.0) ** (1/3)) +Nx, Ny, Nz = 2*s, s, s + +dx = 1./(1.*(Nx+1)) + +Tend = 64E-06 +Nt = 200 +mydt = Tend/(1.*Nt) + +# Configuring case dictionary +print(json.dumps({ + # Logistics ================================================ + 'run_time_info' : 'F', + # ========================================================== + + # Computational Domain Parameters ========================== + 'x_domain%beg' : 0.E+00, + 'x_domain%end' : 1.E+00, + 'y_domain%beg' : 0, + 'y_domain%end' : 0.5, + 'z_domain%beg' : 0., + 'z_domain%end' : 0.5, + 'm' : Nx, + 'n' : Ny, + 'p' : Nz, + 'dt' : mydt, + 't_step_start' : 0, + 't_step_stop' : int(40*(95*size + 5)), + 't_step_save' : int(8*(95*size + 5)), + # ========================================================== + + # Simulation Algorithm Parameters ========================== + 'num_patches' : 2, + 'model_eqns' : 2, + 'alt_soundspeed' : 'F', + 'num_fluids' : 1, + 'adv_alphan' : 'T', + 'mpp_lim' : 'F', + 'mixture_err' : 'F', + 'time_stepper' : 3, + 'weno_order' : 5, + 'weno_eps' : 1.E-16, + 'weno_Re_flux' : 'F', + 'weno_avg' : 'F', + 'mapped_weno' : 'F', + 'null_weights' : 'F', + 'mp_weno' : 'F', + 'riemann_solver' : 1, + 'wave_speeds' : 1, + 'avg_state' : 2, + 'bc_x%beg' : -3, + 'bc_x%end' : -3, + 'bc_y%beg' : -3, + 'bc_y%end' : -3, + 'bc_z%beg' : -3, + 'bc_z%end' : -3, + # ========================================================== + + # Turning on Hypoelasticity ================================ + 'hypoelasticity' : 'T', + # ========================================================== + + # Formatted Database Files Structure Parameters ============ + 'format' : 1, + 'precision' : 2, + 'prim_vars_wrt' :'T', + 'parallel_io' :'T', + # ========================================================== + + # Patch 1 L ================================================ + 'patch_icpp(1)%geometry' : 9, + 'patch_icpp(1)%x_centroid' : 0.25, + 'patch_icpp(1)%y_centroid' : 0.25, + 'patch_icpp(1)%z_centroid' : 0.25, + 'patch_icpp(1)%length_x' : 0.5, + 'patch_icpp(1)%length_y' : 0.5, + 'patch_icpp(1)%length_z' : 0.5, + 'patch_icpp(1)%vel(1)' : 0.0, + 'patch_icpp(1)%vel(2)' : 0, + 'patch_icpp(1)%vel(3)' : 0, + 'patch_icpp(1)%pres' : 1.E+8, + 'patch_icpp(1)%alpha_rho(1)' : 1000, + 'patch_icpp(1)%alpha(1)' : 1., + 'patch_icpp(1)%tau_e(1)' : 0.0, + # ========================================================== + + # Patch 2 R ================================================ + 'patch_icpp(2)%geometry' : 9, + 'patch_icpp(2)%x_centroid' : 0.75, + 'patch_icpp(2)%y_centroid' : 0.25, + 'patch_icpp(2)%z_centroid' : 0.25, + 'patch_icpp(2)%length_x' : 0.5, + 'patch_icpp(2)%length_y' : 0.5, + 'patch_icpp(2)%length_z' : 0.5, + 'patch_icpp(2)%vel(1)' : 0, + 'patch_icpp(2)%vel(2)' : 0, + 'patch_icpp(2)%vel(3)' : 0, + 'patch_icpp(2)%pres' : 1.E+05, + 'patch_icpp(2)%alpha_rho(1)' : 1000, + 'patch_icpp(2)%alpha(1)' : 1., + 'patch_icpp(2)%tau_e(1)' : 0.0, + # ========================================================== + + # Fluids Physical Parameters =============================== + 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), + 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00 - 1.E+00), + 'fluid_pp(1)%G' : 10E+09, + # ========================================================== +})) +# ============================================================================== diff --git a/benchmarks/viscous_weno5_sgb_mono/case.py b/benchmarks/viscous_weno5_sgb_mono/case.py new file mode 100644 index 000000000..e9b5e913d --- /dev/null +++ b/benchmarks/viscous_weno5_sgb_mono/case.py @@ -0,0 +1,243 @@ +#!/usr/bin/env python3 + +# Benchmark viscosity_weno_Re_flux_T_weno_order_5_bubbles_T_bubble_mode_3_monopole_T +# Additional Benchmarked Features +# - viscosity enabled +# - weno_Re_flux : T +# - weno_order : 5 +# - bubbles : T +# - bubble_model : 3 +# - monopole : T + +import json, math, argparse + +parser = argparse.ArgumentParser( + prog="Benchmarking Case 2", + description="This MFC case was created for the purposes of benchmarking MFC.", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + +parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS) +parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.") + +ARGS = vars(parser.parse_args()) +DICT = json.loads(ARGS["dict"]) + +size = 1 if DICT["gpu"] else 0 + +ppg = 8000000 / 16.0 +procs = DICT["nodes"] * DICT["tasks_per_node"] +ncells = math.floor(ppg * procs * ARGS["gbpp"]) +s = math.floor((ncells / 2.0) ** (1/3)) +Nx, Ny, Nz = 2*s, s, s + +x0 = 10.E-04 +y0 = 10.E-04 +z0 = 10.E-04 +p0 = 1. +rho0 = 1.E+03 +c0 = math.sqrt( p0/rho0 ) +patm = 1. + +#water props +n_tait = 7.1 +B_tait = 306.E+06 / p0 +mul0 = 1.002E-03 #viscosity +ss = 0.07275 #surface tension +pv = 2.3388E+03 #vapor pressure + +gamma_v = 1.33 +M_v = 18.02 +mu_v = 0.8816E-05 +k_v = 0.019426 + +#air props +gamma_n = 1.4 +M_n = 28.97 +mu_n = 1.8E-05 +k_n = 0.02556 + +#air props +gamma_gas = gamma_n + +#reference bubble size +R0ref = 10.E-06 + +pa = 0.1 * 1.E+06 / 101325. + +#Characteristic velocity +uu = math.sqrt( p0/rho0 ) +#Cavitation number +Ca = (p0 - pv)/(rho0*(uu**2.)) +#Weber number +We = rho0*(uu**2.)*R0ref/ss +#Inv. bubble Reynolds number +Re_inv = mul0/(rho0*uu*R0ref) + +#IC setup +vf0 = 0.00004 +n0 = vf0/(math.pi*4.E+00/3.E+00) + +cact = 1475. +t0 = x0/c0 + +nbubbles = 1 +myr0 = R0ref + +cfl = 0.01 +Ldomain = 20.E-03 +L = Ldomain/x0 +dx = L/float(Nx) +dt = cfl*dx*c0/cact +Lpulse = 0.3*Ldomain +Tpulse = Lpulse/cact + +# Configuring case dictionary +print(json.dumps({ + # Logistics ================================================ + 'run_time_info' : 'T', + # ========================================================== + + # Computational Domain Parameters ========================== + 'x_domain%beg' : -10.E-03/x0, + 'x_domain%end' : 10.E-03/x0, + 'y_domain%beg' : -5.E-03/y0, + 'y_domain%end' : 5.E-03/y0, + 'z_domain%beg' : -5.E-03/z0, + 'z_domain%end' : 5.E-03/z0, + 'stretch_x' : 'F', + 'cyl_coord' : 'F', + 'm' : Nx, + 'n' : Ny, + 'p' : Nz, + 'dt' : dt, + 't_step_start' : 0, + 't_step_stop' : int(30*(25*size + 5)), + 't_step_save' : int(6*(25*size + 5)), + # ========================================================== + + # Simulation Algorithm Parameters ========================== + 'num_patches' : 2, + 'model_eqns' : 2, + 'alt_soundspeed' : 'F', + 'num_fluids' : 1, + 'adv_alphan' : 'T', + 'mpp_lim' : 'F', + 'mixture_err' : 'F', + 'time_stepper' : 3, + 'weno_order' : 5, + 'weno_eps' : 1.E-16, + 'weno_Re_flux' : 'F', + 'weno_avg' : 'F', + 'mapped_weno' : 'T', + 'null_weights' : 'F', + 'mp_weno' : 'T', + 'riemann_solver' : 2, + 'wave_speeds' : 1, + 'avg_state' : 2, + 'bc_x%beg' : -3, + 'bc_x%end' : -3, + 'bc_y%beg' : -3, + 'bc_y%end' : -3, + 'bc_z%beg' : -3, + 'bc_z%end' : -3, + # ========================================================== + + # Formatted Database Files Structure Parameters ============ + 'format' : 1, + 'precision' : 2, + 'prim_vars_wrt' :'T', + 'parallel_io' :'T', + # ========================================================== + + # Patch 1 _ Background ===================================== + 'patch_icpp(1)%geometry' : 9, + 'patch_icpp(1)%x_centroid' : 0., + 'patch_icpp(1)%y_centroid' : 0., + 'patch_icpp(1)%z_centroid' : 0., + 'patch_icpp(1)%length_x' : 20.E-03/x0, + 'patch_icpp(1)%length_y' : 10.E-03/y0, + 'patch_icpp(1)%length_z' : 10.E-03/z0, + 'patch_icpp(1)%vel(1)' : 0.0, + 'patch_icpp(1)%vel(2)' : 0.0, + 'patch_icpp(1)%vel(3)' : 0.0, + 'patch_icpp(1)%pres' : patm, + 'patch_icpp(1)%alpha_rho(1)' : (1.-1.E-12)*1.E+03/rho0, + 'patch_icpp(1)%alpha(1)' : 1.E-12, + 'patch_icpp(1)%r0' : 1., + 'patch_icpp(1)%v0' : 0.0E+00, + # ========================================================== + + # Patch 2 Screen =========================================== + 'patch_icpp(2)%geometry' : 9, + 'patch_icpp(2)%x_centroid' : 0., + 'patch_icpp(2)%y_centroid' : 0., + 'patch_icpp(2)%z_centroid' : 0., + 'patch_icpp(2)%length_x' : 5.E-03/x0, + 'patch_icpp(2)%length_y' : 10.E-03/y0, + 'patch_icpp(2)%length_z' : 10.E-03/z0, + 'patch_icpp(2)%alter_patch(1)' : 'T', + 'patch_icpp(2)%vel(1)' : 0.0, + 'patch_icpp(2)%vel(2)' : 0.0, + 'patch_icpp(2)%vel(3)' : 0.0, + 'patch_icpp(2)%pres' : patm, + 'patch_icpp(2)%alpha_rho(1)' : (1.-vf0)*1.E+03/rho0, + 'patch_icpp(2)%alpha(1)' : vf0, + 'patch_icpp(2)%r0' : 1., + 'patch_icpp(2)%v0' : 0.0E+00, + # ========================================================== + + # Fluids Physical Parameters =============================== + # Surrounding liquid + 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), + 'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), + 'fluid_pp(1)%mul0' : mul0, + 'fluid_pp(1)%ss' : ss, + 'fluid_pp(1)%pv' : pv, + 'fluid_pp(1)%gamma_v' : gamma_v, + 'fluid_pp(1)%M_v' : M_v, + 'fluid_pp(1)%mu_v' : mu_v, + 'fluid_pp(1)%k_v' : k_v, + 'fluid_pp(1)%Re(1)' : 1e3, + # Last fluid_pp is always reserved for bubble gas state === + # if applicable ========================================== + 'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), + 'fluid_pp(2)%pi_inf' : 0.0E+00, + 'fluid_pp(2)%gamma_v' : gamma_n, + 'fluid_pp(2)%M_v' : M_n, + 'fluid_pp(2)%mu_v' : mu_n, + 'fluid_pp(2)%k_v' : k_n, + # ========================================================== + + # Non-polytropic gas compression model AND/OR Tait EOS ===== + 'pref' : p0, + 'rhoref' : rho0, + # ========================================================== + + # Bubbles ================================================== + 'bubbles' : 'T', + 'bubble_model' : 3, + 'polytropic' : 'T', + 'polydisperse' : 'F', + # 'poly_sigma' : 0.3, + 'thermal' : 3, + 'R0ref' : myr0, + 'nb' : 1, + 'Ca' : Ca, + 'Web' : We, + 'Re_inv' : Re_inv, + # ========================================================== + + # Acoustic source ========================================== + 'Monopole' : 'T', + 'num_mono' : 1, + 'Mono(1)%loc(1)' : -5.E-03/x0, + 'Mono(1)%npulse' : 1, + 'Mono(1)%dir' : 1., + 'Mono(1)%pulse' : 1, + 'Mono(1)%mag' : pa, + 'Mono(1)%length' : (1./(300000.))*cact/x0, + # ========================================================== +})) + +# ============================================================================== + diff --git a/toolchain/bench.yaml b/toolchain/bench.yaml index 50705dd6e..bd682819c 100644 --- a/toolchain/bench.yaml +++ b/toolchain/bench.yaml @@ -1,3 +1,38 @@ -- slug: 3D_shockdroplet - path: benchmarks/3D_shockdroplet/case.py +# Benchmark model_equations_2_time_stepper_3_weno_order_3_riemann_solver_2 +# Additional Benchmarked Features +# - model_equations : 2 +# - time_stepper : 3 +# - weno_order : 3 +# - riemann_solver : 2 +- slug: 5eq_rk3_weno3_hllc + path: benchmarks/5eq_rk3_weno3_hllc/case.py args: [] + +# Benchmark viscosity_weno_Re_flux_T_weno_order_5_bubbles_T_bubble_mode_3_monopole_T +# Additional Benchmarked Features +# - viscosity enabled +# - weno_Re_flux : T +# - weno_order : 5 +# - bubbles : T +# - bubble_model : 3 +# - monopole : T +- slug: viscous_weno5_sgb_mono + path: benchmarks/viscous_weno5_sgb_mono/case.py + args: [] + +# Benchmark ibm_T +# Additional Benchmarked Features +# - ibm : T +- slug: ibm + path: benchmarks/ibm/case.py + args: [] + +# Benchmark hypoelasticity_T_riemann_solver_1 +# Additional Benchmarked Features +# - hypoelasticity : T +# - riemann_solver : 1 +- slug: hypo_hll + path: benchmarks/hypo_hll/case.py + args: [] + + diff --git a/toolchain/mfc/args.py b/toolchain/mfc/args.py index 6aa43cca4..3eb109f0a 100644 --- a/toolchain/mfc/args.py +++ b/toolchain/mfc/args.py @@ -126,6 +126,7 @@ def add_common_arguments(p, mask = None): # === BENCH === add_common_arguments(bench) bench.add_argument("-o", "--output", metavar="OUTPUT", default=None, type=str, required="True", help="Path to the YAML output file to write the results to.") + bench.add_argument("-m", "--mem", metavar="MEM", default=1, type=int, help="Memory per task for benchmarking cases") bench.add_argument(metavar="FORWARDED", default=[], dest='--', nargs="*", help="Arguments to forward to the ./mfc.sh run invocations.") # === BENCH_DIFF === diff --git a/toolchain/mfc/bench.py b/toolchain/mfc/bench.py index 8843de350..928953e70 100644 --- a/toolchain/mfc/bench.py +++ b/toolchain/mfc/bench.py @@ -56,7 +56,7 @@ def bench(targets = None): with open(log_filepath, "w") as log_file: system( - ["./mfc.sh", "run", case.path, "--case-optimization"] + + ["./mfc.sh", "run", case.path, ARG('mem'), "--case-optimization"] + ["--targets"] + [t.name for t in targets] + ["--output-summary", summary_filepath] + case.args, @@ -81,15 +81,24 @@ def diff(): cons.print(f"[bold]Comparing Bencharks: [magenta]{os.path.relpath(ARG('lhs'))}[/magenta] is x times slower than [magenta]{os.path.relpath(ARG('rhs'))}[/magenta].[/bold]") if lhs["metadata"] != rhs["metadata"]: - cons.print(f"[bold yellow]Warning[/bold yellow]: Metadata of lhs and rhs are not equal.") - quit(1) + def _lock_to_str(lock): + return ' '.join([f"{k}={v}" for k, v in lock.items()]) + + cons.print(f"[bold yellow]Warning[/bold yellow]: Metadata in lhs and rhs are not equal.") + cons.print(f" This could mean that the benchmarks are not comparable (e.g. one was run on CPUs and the other on GPUs).") + cons.print(f" lhs:") + cons.print(f" * Invocation: [magenta]{' '.join(lhs['metadata']['invocation'])}[/magenta]") + cons.print(f" * Modes: {_lock_to_str(lhs['metadata']['lock'])}") + cons.print(f" rhs:") + cons.print(f" * Invocation: {' '.join(rhs['metadata']['invocation'])}") + cons.print(f" * Modes: [magenta]{_lock_to_str(rhs['metadata']['lock'])}[/magenta]") slugs = set(lhs["cases"].keys()) & set(rhs["cases"].keys()) if len(slugs) not in [len(lhs["cases"]), len(rhs["cases"])]: - cons.print(f"[bold yellow]Warning[/bold yellow]: Cases of lhs and rhs are not equal.[/bold yellow]") - cons.print(f"[bold yellow]lhs: {set(lhs['cases'].keys()) - slugs}[/bold yellow]") - cons.print(f"[bold yellow]rhs: {set(rhs['cases'].keys()) - slugs}[/bold yellow]") - cons.print(f"[bold yellow]Using intersection: {slugs}[/bold yellow]") + cons.print(f"[bold yellow]Warning[/bold yellow]: Cases in lhs and rhs are not equal.") + cons.print(f" * rhs cases: {', '.join(set(rhs['cases'].keys()) - slugs)}.") + cons.print(f" * lhs cases: {', '.join(set(lhs['cases'].keys()) - slugs)}.") + cons.print(f" Using intersection: {slugs} with {len(slugs)} elements.") table = rich.table.Table(show_header=True, box=rich.table.box.SIMPLE) table.add_column("[bold]Case[/bold]", justify="left")