Skip to content

Commit ab9d71b

Browse files
Merge branch 'better-test-label' of github.com:danieljvickers/MFC into better-test-label
2 parents ac619dc + 90a988b commit ab9d71b

35 files changed

Lines changed: 1295 additions & 209 deletions

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: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,20 @@ When ``cyl_coord = 'T'`` is set in 2D the following constraints must be met:
10681068

10691069
- `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
10701070

1071+
### 18. Chemistry-Specific Boundary Conditions
10711072

1072-
### 18. GPU Performance (NVIDIA UVM)
1073+
| Parameter | Type | Description |
1074+
| ---: | :----: | :--- |
1075+
| `bc_[x,y,z]%%isothermal_in` | Logical | Enable isothermal wall at the domain entrance (minimum coordinate). |
1076+
| `bc_[x,y,z]%%isothermal_out` | Logical | Enable isothermal wall at the domain exit (maximum coordinate). |
1077+
| `bc_[x,y,z]%%Twall_in` | Real | Temperature [K] of the entrance isothermal wall. |
1078+
| `bc_[x,y,z]%%Twall_out` | Real | Temperature [K] of the exit isothermal wall. |
1079+
1080+
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).
1081+
1082+
1083+
1084+
### 19. GPU Performance (NVIDIA UVM)
10731085

10741086
| Parameter | Type | Description |
10751087
| ---: | :---: | :--- |
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)