Skip to content

Commit 5b8e2eb

Browse files
hyeoksu-leeCopilotHyeoksu LeeHyeoksu LeeHyeoksu Lee
authored
Update initialization for turbulent mixing layer and add validation results (#879)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter04.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hyeoksu@x1101c3s3b0n3.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter07.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hlee3@dt-login01.delta.ncsa.illinois.edu> Co-authored-by: Hyeoksu Lee <hyeoksu@x1002c0s4b0n2.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter06.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter01.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter02.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter09.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Spencer Bryngelson <sbryngelson@gmail.com> Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter10.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter05.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hyeoksu@Mac.lan>
1 parent 4864d36 commit 5b8e2eb

31 files changed

+1086
-1268
lines changed

.typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ gam = "gam"
1717
Gam = "Gam"
1818
strang = "strang"
1919
Strang = "Strang"
20+
TKE = "TKE"
2021

2122
[files]
2223
extend-exclude = ["docs/documentation/references*", "tests/", "toolchain/cce_simulation_workgroup_256.sh"]

docs/documentation/case.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,6 @@ When ``polytropic = 'F'``, the gas compression is modeled as non-polytropic due
825825
| `mixlayer_vel_profile` | Logical | Set the mean streamwise velocity to hyperbolic tangent profile |
826826
| `mixlayer_vel_coef` | Real | Coefficient for the hyperbolic tangent profile of a mixing layer |
827827
| `mixlayer_perturb` | Logical | Perturb the initial velocity field by instability waves |
828-
| `mixlayer_domain` | Real | Domain size of a mixing layer for the linear stability analysis |
829828

830829
The table lists velocity field parameters.
831830
The parameters are optionally used to define initial velocity profiles and perturbations.
@@ -840,15 +839,13 @@ The parameters are optionally used to define initial velocity profiles and pertu
840839

841840
- `perturb_sph_fluid` specifies the fluid component whose partial density is to be perturbed.
842841

843-
- `mixlayer_vel_profile` activates setting the mean streamwise velocity to a hyperbolic tangent profile. This option works only for 2D and 3D cases.
842+
- `mixlayer_vel_profile` activates setting the mean streamwise velocity to a hyperbolic tangent profile. This option works only for `n > 0`.
844843

845844
- `mixlayer_vel_coef` is a parameter for the hyperbolic tangent profile of a mixing layer when `mixlayer_vel_profile = 'T'`. The mean streamwise velocity profile is given as:
846845

847-
$$ u = patch\_icpp(1)\%vel(1) * tanh(y\_cc * mixlayer\_vel\_profile) $$
846+
$$ u = \mbox{patch\_icpp(1)\%vel(1)} * \tanh( y_{cc} * \mbox{mixlayer\_vel\_coef}) $$
848847

849-
- `mixlayer_perturb` activates the perturbation of initial velocity by instability waves obtained from linear stability analysis for a mixing layer with hyperbolic tangent mean streamwise velocity profile. This option only works for `n > 0`, `bc_y%[beg,end] = -6`, `num_fluids = 1`, `model_eqns = 2` and `mixlayer_vel_profile = 'T'`.
850-
851-
- `mixlayer_domain` defines the domain size to compute spatial eigenvalues of the linear instability analysis when `mixlayer_perturb = 'T'`. For example, the spatial eigenvalue in `x` direction in 2D problem will be $2 \pi \alpha / (mixlayer\_domain*patch\_icpp(1)\%length\_y)$ for $\alpha = 1$, $2$ and $4$.
848+
- `mixlayer_perturb` activates the velocity perturbation for a temporal mixing layer with hyperbolic tangent mean streamwise velocity profile, using an inverter version of the spectrum-based synthetic turbulence generation method proposed by Guo et al. (2023, JFM). This option only works for `p > 0` and `mixlayer_vel_profile = 'T'`.
852849

853850
### 11. Phase Change Model
854851
| Parameter | Type | Description |

docs/documentation/references.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
- <a id="Gottlieb98">Gottlieb, S. and Shu, C.-W. (1998). Total variation diminishing runge-kutta schemes. Mathematics of computation of the American Mathematical Society, 67(221):73–85.</a>
2222

23+
- <a id="Guo23">Guo, H., Jiang, P., Ye, L., & Zhu, Y. (2023). An efficient and low-divergence method for generating inhomogeneous and anisotropic turbulence with arbitrary spectra. Journal of Fluid Mechanics, 970, A2.</a>
24+
2325
- <a id="Henrick05">Henrick, A. K., Aslam, T. D., and Powers, J. M. (2005). Mapped weighted essentially nonoscillatory schemes: achieving optimal order near critical points. Journal of Computational Physics, 207(2):542–567.</a>
2426

2527
- <a id="Borges08">Borges, R., Carmona, M., Costa, B., and Don, W. S. (2008). An improved weighted essentially non-oscillatory scheme for hyperbolic conservation laws. Journal of computational physics, 227(6):3191–3211.</a>
@@ -34,6 +36,8 @@
3436

3537
- <a id="Meng16">Meng, J. C. C. (2016). Numerical simulations of droplet aerobreakup. PhD thesis, California Institute of Technology.</a>
3638

39+
- <a id="Michalke64"> Michalke, A. (1964). On the inviscid instability of the hyperbolictangent velocity profile. Journal of Fluid Mechanics, 19(4), 543-556.</a>
40+
3741
- <a id="Pirozzoli13">Pirozzoli, S., and Colonius, T. (2013). Generalized characteristic relaxation boundary conditions for unsteady compressible flow simulations. Journal of Computational Physics, 248:109-126.</a>
3842

3943
- <a id="Preston07">Preston, A., Colonius, T., and Brennen, C. (2007). A reduced-order model of diffusive effects on the dynamics of bubbles. Physics of Fluids, 19(12):123302.</a>

examples/2D_mixing_artificial_Ma/case.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@
108108
# Mixing layer
109109
"mixlayer_vel_profile": "T",
110110
"mixlayer_vel_coef": 1.0,
111-
"mixlayer_domain": 1.0,
112-
"mixlayer_perturb": "T",
113111
# Artificial Mach number
114112
"pi_fac": pi_fac,
115113
# Fluids Physical Parameters

examples/3D_turb_mixing/case.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,38 @@
44

55
# SURROUNDING FLOW
66
# Nondimensional parameters
7-
Re0 = 50.0 # Reynolds number
7+
Re0 = 320.0 # Reynolds number
88
M0 = 0.2 # Mach number
99

1010
# Fluid properties
1111
gamma = 1.4
12-
pi_inf = 0.0
1312

1413
# Free stream velocity & pressure
1514
u0 = 1.0
1615
pres0 = 1.0 / (gamma * M0**2)
1716

1817
# Domain size
19-
Lx = 59.0
20-
Ly = 59.0
21-
Lz = 59.0
18+
Lx = 160.0
19+
Ly = 160.0
20+
Lz = 80.0
2221

2322
# Number of grid cells
24-
Nx = 191
25-
Ny = 191
26-
Nz = 191
23+
Nx = 1023
24+
Ny = 1023
25+
Nz = 511
2726

2827
# Grid spacing
2928
dx = Lx / float(Nx)
3029
dy = Ly / float(Ny)
3130
dz = Lz / float(Nz)
3231

3332
# Time advancement
34-
cfl = 0.1
35-
T = 100.0
36-
dt = cfl * dx / u0
33+
cfl = 0.5
34+
T = 150.0
35+
dt = cfl * dx / (u0 / M0 + 1)
3736
Ntfinal = int(T / dt)
3837
Ntstart = 0
39-
Nfiles = 100
38+
Nfiles = 30
4039
t_save = int(math.ceil((Ntfinal - 0) / float(Nfiles)))
4140
Nt = t_save * Nfiles
4241
t_step_start = Ntstart
@@ -53,6 +52,11 @@
5352
"x_domain%end": Lx,
5453
"y_domain%beg": -Ly / 2.0,
5554
"y_domain%end": Ly / 2.0,
55+
"stretch_y": "T",
56+
"a_y": 2,
57+
"y_a": -0.3 * Ly,
58+
"y_b": 0.3 * Ly,
59+
"loops_y": 2,
5660
"z_domain%beg": 0.0,
5761
"z_domain%end": Lz,
5862
"m": Nx,
@@ -68,10 +72,9 @@
6872
"num_fluids": 1,
6973
"time_stepper": 3,
7074
"weno_order": 5,
71-
"weno_eps": 1.0e-16,
72-
"weno_Re_flux": "T",
73-
"weno_avg": "T",
74-
"mapped_weno": "T",
75+
"weno_eps": 1.0e-40,
76+
"weno_Re_flux": "F",
77+
"wenoz": "T",
7578
"riemann_solver": 2,
7679
"wave_speeds": 1,
7780
"avg_state": 2,
@@ -85,7 +88,7 @@
8588
# Formatted Database Files Structure Parameters
8689
"format": 1,
8790
"precision": 2,
88-
"cons_vars_wrt": "T",
91+
"cons_vars_wrt": "F",
8992
"prim_vars_wrt": "T",
9093
"parallel_io": "T",
9194
"fd_order": 1,
@@ -99,7 +102,7 @@
99102
"patch_icpp(1)%y_centroid": 0.0,
100103
"patch_icpp(1)%z_centroid": Lz / 2.0,
101104
"patch_icpp(1)%length_x": Lx,
102-
"patch_icpp(1)%length_y": Ly,
105+
"patch_icpp(1)%length_y": 1e6,
103106
"patch_icpp(1)%length_z": Lz,
104107
"patch_icpp(1)%alpha_rho(1)": 1.0,
105108
"patch_icpp(1)%alpha(1)": 1.0,
@@ -109,8 +112,6 @@
109112
"patch_icpp(1)%pres": pres0,
110113
# Mixing layer
111114
"mixlayer_vel_profile": "T",
112-
"mixlayer_vel_coef": 1.0,
113-
"mixlayer_domain": 1.0,
114115
"mixlayer_perturb": "T",
115116
# Fluids Physical Parameters
116117
# Surrounding liquid
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Temporally evolving turbulent mixing layer (3D)
2+
3+
Reference:
4+
> Bell, J. H., & Mehta, R. D. (1990). Development of a two-stream mixing layer from tripped and untripped boundary layers. AIAA Journal, 28(12), 2034-2042.
5+
> Rogers, M. M., & Moser, R. D. (1994). Direct simulation of a self‐similar turbulent mixing layer. Physics of Fluids, 6(2), 903-923.
6+
> Pantano, C., & Sarkar, S. (2002). A study of compressibility effects in the high-speed turbulent shear layer using direct simulation. Journal of Fluid Mechanics, 451, 329-371.
7+
> Vaghefi, S. N. S. (2014). Simulation and modeling of compressible turbulent mixing layer. State University of New York at Buffalo.
8+
> Wang, X., Wang, J., & Chen, S. (2022). Compressibility effects on statistics and coherent structures of compressible turbulent mixing layers. Journal of Fluid Mechanics, 947, A38.
9+
10+
## Description
11+
This directory (`turbulence_stat`) contains sub-directories and Matlab scripts for computing turbulence statistics of 3D temporally evolving turbulent mixing layer as described below:
12+
13+
Files:
14+
- `set_user_inputs.m`: User input parameters are defined in this file.
15+
- `run_turbulence.m`: Turbulence statistics (growth rate, Reynolds stress, TKE budget) are computed and plots are generated in this file.
16+
- `average_tke_over_self_similar.m`: Averaging over self-similar period of TKE budget is performed in this file.
17+
- `submit_batch_job_*.sh`: Example scripts for batch job submission on DoD Carpenter (PBS system) and NCSA Delta (Slurm system)
18+
19+
Directories:
20+
- `log`: Log files from batch job are stored in this directory.
21+
- `reference_data`: Data from reference papers are provided in this directory.
22+
- `variables`: User inputs from `set_user_inputs.m` are saved as Matlab data (`user_inputs.mat`) in this directory.
23+
- `results`: Outputs are stored in sub-directories in the directory.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
close all; clear all;
2+
3+
4+
% Setup
5+
disp("Start average_tke_over_self_similar ..."); tic;
6+
set_user_inputs(); load variables/user_inputs.mat;
7+
8+
ybeg = -5; yend = 5; ny = 101;
9+
y = linspace(ybeg,yend,ny);
10+
11+
% Array
12+
T0_averaged = zeros(ny,1);
13+
P_averaged = zeros(ny,1);
14+
D_averaged = zeros(ny,1);
15+
16+
% Compute averaged TKE budget
17+
for q = 1:Nfiles
18+
load("results/tke_budget_data/tstep_"+string(timesteps(q))+".mat");
19+
20+
% Normalization
21+
T0 = T0 / (8/mth); % T / (Delta U^3 / mth)
22+
P = P / (8/mth); % P / (Delta U^3 / mth)
23+
D = D / (8/mth); % D / (Delta U^3 / mth)
24+
25+
% Interpolation
26+
i_start = 1;
27+
for j = 1:ny
28+
for i = i_start:length(y_norm_mth) - 1
29+
if (y_norm_mth(i) <= y(j) && y_norm_mth(i+1) > y(j))
30+
T0_averaged(j) = T0_averaged(j) + ((T0(i+1) - T0(i))/(y_norm_mth(i+1) - y_norm_mth(i))*(y(j) - y_norm_mth(i)) + T0(i))/Nfiles;
31+
P_averaged(j) = P_averaged(j) + ((P(i+1) - P(i))/(y_norm_mth(i+1) - y_norm_mth(i))*(y(j) - y_norm_mth(i)) + P(i))/Nfiles;
32+
D_averaged(j) = D_averaged(j) + ((D(i+1) - D(i))/(y_norm_mth(i+1) - y_norm_mth(i))*(y(j) - y_norm_mth(i)) + D(i))/Nfiles;
33+
i_start = i;
34+
break;
35+
end
36+
end
37+
end
38+
end
39+
40+
T_averaged = f_compute_derivative_1d(T0_averaged,y*mth);
41+
42+
% Plot
43+
plot_tke_budget(T_averaged, P_averaged, D_averaged, y, mth);
44+
45+
disp("End of program"); toc;
46+
47+
%% FUNCTIONS
48+
% Compute the wall-normal derivative of a discretized function, fun(y)
49+
function dfunds = f_compute_derivative_1d(fun,s)
50+
51+
dfunds = zeros(size(fun)); % initialize discrete derivative vector
52+
53+
% Compute one-sided derivative at the bottom boundary
54+
dfunds(1) = (fun(2) - fun(1)) / (s(2) - s(1));
55+
56+
% Compute one-sided derivative at the top boundary
57+
dfunds(end) = (fun(end) - fun(end-1)) / (s(end) - s(end-1));
58+
59+
% Compute two-sided derivatives for interior points
60+
for i = 2:length(s)-1
61+
dfunds(i) = (fun(i+1) - fun(i-1)) / (s(i+1) - s(i-1));
62+
end
63+
end
64+
65+
% Plot TKE budget
66+
function plot_tke_budget(T, P, D, y_norm_mth, mth)
67+
68+
load variables/user_inputs.mat;
69+
load reference_data/reference.mat;
70+
71+
% Plot
72+
f1 = figure("DefaultAxesFontSize",18);
73+
set(f1,"Position",[200 200 1000 700]);
74+
75+
% Present
76+
h1 = plot([-100 -100],[-100 -100],'-k','LineWidth',2); hold on; grid on;
77+
plot(y_norm_mth,T,'-b','LineWidth',2);
78+
plot(y_norm_mth,P,'-g','LineWidth',2);
79+
plot(y_norm_mth,D,'-r','LineWidth',2);
80+
xlim([-5 5]); xticks([-5:1:5]);
81+
ylim([-0.002 0.003]);
82+
xlabel('$y/\delta_\theta$','interpreter','latex');
83+
set(gca,'TickLabelInterpreter','latex');
84+
85+
% Pantano & Sarkar (2002)
86+
h2 = plot([-100 -100],[-100 -100],'ko','LineWidth',2,'MarkerSize',8);
87+
plot(p2002_tke_transport(:,1),p2002_tke_transport(:,2),'bo','LineWidth',2,'MarkerSize',8);
88+
plot(p2002_tke_production(:,1),p2002_tke_production(:,2),'go','LineWidth',2,'MarkerSize',8);
89+
plot(p2002_tke_dissipation(:,1),p2002_tke_dissipation(:,2),'ro','LineWidth',2,'MarkerSize',8);
90+
91+
% Rogers & Moser (1994)
92+
h3 = plot([-100 -100],[-100 -100],'k^','LineWidth',2,'MarkerSize',8);
93+
plot(r1994_tke_transport(:,1),r1994_tke_transport(:,2),'b^','LineWidth',2,'MarkerSize',8);
94+
plot(r1994_tke_production(:,1),r1994_tke_production(:,2),'g^','LineWidth',2,'MarkerSize',8);
95+
plot(r1994_tke_dissipation(:,1),r1994_tke_dissipation(:,2),'r^','LineWidth',2,'MarkerSize',8);
96+
97+
% Vaghefi (2014)
98+
h4 = plot([-100 -100],[-100 -100],'k+','LineWidth',2,'MarkerSize',8);
99+
plot(v2014_tke_transport(:,1),v2014_tke_transport(:,2),'b+','LineWidth',2,'MarkerSize',8);
100+
plot(v2014_tke_production(:,1),v2014_tke_production(:,2),'g+','LineWidth',2,'MarkerSize',8);
101+
plot(v2014_tke_dissipation(:,1),v2014_tke_dissipation(:,2),'r+','LineWidth',2,'MarkerSize',8);
102+
103+
% Wang et al. (2022)
104+
h5 = plot([-100 -100],[-100 -100],'k*','LineWidth',2,'MarkerSize',8);
105+
plot(w2022_tke_transport(:,1),w2022_tke_transport(:,2),'b*','LineWidth',2,'MarkerSize',8);
106+
plot(w2022_tke_production(:,1),w2022_tke_production(:,2),'g*','LineWidth',2,'MarkerSize',8);
107+
plot(w2022_tke_dissipation(:,1),w2022_tke_dissipation(:,2),'r*','LineWidth',2,'MarkerSize',8);
108+
109+
legend([h1,h2,h3,h4,h5], {"$\mbox{Present}$", ...
110+
"$\mbox{Pantano \& Sarkar (2002)}$", ...
111+
"$\mbox{Rogers \& Moser (1994)}$", ...
112+
"$\mbox{Vaghefi (2014)}$", ...
113+
"$\mbox{Wang et al. (2022)}$"}, ...
114+
'interpreter','latex','location','northeast');
115+
116+
saveas(f1, "results/tke_budget/avg_self_similar","png");
117+
close(f1);
118+
end
Binary file not shown.
Loading
Loading

0 commit comments

Comments
 (0)