Skip to content

Commit c8fce8a

Browse files
committed
MUSCL Implemented
1 parent 45ff24a commit c8fce8a

File tree

25 files changed

+1415
-315
lines changed

25 files changed

+1415
-315
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
cmake_minimum_required(VERSION 3.20)
1010

11+
set(CMAKE_Fortran_STANDARD 2008)
1112

1213
# We include C as a language because - for some reason -
1314
# FIND_LIBRARY_USE_LIB64_PATHS is otherwise ignored.

examples/1D_bubblescreen/case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"mpp_lim": "F",
9494
"mixture_err": "F",
9595
"time_stepper": 3,
96+
"recon_type": 1,
9697
"weno_order": 5,
9798
"weno_eps": 1.0e-16,
9899
"weno_Re_flux": "F",
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/usr/bin/env python3
2+
import math
3+
import json
4+
5+
# Numerical setup
6+
Nx = 399
7+
dx = 1.0 / (1.0 * (Nx + 1))
8+
9+
Tend, Nt = 0.1, 1000
10+
mydt = Tend / (1.0 * Nt)
11+
12+
# Configuring case dictionary
13+
print(
14+
json.dumps(
15+
{
16+
# Logistics
17+
"run_time_info": "T",
18+
# Computational Domain Parameters
19+
"x_domain%beg": 0.0e00,
20+
"x_domain%end": 1.0e00,
21+
"m": Nx,
22+
"n": 0,
23+
"p": 0,
24+
"dt": mydt,
25+
"t_step_start": 0,
26+
"t_step_stop": int(Nt),
27+
"t_step_save": int(math.ceil(Nt / 10.0)),
28+
# Simulation Algorithm Parameters
29+
"num_patches": 2,
30+
"model_eqns": 2,
31+
"alt_soundspeed": "F",
32+
"num_fluids": 1,
33+
"mpp_lim": "F",
34+
"mixture_err": "F",
35+
"time_stepper": 3,
36+
"recon_type": 2,
37+
"muscl_order": 2,
38+
# "weno_order": 5,
39+
# "weno_eps": 1.0e-16,
40+
# "weno_Re_flux": "F",
41+
# "weno_avg": "F",
42+
# "mapped_weno": "T",
43+
"null_weights": "F",
44+
# "mp_weno": "F",
45+
"riemann_solver": 2,
46+
"wave_speeds": 1,
47+
"avg_state": 2,
48+
"bc_x%beg": -3,
49+
"bc_x%end": -3,
50+
# Formatted Database Files Structure Parameters
51+
"format": 1,
52+
"precision": 2,
53+
"prim_vars_wrt": "T",
54+
"parallel_io": "T",
55+
# Patch 1 L
56+
"patch_icpp(1)%geometry": 1,
57+
"patch_icpp(1)%x_centroid": 0.25,
58+
"patch_icpp(1)%length_x": 0.5,
59+
"patch_icpp(1)%vel(1)": 0.0,
60+
"patch_icpp(1)%pres": 1.0,
61+
"patch_icpp(1)%alpha_rho(1)": 1.0e00,
62+
"patch_icpp(1)%alpha(1)": 1.0,
63+
# Patch 2 R
64+
"patch_icpp(2)%geometry": 1,
65+
"patch_icpp(2)%x_centroid": 0.75,
66+
"patch_icpp(2)%length_x": 0.5,
67+
"patch_icpp(2)%vel(1)": 0.0,
68+
"patch_icpp(2)%pres": 0.1,
69+
"patch_icpp(2)%alpha_rho(1)": 0.125e00,
70+
"patch_icpp(2)%alpha(1)": 1.0,
71+
# Fluids Physical Parameters
72+
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),
73+
"fluid_pp(1)%pi_inf": 0.0,
74+
}
75+
)
76+
)
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/bin/env python3
2+
import json
3+
4+
# Configuring case dictionary
5+
print(
6+
json.dumps(
7+
{
8+
# Logistics
9+
"run_time_info": "T",
10+
# Computational Domain Parameters
11+
"x_domain%beg": 0.0e00,
12+
"x_domain%end": 1.0e00,
13+
"y_domain%beg": 0.0e00,
14+
"y_domain%end": 1.0e00,
15+
"m": 99,
16+
"n": 99,
17+
"p": 0,
18+
"dt": 5.0e-07,
19+
"t_step_start": 0,
20+
"t_step_stop": 1000,
21+
"t_step_save": 100,
22+
# Simulation Algorithm Parameters
23+
"num_patches": 2,
24+
"model_eqns": 3,
25+
"alt_soundspeed": "F",
26+
"num_fluids": 2,
27+
"mpp_lim": "T",
28+
"mixture_err": "T",
29+
"time_stepper": 3,
30+
"recon_type": 2,
31+
"muscl_order": 2,
32+
#"weno_order": 5,
33+
#"weno_eps": 1.0e-16,
34+
#"weno_Re_flux": "F",
35+
#"weno_avg": "F",
36+
#"mapped_weno": "T",
37+
"null_weights": "F",
38+
#"mp_weno": "F",
39+
"riemann_solver": 2,
40+
"wave_speeds": 1,
41+
"avg_state": 2,
42+
"bc_x%beg": -3,
43+
"bc_x%end": -3,
44+
"bc_y%beg": -3,
45+
"bc_y%end": -3,
46+
# Formatted Database Files Structure Parameters
47+
"format": 1,
48+
"precision": 2,
49+
"prim_vars_wrt": "T",
50+
"parallel_io": "T",
51+
# Patch 1: Base
52+
"patch_icpp(1)%geometry": 3,
53+
"patch_icpp(1)%x_centroid": 0.5e00,
54+
"patch_icpp(1)%y_centroid": 0.5e00,
55+
"patch_icpp(1)%length_x": 1.0e00,
56+
"patch_icpp(1)%length_y": 1.0e00,
57+
"patch_icpp(1)%vel(1)": 100.0e00,
58+
"patch_icpp(1)%vel(2)": 100.0e00,
59+
"patch_icpp(1)%pres": 1.0e05,
60+
"patch_icpp(1)%alpha_rho(1)": 1000.0e00,
61+
"patch_icpp(1)%alpha_rho(2)": 1.0,
62+
"patch_icpp(1)%alpha(1)": 1.0e-12,
63+
"patch_icpp(1)%alpha(2)": 1.0 - 1.0e-12,
64+
# Patch 2: Density to transport
65+
"patch_icpp(2)%geometry": 2,
66+
"patch_icpp(2)%smoothen": "T",
67+
"patch_icpp(2)%smooth_patch_id": 1,
68+
"patch_icpp(2)%smooth_coeff": 0.5e00,
69+
"patch_icpp(2)%x_centroid": 0.1e00,
70+
"patch_icpp(2)%y_centroid": 0.1e00,
71+
"patch_icpp(2)%radius": 0.1e00,
72+
"patch_icpp(2)%alter_patch(1)": "T",
73+
"patch_icpp(2)%vel(1)": 100.0e00,
74+
"patch_icpp(2)%vel(2)": 100.0e00,
75+
"patch_icpp(2)%pres": 1.0e05,
76+
"patch_icpp(2)%alpha_rho(1)": 1.0,
77+
"patch_icpp(2)%alpha_rho(2)": 1.0,
78+
"patch_icpp(2)%alpha(1)": 0,
79+
"patch_icpp(2)%alpha(2)": 1.0,
80+
# Fluids Physical Parameters
81+
"fluid_pp(1)%gamma": 1.0e00 / (2.35e00 - 1.0e00),
82+
"fluid_pp(1)%pi_inf": 2.35e00 * 1.0e09 / (2.35e00 - 1.0e00),
83+
"fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
84+
"fluid_pp(2)%pi_inf": 0.0e00,
85+
}
86+
)
87+
)

src/common/m_checker_common.fpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ contains
4949
call s_check_inputs_phase_change
5050
call s_check_inputs_ibm
5151
#endif
52-
call s_check_inputs_weno
52+
! if (recon_type == WENO_TYPE) then
53+
! call s_check_inputs_weno
54+
! elseif (recon_type == MUSCL_TYPE) then
55+
! TODO
56+
! end if
5357
call s_check_inputs_surface_tension
5458
call s_check_inputs_mhd
5559
end if

src/common/m_constants.fpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ module m_constants
3535
real(wp), parameter :: broadband_spectral_level_constant = 20._wp !< The constant to scale the spectral level at the lower frequency bound
3636
real(wp), parameter :: broadband_spectral_level_growth_rate = 10._wp !< The spectral level constant to correct the magnitude at each frqeuency to ensure the source is overall broadband
3737

38+
! Reconstruction Types
39+
integer, parameter :: WENO_TYPE = 1 !< Using WENO for reconstruction type
40+
integer, parameter :: MUSCL_TYPE = 2 !< Using MUSCL for reconstruction type
41+
3842
! Chemistry
3943
real(wp), parameter :: dflt_T_guess = 1200._wp ! Default guess for temperature (when a previous value is not available)
4044

src/common/m_helper_basic.fpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,9 @@ contains
110110
res = f_approx_equal(var, real(nint(var), wp))
111111
end function f_is_integer
112112

113-
pure subroutine s_configure_coordinate_bounds(weno_polyn, buff_size, idwint, idwbuff, &
113+
pure subroutine s_configure_coordinate_bounds(recon_type, weno_polyn, muscl_polyn, buff_size, idwint, idwbuff, &
114114
viscous, bubbles_lagrange, m, n, p, num_dims, igr)
115-
116-
integer, intent(in) :: weno_polyn, m, n, p, num_dims
115+
integer, intent(in) :: recon_type, weno_polyn, muscl_polyn, m, n, p, num_dims
117116
integer, intent(inout) :: buff_size
118117
type(int_bounds_info), dimension(3), intent(inout) :: idwint, idwbuff
119118
logical, intent(in) :: viscous, bubbles_lagrange
@@ -130,11 +129,14 @@ contains
130129
buff_size = 4
131130
end if
132131
else
132+
if (recon_type == WENO_TYPE) then
133133
if (viscous) then
134134
buff_size = 2*weno_polyn + 2
135135
else
136136
buff_size = weno_polyn + 2
137137
end if
138+
elseif (recon_type == MUSCL_TYPE) then
139+
buff_size = muscl_polyn + 2
138140
end if
139141

140142
! Correction for smearing function in the lagrangian subgrid bubble model

src/pre_process/m_global_parameters.fpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,16 @@ module m_global_parameters
8181
integer :: model_eqns !< Multicomponent flow model
8282
logical :: relax !< activate phase change
8383
integer :: relax_model !< Relax Model
84-
real(wp) :: palpha_eps !< trigger parameter for the p relaxation procedure, phase change model
85-
real(wp) :: ptgalpha_eps !< trigger parameter for the pTg relaxation procedure, phase change model
84+
real(wp) :: palpha_eps !< trigger parameter for the p relaxation procedure, phase change model
85+
real(wp) :: ptgalpha_eps !< trigger parameter for the pTg relaxation procedure, phase change model
8686
integer :: num_fluids !< Number of different fluids present in the flow
8787
logical :: mpp_lim !< Alpha limiter
8888
integer :: sys_size !< Number of unknowns in the system of equations
89-
integer :: weno_polyn !< Degree of the WENO polynomials (polyn)
89+
integer :: recon_type !< Reconstruction Type
90+
integer :: weno_polyn !< Degree of the WENO polynomials (polyn)
91+
integer :: muscl_polyn !< Degree of the MUSCL polynomials (polyn)
9092
integer :: weno_order !< Order of accuracy for the WENO reconstruction
93+
integer :: muscl_order !< Order of accuracy for the MUSCL reconstruction
9194
logical :: hypoelasticity !< activate hypoelasticity
9295
logical :: hyperelasticity !< activate hyperelasticity
9396
logical :: elasticity !< elasticity modeling, true for hyper or hypo
@@ -344,9 +347,11 @@ contains
344347
palpha_eps = dflt_real
345348
ptgalpha_eps = dflt_real
346349
num_fluids = dflt_int
350+
recon_type = WENO_TYPE
347351
weno_order = dflt_int
348352
igr = .false.
349353
igr_order = dflt_int
354+
muscl_order = dflt_int
350355

351356
hypoelasticity = .false.
352357
hyperelasticity = .false.
@@ -562,7 +567,11 @@ contains
562567

563568
integer :: i, j, fac
564569

565-
weno_polyn = (weno_order - 1)/2
570+
if (recon_type == WENO_TYPE) then
571+
weno_polyn = (weno_order - 1)/2
572+
elseif (recon_type == MUSCL_TYPE) then
573+
muscl_polyn = muscl_order
574+
end if
566575

567576
! Determining the layout of the state vectors and overall size of
568577
! the system of equations, given the dimensionality and choice of
@@ -872,7 +881,7 @@ contains
872881
chemxb = species_idx%beg
873882
chemxe = species_idx%end
874883

875-
call s_configure_coordinate_bounds(weno_polyn, buff_size, &
884+
call s_configure_coordinate_bounds(recon_type, weno_polyn, muscl_polyn, buff_size, &
876885
idwint, idwbuff, viscous, &
877886
bubbles_lagrange, m, n, p, &
878887
num_dims, igr)

src/pre_process/m_mpi_proxy.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ contains
4646
& 'weno_order', 'precision', 'perturb_flow_fluid', &
4747
& 'perturb_sph_fluid', 'num_patches', 'thermal', 'nb', 'dist_type',&
4848
& 'R0_type', 'relax_model', 'num_ibs', 'n_start', 'elliptic_smoothing_iters', &
49-
& 'num_bc_patches', 'mixlayer_perturb_nk' ]
49+
& 'num_bc_patches', 'mixlayer_perturb_nk', 'recon_type' ]
5050
call MPI_BCAST(${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
5151
#:endfor
5252

src/pre_process/m_start_up.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ contains
149149
n_start_old, surface_tension, hyperelasticity, pre_stress, &
150150
elliptic_smoothing, elliptic_smoothing_iters, &
151151
viscous, bubbles_lagrange, bc_x, bc_y, bc_z, num_bc_patches, &
152-
patch_bc, Bx0, relativity, cont_damage, igr, igr_order
152+
patch_bc, Bx0, relativity, cont_damage, igr, igr_order, &
153+
recon_type, muscl_order
153154

154155
! Inquiring the status of the pre_process.inp file
155156
file_loc = 'pre_process.inp'

0 commit comments

Comments
 (0)