From 8e67567da84ab5db61117903d8c8b08123b461d2 Mon Sep 17 00:00:00 2001 From: Mauro Rodriguez Date: Fri, 31 Jan 2025 14:03:07 -0600 Subject: [PATCH] additional small fixes --- examples/2D_hyper_sucrosebubble/case.py | 200 ----------------------- examples/2D_sucrose_diff_units/case.py | 201 ------------------------ toolchain/mfc/test/cases.py | 2 +- 3 files changed, 1 insertion(+), 402 deletions(-) delete mode 100644 examples/2D_hyper_sucrosebubble/case.py delete mode 100644 examples/2D_sucrose_diff_units/case.py diff --git a/examples/2D_hyper_sucrosebubble/case.py b/examples/2D_hyper_sucrosebubble/case.py deleted file mode 100644 index 3588931f5..000000000 --- a/examples/2D_hyper_sucrosebubble/case.py +++ /dev/null @@ -1,200 +0,0 @@ -#!/usr/bin/env python3 -import math -import json - -# ps = 248758.567 -gam = 1.4 -rho = 1.0 -# c_l = math.sqrt( 1.4*ps/rho ) -c_l = 3077.6 # m/s -vel = 0 - -leng = 1.0 -Ny = 100.0 -Nx = Ny * 3 -dx = leng / Nx - -time_end = 3.0e1 # 5*leng/vel -cfl = 0.1 - -dt = cfl * dx / c_l -Nt = int(time_end / dt) - -# Material parameters of sucrose (dimensional) -Kt0_suc = 14.3e9 # Pa -Kt0_prime_suc = 3.75 # - -rho_0_suc = 1580.5 # kg/m^3 -einstein_cv1_suc = 3279 # J/Kg-K -einstein_cv2_suc = 1125 # K -G_suc = 8.58e9 # Pa -c_0 = 3077.6 # m/s -theta_0_suc = 298 # K -gamma_suc = 1.09 - -# Initial condition -theta_0 = 298 # K -P_0 = 133.3223684211 # Pa -compression_ratio = 1.1 # rho/rho_0 in the shocked region -rho_0 = 1580.5 # kg/m^3 - -# Calculate bulk speed of sound at ambient (used for non-dimensionalization) -c_squared = ( - (Kt0_suc / rho_0_suc) - + gamma_suc * P_0 / rho_0_suc - + math.pow(gamma_suc, 2) * einstein_cv1_suc * (math.pow(einstein_cv2_suc / theta_0_suc, 2)) * math.exp(einstein_cv2_suc / theta_0) / (math.pow(math.exp(einstein_cv2_suc / theta_0_suc) - 1, 2)) -) - -c_0 = math.sqrt(c_squared) -# print(c_0) - -# RH jump conditions in non-dimensional form to calculate P, u_p, U_s -tilde_P_0 = P_0 / (rho_0_suc * c_0 * c_0) -tilde_rho = compression_ratio -Kt0_tilde = Kt0_suc / (rho_0_suc * c_0 * c_0) -A_tilde = einstein_cv1_suc * theta_0 / (c_0 * c_0) -theta_E_tilde = einstein_cv2_suc / theta_0 -rho_0_tilde = rho_0 / rho_0_suc -phi = math.exp(gamma_suc * (1 - 1 / tilde_rho)) -int_energy = 0.5 * Kt0_tilde * pow(math.log(tilde_rho), 2) * (1 + (Kt0_prime_suc - 2) * math.log(tilde_rho) / 3) + A_tilde * ( - phi * theta_E_tilde * math.exp(phi * theta_E_tilde) / (math.exp(phi * theta_E_tilde) - 1) - math.log(math.exp(phi * theta_E_tilde) - 1) -) -int_energy0 = A_tilde * (theta_E_tilde * math.exp(theta_E_tilde) / (math.exp(theta_E_tilde) - 1) - math.log(math.exp(theta_E_tilde) - 1)) -p_theta0 = Kt0_tilde * tilde_rho * math.log(tilde_rho) * (1 + 0.5 * (Kt0_prime_suc - 2) * math.log(tilde_rho)) -ps = (-tilde_P_0 * (1 - 1 / tilde_rho + 2 / gamma_suc) + (2 / gamma_suc) * (-p_theta0 + gamma_suc * (int_energy - int_energy0))) / (1 - 1 / tilde_rho - 2 / gamma_suc) - -vel = math.sqrt((ps - tilde_P_0) * (1 - 1 / tilde_rho)) - - -# Configuring case dictionary -print( - json.dumps( - { - # Logistics - "run_time_info": "T", - # Computational Domain Parameters - "x_domain%beg": -leng / 2.0, - "x_domain%end": leng / 2 + 2 * leng, - "y_domain%beg": -leng / 2.0, - "y_domain%end": leng / 2.0, - "m": int(Nx), - "n": int(Ny), - "p": 0, - "dt": dt, - "t_step_start": 0, - "t_step_stop": Nt, - "t_step_save": int(Nt / 20.0), - # Simulation Algorithm Parameters - "num_patches": 2, # change this to 3 for shocked state - "model_eqns": 3, - "alt_soundspeed": "F", - "hyperelasticity": "T", - "hyper_model": 1, - "fd_order": 4, - "num_fluids": 2, - "mpp_lim": "T", - "mixture_err": "T", - "time_stepper": 3, - "weno_order": 5, - "weno_eps": 1.0e-16, - "weno_Re_flux": "F", - "weno_avg": "F", - "mapped_weno": "T", - "null_weights": "F", - "mp_weno": "F", - "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, - # Formatted Database Files Structure Parameters - "format": 1, - "precision": 2, - "prim_vars_wrt": "T", - "parallel_io": "T", - # Patch 1: Background - "patch_icpp(1)%geometry": 3, - "patch_icpp(1)%x_centroid": 0.0, - "patch_icpp(1)%y_centroid": 0.0, - "patch_icpp(1)%length_x": 10 * leng, - "patch_icpp(1)%length_y": leng, - "patch_icpp(1)%vel(1)": 0, - "patch_icpp(1)%vel(2)": 0.0e00, - "patch_icpp(1)%pres": tilde_P_0, - "patch_icpp(1)%alpha_rho(1)": 1.0e0, - "patch_icpp(1)%alpha_rho(2)": 0.0e00, - "patch_icpp(1)%alpha(1)": 1.0e00, - "patch_icpp(1)%alpha(2)": 0.0e00, - # Patch 2: Shocked state - #'patch_icpp(2)%geometry' : 3, - #'patch_icpp(2)%alter_patch(1)' : 'T', - #'patch_icpp(2)%x_centroid' : -3*leng/8., - #'patch_icpp(2)%y_centroid' : 0., - #'patch_icpp(2)%length_x' : leng/4., - #'patch_icpp(2)%length_y' : leng, - #'patch_icpp(2)%vel(1)' : vel, - #'patch_icpp(2)%vel(2)' : 0.E+00, - #'patch_icpp(2)%pres' : ps, - #'patch_icpp(2)%alpha_rho(1)' : tilde_rho, - #'patch_icpp(2)%alpha_rho(2)' : 0.E+00, - #'patch_icpp(2)%alpha(1)' : 1.E+00, - #'patch_icpp(2)%alpha(2)' : 0.E+00, - # Patch 3: Bubble - "patch_icpp(2)%geometry": 2, - "patch_icpp(2)%x_centroid": 0.0e00, - "patch_icpp(2)%y_centroid": 0.0e00, - "patch_icpp(2)%radius": leng / 5, - "patch_icpp(2)%alter_patch(1)": "T", - "patch_icpp(2)%vel(1)": 0.0, - "patch_icpp(2)%vel(2)": 0.0e00, - "patch_icpp(2)%pres": tilde_P_0, - "patch_icpp(2)%alpha_rho(1)": 0.0e00, - "patch_icpp(2)%alpha_rho(2)": 9.82454806e-7, - "patch_icpp(2)%alpha(1)": 0.0e00, - "patch_icpp(2)%alpha(2)": 1.0e00, - #'patch_icpp(2)%hcid' : 302, - # Fluids Physical Parameters - "fluid_pp(1)%gamma": 1 / 1.09e0, # 1.E+00/(1.4E+00-1.E+00), - "fluid_pp(1)%pi_inf": Kt0_suc / (rho_0_suc * c_0 * c_0), # isothermal bulk modulus - "fluid_pp(2)%gamma": 1 / 0.4e0, # 1.E+00/(1.6666E+00-1.E+00), - "fluid_pp(2)%pi_inf": 0 * 6.747e-6, # 0.0 - "fluid_pp(1)%qv": 3.75e0, # K'_theta0 for sucrose - "fluid_pp(2)%qv": 2.0e0, # - "fluid_pp(1)%G": G_suc / (rho_0_suc * c_0 * c_0), # Shear modulus - "fluid_pp(2)%G": 1.0e-9, # Shear modulus of air taken to be a very small value - # 'fluid_pp(1)%einstein_cv(1)' : A_tilde, # Can be replaced with fluid_pp(:)%cv at some point - # 'fluid_pp(2)%einstein_cv(1)' : 0.026937087111210E0, # - # 'fluid_pp(1)%einstein_cv(2)' : theta_E_tilde, # Can be replaced with a scalar theta_E at some point - # 'fluid_pp(2)%einstein_cv(2)' : 100E0/298E0, #0.335E0, - # 'fluid_pp(1)%mg_a' : 1.E0, #a_mg - # 'fluid_pp(1)%mg_b' : 0.E0, #b_mg - # 'fluid_pp(2)%mg_a' : 0.E0, #a_mg - # 'fluid_pp(2)%mg_b' : 1.E0, #b_mg - # 'fluid_pp(1)%rho0' : 1.E0, #Non-dimensional initial density in Birch-Murnaghan cold curve - # 'fluid_pp(2)%rho0' : 9.82E-7, - # 'fluid_pp(1)%jcook(1)' : 0.0334, # A, Static yield strength - # 'fluid_pp(1)%jcook(2)' : 0.0334, # B, Strain-Hardening coefficient - # 'fluid_pp(1)%jcook(3)' : 0.1, # n, Strain-Hardening exponent - # 'fluid_pp(1)%jcook(4)' : 0.01, # C, Strain-rate hardening coefficient - # 'fluid_pp(1)%jcook(5)' : 0.45, # m, Thermal softening exponent - # 'fluid_pp(1)%jcook(6)' : 1.5403, # theta_m, Melt temperature at ambient pressure - # 'fluid_pp(1)%jcook(7)' : 1.0E7, # Limiting strain-rate - # 'fluid_pp(1)%jcook(8)' : 0.02, # Parameter in Simon-Glatzel melt relation - # 'fluid_pp(1)%jcook(9)' : 3.25, # exponent in Simon-Glatzel melt relation - # 'fluid_pp(1)%jcook(10)' : 3.2493E-7, # non-dimensional strain-rate limit - # 'fluid_pp(1)%jcook(11)' : 298, # Reference temperature - # 'fluid_pp(2)%jcook(1)' : 0.0334, # A, Static yield strength - # 'fluid_pp(2)%jcook(2)' : 0.0334, # B, Strain-Hardening coefficient - # 'fluid_pp(2)%jcook(3)' : 0.1, # n, Strain-Hardening exponent - # 'fluid_pp(2)%jcook(4)' : 0.01, # C, Strain-rate hardening coefficient - # 'fluid_pp(2)%jcook(5)' : 0.45, # m, Thermal softening exponent - # 'fluid_pp(2)%jcook(6)' : 1.5403, # theta_m, Melt temperature at ambient pressure - # 'fluid_pp(2)%jcook(7)' : 1.0E7, # Limiting strain-rate - # 'fluid_pp(2)%jcook(8)' : 0.02, # Parameter in Simon-Glatzel melt relation - # 'fluid_pp(2)%jcook(9)' : 3.25, # exponent in Simon-Glatzel melt relation - # 'fluid_pp(2)%jcook(10)' : 3.2493E-7, # non-dimensional strain-rate limitI - # 'fluid_pp(2)%jcook(11)' : 298/theta_0, # non-dimensionalized Reference temperature - } - ) -) diff --git a/examples/2D_sucrose_diff_units/case.py b/examples/2D_sucrose_diff_units/case.py deleted file mode 100644 index 54643358e..000000000 --- a/examples/2D_sucrose_diff_units/case.py +++ /dev/null @@ -1,201 +0,0 @@ -#!/usr/bin/env python3 -import math -import json -import numpy as np - -# import scipy as sc - -# Non-dimensional input file -# ps = 248758.567 -gam = 1.4 -rho = 1.0 -# c_l = math.sqrt( 1.4*ps/rho ) -c_l = 3.0776 # mm/us - -leng = 2.0 # mm -Ny = 768 -Nx = 1024 -dx = leng / Nx - -time_end = 0.001 # 5*leng/vel -cfl = 0.1 -# dt = 1.0E-12 -dt = cfl * dx / c_l -# Nt = int(time_end/dt) -Nt = 20000 -eps = 1e-6 - -# Material parameters of sucrose (dimensional) -Kt0_suc = 14.3e9 # Pa -Kt0_prime_suc = 3.75 # - -rho_0_suc = 1.5805e3 # kg/m^3 -einstein_cv1_suc = 3279 # J/Kg-K -einstein_cv2_suc = 1125 # K -G_suc = 8.58e9 # Pa -c_0 = 3077.6 # m/s -theta_0_suc = 298 # K -gamma_suc = 1.09 - -# Material parameters for air (dimensional) -Kt0_air = 1.013e5 # Pa -Kt0_prime_air = 2.00 # Pa -rho_0_air = 1.2 # kg/m^3 -theta_0_air = theta_0_suc -einstein_cv1_air = 718 # J/Kg-K -einstein_cv2_air = 100 # K -G_air = 0 # for now -gamma_air = 0.4 # n-1 - -# Initial condition -theta_0 = 310 # K -P_0 = 1.0040000406510039e-004 # GPa -compression_ratio = 1.2 # rho/rho_0 in the shocked region -rho_suc = 1580.5 # kg/m^3 -vel0 = 1.0e-6 # For seeding everything with some non-zero velocity - -# Shock EoS -# xi = 1.0-1.0/tilde_rho -# ps = tilde_P_0 + xi/pow(1-2.87*xi,2) #Need to fix the shock slope everywhere in the code -# vel = vel0 + math.sqrt((ps-tilde_P_0)*xi/rho_0_tilde) -# print('pressure=',ps*rho_0_suc*c_0*c_0*1.0E-9,'GPa') -# print('vel=',vel*c_0,'m/s') -vel = 0.2 # mm/us -Us = c_l + 1.104 * vel # mm/us -rho1 = 1.5805106 * Us / (Us - vel) # density -ps = P_0 + 1.5805106 * Us * vel # GPa - -# print(vel) -# print(Us) -# print(rho1) -# print(ps) -# Configuring case dictionary -print( - json.dumps( - { - # Logistics - "run_time_info": "T", - # Computational Domain Parameters - "x_domain%beg": -2 * leng, - "x_domain%end": 3 * leng, - "y_domain%beg": -1.5 * leng, - "y_domain%end": 1.5 * leng, - "stretch_x": "T", - "a_x": 20, - "x_a": -1 * leng, - "x_b": 2 * leng, - "stretch_y": "T", - "a_y": 20, - "y_a": -3 * leng / 4, - "y_b": 3 * leng / 4, - "m": int(Nx), - "n": int(Ny), - "p": 0, - #'dt' : dt, - #'t_step_start' : 0, - #'t_step_stop' : 9000, - #'t_step_save' : int(50), - "cfl_adap_dt": "T", - "cfl_target": 0.3, - "n_start": 0, - "t_save": 4.0e-02, - "t_stop": 4.0, - # Simulation Algorithm Parameters - "num_patches": 3, # change this to 3 for shocked state - "model_eqns": 5, - "alt_soundspeed": "F", - "hypoplasticity": "F", - "MGEoS_model": 1, - "num_fluids": 2, - "mpp_lim": "T", - "mixture_err": "F", - "time_stepper": 3, - "weno_order": 3, - "weno_eps": 1.0e-40, - "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, - # Formatted Database Files Structure Parameters - "format": 1, - "precision": 2, - "prim_vars_wrt": "T", - "parallel_io": "T", - "E_wrt": "T", - "c_wrt": "T", - "schlieren_wrt": "T", - "schlieren_alpha(1)": 1.00, - "schlieren_alpha(2)": 0.25, - "fd_order": 2, - # Patch 1: Background - "patch_icpp(1)%geometry": 3, - "patch_icpp(1)%x_centroid": 0.0, - "patch_icpp(1)%y_centroid": 0.0, - "patch_icpp(1)%length_x": 10 * leng, - "patch_icpp(1)%length_y": 10 * leng, - "patch_icpp(1)%vel(1)": 0.0, - "patch_icpp(1)%vel(2)": 0.0, - "patch_icpp(1)%pres": P_0, - "patch_icpp(1)%alpha_rho(1)": (1.0e00 - eps) * 1580.5106e-3, - "patch_icpp(1)%alpha_rho(2)": eps * 0.00116, - "patch_icpp(1)%alpha(1)": (1.0e00 - eps), - "patch_icpp(1)%alpha(2)": eps, - # Patch 2: Shocked state - "patch_icpp(2)%geometry": 3, - "patch_icpp(2)%alter_patch(1)": "T", - "patch_icpp(2)%x_centroid": -2.5625 * leng, - "patch_icpp(2)%y_centroid": 0.0, - "patch_icpp(2)%length_x": 4.0 * leng, - "patch_icpp(2)%length_y": 10 * leng, - "patch_icpp(2)%vel(1)": vel, - "patch_icpp(2)%vel(2)": 0.0, - "patch_icpp(2)%pres": ps, - "patch_icpp(2)%alpha_rho(1)": (1.0e0 - eps) * rho1, - "patch_icpp(2)%alpha_rho(2)": eps * 1.16e-3, - "patch_icpp(2)%alpha(1)": 1.0e00 - eps, - "patch_icpp(2)%alpha(2)": eps, - # Patch 3: Bubble - "patch_icpp(3)%geometry": 2, - "patch_icpp(3)%x_centroid": 0.0e00, - "patch_icpp(3)%y_centroid": 0.0e00, - "patch_icpp(3)%radius": leng / 2.0, - "patch_icpp(3)%alter_patch(1)": "T", - # 'patch_icpp(3)%smoothen' : 'T', - # 'patch_icpp(3)%smooth_coeff' : .25, - # 'patch_icpp(3)%smooth_patch_id' : 1, - "patch_icpp(3)%vel(1)": 0.0, - "patch_icpp(3)%vel(2)": 0.0, - "patch_icpp(3)%pres": P_0, - "patch_icpp(3)%alpha_rho(1)": eps * 1580.5106e-3, - "patch_icpp(3)%alpha_rho(2)": (1.0e0 - eps) * 1.16e-3, - "patch_icpp(3)%alpha(1)": eps, - "patch_icpp(3)%alpha(2)": 1.0e00 - eps, - # Fluids Physical Parameters - "fluid_pp(1)%gamma": 1.09, # Gruneisen constant - "fluid_pp(1)%pi_inf": 0.0, # p0 - "fluid_pp(1)%mg_a": 3077.6e-3, # c0 - "fluid_pp(1)%mg_b": 1.104, # s - "fluid_pp(1)%qv": 0.0, # e0 - "fluid_pp(1)%qvp": 1.0, # Gruneisen exponent - "fluid_pp(1)%rho0": 1580.5e-3, # reference density - "fluid_pp(1)%cv": 3000e-6, # specific heat capacity - "fluid_pp(2)%gamma": 0.4, # Gruneisen constant - "fluid_pp(2)%pi_inf": 0.0, # p0 - "fluid_pp(2)%mg_a": 0.0, # c0 - "fluid_pp(2)%mg_b": 0.0, # s - "fluid_pp(2)%qv": 0.0, # e0 - "fluid_pp(2)%qvp": 0.0, # Gruneisen exponent - "fluid_pp(2)%rho0": 1.16e-3, # reference density - "fluid_pp(2)%cv": 718e-6, # specific heat capacity - "fluid_pp(1)%jcook(11)": 298.0, - "fluid_pp(2)%jcook(11)": 0.0, - } - ) -) diff --git a/toolchain/mfc/test/cases.py b/toolchain/mfc/test/cases.py index 08da94e41..f2405298c 100644 --- a/toolchain/mfc/test/cases.py +++ b/toolchain/mfc/test/cases.py @@ -849,7 +849,7 @@ def foreach_example(): continue # List of currently broken examples -> currently attempting to fix! - brokenCases = ["2D_ibm_cfl_dt", "1D_sodHypo", "2D_viscous", "2D_laplace_pressure_jump", "2D_bubbly_steady_shock", "2D_advection", "2D_hardcodied_ic", "2D_ibm_multiphase", "2D_acoustic_broadband", "1D_inert_shocktube", "1D_reactive_shocktube", "2D_ibm_steady_shock", "3D_performance_test", "3D_ibm_stl_ellipsoid", "3D_sphbubcollapse", "2D_ibm_stl_wedge", "3D_ibm_stl_pyramid", "3D_ibm_bowshock", "3D_turb_mixing", "2D_mixing_artificial_Ma", "3D_lagrange_bubblescreen", "3D_hyper_bubingel", "3D_hyper_bubinwater", "2D_triple_point", "1D_hyper_impact_strong", "1D_hyper_impact_weak", "1D_hypo_impact_strong", "1D_hypo_impact_weak", "3D_hyper_prestress_bubinwater", "1D_hyper_2materials", "1D_hyper_sodshocktube", "2D_hyper_sucrosebubble" ] + brokenCases = ["2D_ibm_cfl_dt", "1D_sodHypo", "2D_viscous", "2D_laplace_pressure_jump", "2D_bubbly_steady_shock", "2D_advection", "2D_hardcodied_ic", "2D_ibm_multiphase", "2D_acoustic_broadband", "1D_inert_shocktube", "1D_reactive_shocktube", "2D_ibm_steady_shock", "3D_performance_test", "3D_ibm_stl_ellipsoid", "3D_sphbubcollapse", "2D_ibm_stl_wedge", "3D_ibm_stl_pyramid", "3D_ibm_bowshock", "3D_turb_mixing", "2D_mixing_artificial_Ma", "3D_lagrange_bubblescreen", "3D_hyper_bubingel", "3D_hyper_bubinwater", "2D_triple_point", "1D_hyper_impact_strong", "1D_hyper_impact_weak", "1D_hypo_impact_strong", "1D_hypo_impact_weak", "3D_hyper_prestress_bubinwater", "1D_hyper_2materials", "1D_hyper_sodshocktube" ] if path in brokenCases: continue name = f"{path.split('_')[0]} -> Example -> {'_'.join(path.split('_')[1:])}"