Skip to content

Commit 8def9a9

Browse files
committed
MUSCL Implemented
1 parent 1e74a60 commit 8def9a9

File tree

25 files changed

+1433
-311
lines changed

25 files changed

+1433
-311
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
@@ -47,7 +47,11 @@ contains
4747
! Run by all three stages
4848
call s_check_inputs_simulation_domain
4949
call s_check_inputs_model_eqns_and_num_fluids
50-
call s_check_inputs_weno
50+
! if (recon_type == WENO_TYPE) then
51+
! call s_check_inputs_weno
52+
! elseif (recon_type == MUSCL_TYPE) then
53+
! TODO
54+
! end if
5155
call s_check_inputs_bc
5256
call s_check_inputs_stiffened_eos
5357
call s_check_inputs_surface_tension

src/common/m_constants.fpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ module m_constants
3232
real(wp), parameter :: broadband_spectral_level_constant = 20._wp !< The constant to scale the spectral level at the lower frequency bound
3333
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
3434

35+
! Reconstruction Types
36+
integer, parameter :: WENO_TYPE = 1 !< Using WENO for reconstruction type
37+
integer, parameter :: MUSCL_TYPE = 2 !< Using MUSCL for reconstruction type
38+
3539
! Chemistry
3640
real(wp), parameter :: dflt_T_guess = 1200._wp ! Default guess for temperature (when a previous value is not available)
3741

src/common/m_helper_basic.f90

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,9 @@ logical pure elemental function f_is_integer(var) result(res)
107107
res = f_approx_equal(var, real(nint(var), wp))
108108
end function f_is_integer
109109

110-
pure subroutine s_configure_coordinate_bounds(weno_polyn, buff_size, idwint, idwbuff, &
110+
pure subroutine s_configure_coordinate_bounds(recon_type, weno_polyn, buff_size, idwint, idwbuff, &
111111
viscous, bubbles_lagrange, m, n, p, num_dims)
112-
113-
integer, intent(in) :: weno_polyn, m, n, p, num_dims
112+
integer, intent(in) :: recon_type, weno_polyn, muscl_polyn, m, n, p, num_dims
114113
integer, intent(inout) :: buff_size
115114
type(int_bounds_info), dimension(3), intent(inout) :: idwint, idwbuff
116115
logical, intent(in) :: viscous, bubbles_lagrange
@@ -119,10 +118,14 @@ pure subroutine s_configure_coordinate_bounds(weno_polyn, buff_size, idwint, idw
119118
! sufficient boundary conditions data as to iterate the solution in
120119
! the physical computational domain from one time-step iteration to
121120
! the next one
122-
if (viscous) then
123-
buff_size = 2*weno_polyn + 2
124-
else
125-
buff_size = weno_polyn + 2
121+
if (recon_type == WENO_TYPE) then
122+
if (viscous) then
123+
buff_size = 2*weno_polyn + 2
124+
else
125+
buff_size = weno_polyn + 2
126+
end if
127+
elseif (recon_type == MUSCL_TYPE) then
128+
buff_size = muscl_polyn + 2
126129
end if
127130

128131
! 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
@@ -78,13 +78,16 @@ module m_global_parameters
7878
integer :: model_eqns !< Multicomponent flow model
7979
logical :: relax !< activate phase change
8080
integer :: relax_model !< Relax Model
81-
real(wp) :: palpha_eps !< trigger parameter for the p relaxation procedure, phase change model
82-
real(wp) :: ptgalpha_eps !< trigger parameter for the pTg relaxation procedure, phase change model
81+
real(wp) :: palpha_eps !< trigger parameter for the p relaxation procedure, phase change model
82+
real(wp) :: ptgalpha_eps !< trigger parameter for the pTg relaxation procedure, phase change model
8383
integer :: num_fluids !< Number of different fluids present in the flow
8484
logical :: mpp_lim !< Alpha limiter
8585
integer :: sys_size !< Number of unknowns in the system of equations
86-
integer :: weno_polyn !< Degree of the WENO polynomials (polyn)
86+
integer :: recon_type !< Reconstruction Type
87+
integer :: weno_polyn !< Degree of the WENO polynomials (polyn)
88+
integer :: muscl_polyn !< Degree of the MUSCL polynomials (polyn)
8789
integer :: weno_order !< Order of accuracy for the WENO reconstruction
90+
integer :: muscl_order !< Order of accuracy for the MUSCL reconstruction
8891
logical :: hypoelasticity !< activate hypoelasticity
8992
logical :: hyperelasticity !< activate hyperelasticity
9093
logical :: elasticity !< elasticity modeling, true for hyper or hypo
@@ -339,7 +342,9 @@ contains
339342
palpha_eps = dflt_real
340343
ptgalpha_eps = dflt_real
341344
num_fluids = dflt_int
345+
recon_type = WENO_TYPE
342346
weno_order = dflt_int
347+
muscl_order = dflt_int
343348

344349
hypoelasticity = .false.
345350
hyperelasticity = .false.
@@ -555,7 +560,11 @@ contains
555560

556561
integer :: i, j, fac
557562

558-
weno_polyn = (weno_order - 1)/2
563+
if (recon_type == WENO_TYPE) then
564+
weno_polyn = (weno_order - 1)/2
565+
elseif (recon_type == MUSCL_TYPE) then
566+
muscl_polyn = muscl_order
567+
end if
559568

560569
! Determining the layout of the state vectors and overall size of
561570
! the system of equations, given the dimensionality and choice of
@@ -857,7 +866,7 @@ contains
857866
chemxb = species_idx%beg
858867
chemxe = species_idx%end
859868

860-
call s_configure_coordinate_bounds(weno_polyn, buff_size, &
869+
call s_configure_coordinate_bounds(recon_type, weno_polyn, muscl_polyn, buff_size, &
861870
idwint, idwbuff, viscous, &
862871
bubbles_lagrange, m, n, p, &
863872
num_dims)

src/pre_process/m_mpi_proxy.fpp

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

src/pre_process/m_start_up.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ 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
152+
patch_bc, Bx0, relativity, cont_damage, recon_type, muscl_order
153153

154154
! Inquiring the status of the pre_process.inp file
155155
file_loc = 'pre_process.inp'

0 commit comments

Comments
 (0)