Skip to content

Commit

Permalink
fix hyper_model & examples (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisZYJ authored Jan 20, 2025
2 parents 4a63dc2 + 517ecb5 commit f964392
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 16 deletions.
2 changes: 2 additions & 0 deletions examples/1D_hyper_impact_strong/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#'bc_y%end' : -3,
# Turning on Hypoelasticity
"hyperelasticity": "T",
"hyper_model": 1,
"fd_order": 4,
# Formatted Database Files Structure Parameters
"format": 1,
"precision": 2,
Expand Down
12 changes: 2 additions & 10 deletions examples/1D_hyper_impact_weak/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# Computational Domain Parameters
"x_domain%beg": 0.0e00,
"x_domain%end": 1.0e00,
"y_domain%beg": 0.0e00,
"y_domain%end": 0.002,
"m": Nx,
"n": 0,
"p": 0,
Expand Down Expand Up @@ -48,10 +46,10 @@
"avg_state": 2,
"bc_x%beg": -3,
"bc_x%end": -3,
"bc_y%beg": -3,
"bc_y%end": -3,
# Turning on Hyperelasticity
"hyperelasticity": "T",
"hyper_model": 1,
"fd_order": 4,
# Formatted Database Files Structure Parameters
"format": 1,
"precision": 2,
Expand All @@ -60,23 +58,17 @@
# Patch 1 L
"patch_icpp(1)%geometry": 1,
"patch_icpp(1)%x_centroid": 0.25,
"patch_icpp(1)%y_centroid": 0.001,
"patch_icpp(1)%length_x": 0.5,
"patch_icpp(1)%length_y": 0.002,
"patch_icpp(1)%vel(1)": 10,
"patch_icpp(1)%vel(2)": 0,
"patch_icpp(1)%pres": 1.0e5,
"patch_icpp(1)%alpha_rho(1)": 1000,
"patch_icpp(1)%alpha(1)": 1.0,
"patch_icpp(1)%tau_e(1)": 0.0,
# Patch 2 R
"patch_icpp(2)%geometry": 1,
"patch_icpp(2)%x_centroid": 0.75,
"patch_icpp(2)%y_centroid": 0.001,
"patch_icpp(2)%length_x": 0.5,
"patch_icpp(2)%length_y": 0.002,
"patch_icpp(2)%vel(1)": -10, # 10,
"patch_icpp(2)%vel(2)": 0,
"patch_icpp(2)%pres": 1.0e05,
"patch_icpp(2)%alpha_rho(1)": 1000,
"patch_icpp(2)%alpha(1)": 1.0,
Expand Down
1 change: 1 addition & 0 deletions examples/1D_hypo_impact_strong/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#'bc_y%end' : -3,
# Turning on Hypoelasticity
"hypoelasticity": "T",
"fd_order": 4,
# Formatted Database Files Structure Parameters
"format": 1,
"precision": 2,
Expand Down
1 change: 1 addition & 0 deletions examples/1D_hypo_impact_weak/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"bc_x%end": -3,
# Turning on Hypoelasticity
"hypoelasticity": "T",
"fd_order": 4,
# Formatted Database Files Structure Parameters
"format": 1,
"precision": 2,
Expand Down
2 changes: 1 addition & 1 deletion src/common/m_variables_conversion.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ contains
end if

#ifdef MFC_POST_PROCESS
if (hyperelasticity) then
if (hyperelasticity .and. p /= 0) then
! to save von Mises stress instead of elastic internal energy
qK_prim_vf(xiend + 1)%sf(j, k, l) = sqrt((3_wp/2_wp)*(qK_prim_vf(strxb)%sf(j, k, l)**2_wp + &
2_wp*qK_prim_vf(strxb + 1)%sf(j, k, l)**2_wp + qK_prim_vf(strxb + 2)%sf(j, k, l)**2_wp + &
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_checker.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ contains
!> Checks constraints on elasticity parameters
subroutine s_check_inputs_elasticity
@:PROHIBIT(hyperelasticity .and. hyper_model == dflt_int)
@:PROHIBIT(elasticity .and. fd_order /= 4)
@:PROHIBIT((hypoelasticity .or. hyperelasticity) .and. fd_order /= 4)
end subroutine
!> Checks constraints on bubble parameters
Expand Down
4 changes: 2 additions & 2 deletions src/simulation/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ contains
& 'wave_speeds', 'avg_state', 'precision', 'bc_x%beg', 'bc_x%end', &
& 'bc_y%beg', 'bc_y%end', 'bc_z%beg', 'bc_z%end', 'fd_order', &
& 'num_probes', 'num_integrals', 'bubble_model', 'thermal', &
& 'R0_type', 'num_source', 'relax_model', 'num_ibs', 'n_start' ]
& 'R0_type', 'num_source', 'relax_model', 'hyper_model', 'num_ibs', 'n_start' ]
call MPI_BCAST(${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
#:endfor
Expand All @@ -195,7 +195,7 @@ contains
& 'bc_z%grcbc_in', 'bc_z%grcbc_out', 'bc_z%grcbc_vel_out', &
& 'cfl_adap_dt', 'cfl_const_dt', 'cfl_dt', 'surface_tension', &
& 'viscous', 'shear_stress', 'bulk_stress', 'bubbles_lagrange', &
& 'hyperelasticity', 'hyper_model', 'rkck_adap_dt' ]
& 'hyperelasticity', 'rkck_adap_dt' ]
call MPI_BCAST(${VAR}$, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
#:endfor
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ contains
g_x, g_y, g_z, n_start, t_save, t_stop, &
cfl_adap_dt, cfl_const_dt, cfl_target, &
viscous, surface_tension, &
hyperelasticity, R0ref, &
hyperelasticity, hyper_model, R0ref, &
bubbles_lagrange, lag_params, &
rkck_adap_dt, rkck_tolerance

Expand Down
2 changes: 1 addition & 1 deletion toolchain/mfc/run/case_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def analytic(self):
'low_Mach': ParamType.INT,
'surface_tension': ParamType.LOG,
'viscous': ParamType.LOG,
'hypermodel': ParamType.INT,
'hyper_model': ParamType.INT,
'bubbles_lagrange': ParamType.LOG,
'rkck_tolerance': ParamType.REAL,
})
Expand Down

0 comments on commit f964392

Please sign in to comment.