Skip to content

Commit 5452db0

Browse files
committed
Merge MUSCL_fix branch + upstream master (4 commits)
2 parents 31925f5 + 1f681f2 commit 5452db0

71 files changed

Lines changed: 4396 additions & 215 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ exit 0
636636
target_compile_options(${a_target} PRIVATE -fopenmp)
637637
target_link_options(${a_target} PRIVATE -fopenmp)
638638
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
639-
target_compile_options(${a_target} PRIVATE -fopenmp --offload-arch=gfx90a)
639+
target_compile_options(${a_target} PRIVATE -fopenmp --offload-arch=gfx90a -fopenmp-target-fast -fopenmp-assume-threads-oversubscription -fopenmp-assume-teams-oversubscription)
640640
target_link_options(${a_target} PRIVATE -fopenmp --offload-arch=gfx90a)
641641
endif()
642642
endif()
@@ -1026,4 +1026,4 @@ site_name(SITE_NAME)
10261026

10271027
configure_file(
10281028
"${CMAKE_CURRENT_SOURCE_DIR}/toolchain/cmake/configuration.cmake.in"
1029-
"${CMAKE_CURRENT_BINARY_DIR}/configuration.txt")
1029+
"${CMAKE_CURRENT_BINARY_DIR}/configuration.txt")

docs/documentation/case.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ See @ref equations "Equations" for the mathematical models these parameters cont
445445
| `mp_weno` | Logical | Monotonicity preserving WENO |
446446
| `muscl_order` | Integer | MUSCL order [1,2] |
447447
| `muscl_lim` | Integer | MUSCL Slope Limiter: [1] minmod; [2] monotonized central; [3] Van Albada; [4] Van Leer; [5] SUPERBEE |
448+
| `muscl_eps` | Real | MUSCL limiter slope-product threshold (default: hard-coded thresholds; set to 0 for textbook behavior) |
448449
| `flux_lim` | Integer | Flux limiter for post-process: [1] minmod; [2] MUSCL; [3] OSPRE; [4] SUPERBEE |
449450
| `int_comp` | Logical | THINC Interface Compression |
450451
| `ic_eps` | Real | Interface compression threshold (default: 1e-4) |
@@ -546,6 +547,10 @@ It is recommended to set `weno_eps` to $10^{-6}$ for WENO-JS, and to $10^{-40}$
546547
- `muscl_lim` specifies the slope limiter that is used in 2nd order MUSCL Reconstruction by an integer from 1 through 5.
547548
`muscl_lim = 1`, `2`, `3`, `4`, and `5` correspond to minmod, monotonized central, Van Albada, Van Leer, and SUPERBEE, respectively.
548549

550+
- `muscl_eps` controls the slope-product activation threshold for all MUSCL limiters.
551+
When not set (default), the threshold is 1e-9 for minmod/MC, and 1e-6 for others.
552+
Setting `muscl_eps = 0` gives textbook limiter behavior where limiters activate whenever both slopes have the same sign.
553+
549554
- `int_comp` activates interface compression using THINC used in MUSCL Reconstruction, with control parameters (`ic_eps`, and `ic_beta`).
550555

551556
- `riemann_solver` specifies the choice of the Riemann solver that is used in simulation by an integer from 1 through 4.
@@ -1081,8 +1086,20 @@ When ``cyl_coord = 'T'`` is set in 2D the following constraints must be met:
10811086

10821087
- `cantera_file` specifies the chemical mechanism file. If the file is part of the standard Cantera library, only the filename is required. Otherwise, the file must be located in the same directory as your `case.py` file
10831088

1089+
### 18. Chemistry-Specific Boundary Conditions
1090+
1091+
| Parameter | Type | Description |
1092+
| ---: | :----: | :--- |
1093+
| `bc_[x,y,z]%%isothermal_in` | Logical | Enable isothermal wall at the domain entrance (minimum coordinate). |
1094+
| `bc_[x,y,z]%%isothermal_out` | Logical | Enable isothermal wall at the domain exit (maximum coordinate). |
1095+
| `bc_[x,y,z]%%Twall_in` | Real | Temperature [K] of the entrance isothermal wall. |
1096+
| `bc_[x,y,z]%%Twall_out` | Real | Temperature [K] of the exit isothermal wall. |
1097+
1098+
This boundary condition can be used for fixed-temperature (isothermal) walls at the domain extremities. It is exclusively available for reacting flows and requires chemistry to be enabled. It properly evaluates heat and species fluxes at the interface when ``chemistry = 'T'``, ``chem_params%%diffusion = 'T'``, and the corresponding domain boundary is set to a slip wall (`bc_[x,y,z]%%[beg,end]` = -15) or a no-slip wall (`bc_[x,y,z]%%[beg,end]` = -16).
1099+
1100+
10841101

1085-
### 18. GPU Performance (NVIDIA UVM)
1102+
### 19. GPU Performance (NVIDIA UVM)
10861103

10871104
| Parameter | Type | Description |
10881105
| ---: | :---: | :--- |
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 json
3+
import math
4+
5+
import cantera as ct
6+
7+
Lx = 0.05
8+
Ly = 0.05
9+
10+
ctfile = "h2o2.yaml"
11+
sol_L = ct.Solution(ctfile)
12+
sol_L.TPY = 1125, ct.one_atm, "O2:0.21,N2:0.79"
13+
# Configuring case dictionary
14+
case = {
15+
"run_time_info": "T",
16+
"x_domain%beg": 0.0,
17+
"x_domain%end": Lx,
18+
"y_domain%beg": 0.0,
19+
"y_domain%end": Ly,
20+
"m": 699,
21+
"n": 699,
22+
"p": 0,
23+
"dt": 4.0e-08,
24+
"t_step_start": 0,
25+
"t_step_stop": 75000,
26+
"t_step_save": 4500,
27+
"num_patches": 1,
28+
"model_eqns": 2,
29+
"alt_soundspeed": "F",
30+
"num_fluids": 1,
31+
"mpp_lim": "F",
32+
"mixture_err": "T",
33+
"time_stepper": 3,
34+
"mp_weno": "F",
35+
"weno_order": 5,
36+
"weno_eps": 1e-16,
37+
"riemann_solver": 2,
38+
"wave_speeds": 1,
39+
"avg_state": 2,
40+
"bc_x%beg": -7,
41+
"bc_x%end": -3,
42+
"bc_y%beg": -16,
43+
"bc_y%end": -3,
44+
"bc_y%isothermal_in": "T",
45+
"bc_y%Twall_in": 600.0,
46+
"format": 1,
47+
"precision": 2,
48+
"prim_vars_wrt": "T",
49+
"parallel_io": "T",
50+
"chemistry": "T",
51+
"chem_params%diffusion": "T",
52+
"chem_params%reactions": "F",
53+
"cantera_file": ctfile,
54+
"chem_wrt_T": "T",
55+
"patch_icpp(1)%geometry": 3,
56+
"patch_icpp(1)%hcid": 291,
57+
"patch_icpp(1)%x_centroid": Lx / 2,
58+
"patch_icpp(1)%y_centroid": Ly / 2,
59+
"patch_icpp(1)%length_x": Lx,
60+
"patch_icpp(1)%length_y": Ly,
61+
"patch_icpp(1)%vel(1)": 0,
62+
"patch_icpp(1)%vel(2)": 0,
63+
"patch_icpp(1)%pres": 101325,
64+
"patch_icpp(1)%alpha_rho(1)": 1.00,
65+
"patch_icpp(1)%alpha(1)": 1,
66+
"fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
67+
"fluid_pp(1)%pi_inf": 0.0e00,
68+
"viscous": "T",
69+
"fluid_pp(1)%Re(1)": 100000,
70+
}
71+
for i in range(len(sol_L.Y)):
72+
case[f"chem_wrt_Y({i + 1})"] = "T"
73+
case[f"patch_icpp(1)%Y({i + 1})"] = sol_L.Y[i]
74+
75+
if __name__ == "__main__":
76+
print(json.dumps(case))

src/common/include/1dHardcodedIC.fpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@
5151
molar_mass_inv = y1/31.998_wp + y2/18.01508_wp + y3/16.04256_wp + y4/28.0134_wp
5252

5353
q_prim_vf(eqn_idx%cont%beg)%sf(i, 0, 0) = 1.01325_wp*(10.0_wp)**5/(temp*8.3144626_wp*1000.0_wp*molar_mass_inv)
54+
55+
case(191) ! 1D Dual Isothermal case
56+
57+
q_prim_vf(eqn_idx%E)%sf(i, 0, 0) = 101325.0_wp
58+
q_prim_vf(eqn_idx%mom%beg)%sf(i, 0, 0) = 0.0_wp
59+
q_prim_vf(eqn_idx%species%beg)%sf(i, 0, 0) = 1.0_wp
60+
61+
if (x_cc(i) <= 0.025_wp) then
62+
temp = 700.0_wp + ((1000.0_wp - 700.0_wp)/0.025_wp)*x_cc(i)
63+
else
64+
temp = 1200.0_wp + ((900.0_wp - 1000.0_wp)/0.025_wp)*(x_cc(i) - 0.025_wp)
65+
end if
66+
67+
molar_mass_inv = 1.0_wp/2.01588_wp
68+
q_prim_vf(eqn_idx%cont%beg)%sf(i, 0, 0) = 101325.0_wp/(temp*8.3144626_wp*1000.0_wp*molar_mass_inv)
5469
case default
5570
call s_int_to_str(patch_id, iStr)
5671
call s_mpi_abort("Invalid hcid specified for patch " // trim(iStr))

src/common/include/2dHardcodedIC.fpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
88
real(wp) :: sinA, cosA
99
real(wp) :: r_sq
1010

11+
! # 291 - Shear/Thermal Layer Case
12+
real(wp) :: delta_shear, u_max, u_mean
13+
real(wp) :: T_wall, T_inf, P_atm, T_loc
14+
real(wp) :: delta_th, R_mix
15+
real(wp) :: Y_N2, Y_O2, MW_N2, MW_O2
16+
real(wp) :: bottom_blend_u, bottom_blend_T
17+
1118
! # 207
1219
real(wp) :: sigma, gauss1, gauss2
20+
1321
! # 208
1422
real(wp) :: ei, d, fsm, alpha_air, alpha_sf6
1523

@@ -305,6 +313,32 @@
305313
q_prim_vf(eqn_idx%mom%beg + 1)%sf(i, j, &
306314
& 0) = 112.99092883944267*((0.1/0.3))*x_cc(i)*exp(0.5*(1 - sqrt(x_cc(i)**2 + y_cc(j)**2)))
307315
end if
316+
case (291) ! Isothermal Flat Plate
317+
T_inf = 1125.0_wp
318+
T_wall = 600.0_wp
319+
P_atm = 101325.0_wp
320+
321+
! Boundary/Shear Layer thicknesses
322+
delta_th = 0.0003_wp ! Thermal BL thickness
323+
delta_shear = 8e-3_wp ! Velocity BL thickness
324+
325+
u_max = 50.0_wp ! Freestream Velocity (m/s)
326+
327+
MW_N2 = 28.0134e-3_wp
328+
MW_O2 = 31.999e-3_wp
329+
Y_N2 = 0.767_wp
330+
Y_O2 = 0.233_wp
331+
R_mix = 8.314462618_wp*((Y_N2/MW_N2) + (Y_O2/MW_O2))
332+
bottom_blend_u = tanh(y_cc(j)/delta_shear)
333+
bottom_blend_T = tanh(y_cc(j)/delta_th)
334+
u_mean = u_max*bottom_blend_u
335+
T_loc = T_wall + (T_inf - T_wall)*bottom_blend_T
336+
q_prim_vf(eqn_idx%cont%beg)%sf(i, j, 0) = P_atm/(R_mix*T_loc)
337+
q_prim_vf(eqn_idx%mom%beg)%sf(i, j, 0) = u_mean
338+
q_prim_vf(eqn_idx%mom%end)%sf(i, j, 0) = 0.0_wp
339+
q_prim_vf(eqn_idx%E)%sf(i, j, 0) = P_atm
340+
q_prim_vf(eqn_idx%species%beg)%sf(i, j, 0) = Y_O2
341+
q_prim_vf(eqn_idx%species%end)%sf(i, j, 0) = Y_N2
308342
case default
309343
if (proc_rank == 0) then
310344
call s_int_to_str(patch_id, iStr)

0 commit comments

Comments
 (0)