-
Notifications
You must be signed in to change notification settings - Fork 121
Update initialization for turbulent mixing layer and add validation results #879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
657344b
update mixlayer
33b8244
update tests for mixlayer
c384beb
fix minor bug in mixlayer_perturb
44c019e
minor fix
0a727c9
update prng
be036db
test
350b6c2
update prng
3427b0c
remove obsolete param
83fa91f
update tests and format
564ce54
update constant and tests
9e9e588
update turbulence stat matlab code (draft)
e0e14a5
replace some magic numbers by global param
48ae773
Update turb stat
aff2320
update matlab code
d4f9faf
add matlab batch template file
98e854c
modify examples/3D_turb_mixing
b365477
Merge branch 'master' into mixlayer
hyeoksu-lee d11d153
minor fix
ee633d7
add TKE as exception for spelling check
7ba7baa
fix minor
3d0f7a2
remove images and *sh files
f6a7fc5
Merge branch 'master' into mixlayer
hyeoksu-lee 67c85ba
Update m_start_up.fpp
hyeoksu-lee dcdcab2
add reference data
b5e7c6c
combine reference data into a single file
a29daed
Merge branch 'master' into mixlayer
hyeoksu-lee 4fc3642
Merge branch 'master' into mixlayer
sbryngelson a362e41
Merge branch 'master' into mixlayer
sbryngelson 0df0186
Merge branch 'master' into mixlayer
sbryngelson d2f6681
Merge branch 'master' into mixlayer
sbryngelson ab667f1
Update examples/3D_turb_mixing/turbulence_stat/average_tke_over_self_…
hyeoksu-lee 4b3444e
minor update
182a1c5
remove false integer
330d8b5
minor fix
8a2b530
minor fix
4a1b90d
update test for mixlayer_perturb
b68d4c6
update test for mixlayer_perturb
6161dd8
update test
12829bd
Merge branch 'master' into mixlayer
hyeoksu-lee c0cfefe
enhance consistency of prng
79c32ce
update statistics
464c7aa
Merge branch 'master' into mixlayer
hyeoksu-lee c937bd9
Merge branch 'master' into mixlayer
hyeoksu-lee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Temporally evolving turbulent mixing layer (3D) | ||
|
|
||
| Reference: | ||
| > 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. | ||
| > Rogers, M. M., & Moser, R. D. (1994). Direct simulation of a self‐similar turbulent mixing layer. Physics of Fluids, 6(2), 903-923. | ||
| > 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. | ||
| > Vaghefi, S. N. S. (2014). Simulation and modeling of compressible turbulent mixing layer. State University of New York at Buffalo. | ||
| > 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. | ||
|
|
||
| ## Description | ||
| This directory (`turbulence_stat`) contains sub-directories and Matlab scripts for computing turbulence statistics of 3D temporally evolving turbulent mixing layer as described below: | ||
|
|
||
| Files: | ||
| - `set_user_inputs.m`: User input parameters are defined in this file. | ||
| - `run_turbulence.m`: Turbulence statistics (growth rate, Reynolds stress, TKE budget) are computed and plots are generated in this file. | ||
| - `average_tke_over_self_similar.m`: Averaging over self-similar period of TKE budget is performed in this file. | ||
| - `submit_batch_job_*.sh`: Example scripts for batch job submission on DoD Carpenter (PBS system) and NCSA Delta (Slurm system) | ||
|
|
||
| Directories: | ||
| - `log`: Log files from batch job are stored in this directory. | ||
| - `reference_data`: Data from reference papers are provided in this directory. | ||
| - `variables`: User inputs from `set_user_inputs.m` are saved as Matlab data (`user_inputs.mat`) in this directory. | ||
| - `results`: Outputs are stored in sub-directories in the directory. |
118 changes: 118 additions & 0 deletions
118
examples/3D_turb_mixing/turbulence_stat/average_tke_over_self_similar.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| close all; clear all; | ||
|
|
||
|
|
||
| % Setup | ||
| disp("Start average_tke_over_self_similar ..."); tic; | ||
| set_user_inputs(); load variables/user_inputs.mat; | ||
|
|
||
| ybeg = -5; yend = 5; ny = 101; | ||
| y = linspace(ybeg,yend,ny); | ||
|
|
||
| % Array | ||
| T0_averaged = zeros(ny,1); | ||
| P_averaged = zeros(ny,1); | ||
| D_averaged = zeros(ny,1); | ||
|
|
||
| % Compute averaged TKE budget | ||
| for q = 1:Nfiles | ||
| load("results/tke_budget_data/tstep_"+string(timesteps(q))+".mat"); | ||
|
|
||
| % Normalization | ||
| T0 = T0 / (8/mth); % T / (Delta U^3 / mth) | ||
| P = P / (8/mth); % P / (Delta U^3 / mth) | ||
| D = D / (8/mth); % D / (Delta U^3 / mth) | ||
|
|
||
| % Interpolation | ||
| i_start = 1; | ||
| for j = 1:ny | ||
| for i = i_start:length(y_norm_mth) - 1 | ||
| if (y_norm_mth(i) <= y(j) && y_norm_mth(i+1) > y(j)) | ||
| 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; | ||
| 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; | ||
| 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; | ||
| i_start = i; | ||
| break; | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| T_averaged = f_compute_derivative_1d(T0_averaged,y*mth); | ||
|
|
||
| % Plot | ||
| plot_tke_budget(T_averaged, P_averaged, D_averaged, y, mth); | ||
|
|
||
| disp("End of program"); toc; | ||
|
|
||
| %% FUNCTIONS | ||
| % Compute the wall-normal derivative of a discretized function, fun(y) | ||
| function dfunds = f_compute_derivative_1d(fun,s) | ||
|
|
||
| dfunds = zeros(size(fun)); % initialize discrete derivative vector | ||
|
|
||
| % Compute one-sided derivative at the bottom boundary | ||
| dfunds(1) = (fun(2) - fun(1)) / (s(2) - s(1)); | ||
|
|
||
| % Compute one-sided derivative at the top boundary | ||
| dfunds(end) = (fun(end) - fun(end-1)) / (s(end) - s(end-1)); | ||
|
|
||
| % Compute two-sided derivatives for interior points | ||
| for i = 2:length(s)-1 | ||
| dfunds(i) = (fun(i+1) - fun(i-1)) / (s(i+1) - s(i-1)); | ||
| end | ||
| end | ||
|
|
||
| % Plot TKE budget | ||
| function plot_tke_budget(T, P, D, y_norm_mth, mth) | ||
|
|
||
| load variables/user_inputs.mat; | ||
| load reference_data/reference.mat; | ||
|
|
||
| % Plot | ||
| f1 = figure("DefaultAxesFontSize",18); | ||
| set(f1,"Position",[200 200 1000 700]); | ||
|
|
||
| % Present | ||
| h1 = plot([-100 -100],[-100 -100],'-k','LineWidth',2); hold on; grid on; | ||
| plot(y_norm_mth,T,'-b','LineWidth',2); | ||
| plot(y_norm_mth,P,'-g','LineWidth',2); | ||
| plot(y_norm_mth,D,'-r','LineWidth',2); | ||
| xlim([-5 5]); xticks([-5:1:5]); | ||
| ylim([-0.002 0.003]); | ||
| xlabel('$y/\delta_\theta$','interpreter','latex'); | ||
| set(gca,'TickLabelInterpreter','latex'); | ||
|
|
||
| % Pantano & Sarkar (2002) | ||
| h2 = plot([-100 -100],[-100 -100],'ko','LineWidth',2,'MarkerSize',8); | ||
| plot(p2002_tke_transport(:,1),p2002_tke_transport(:,2),'bo','LineWidth',2,'MarkerSize',8); | ||
| plot(p2002_tke_production(:,1),p2002_tke_production(:,2),'go','LineWidth',2,'MarkerSize',8); | ||
| plot(p2002_tke_dissipation(:,1),p2002_tke_dissipation(:,2),'ro','LineWidth',2,'MarkerSize',8); | ||
|
|
||
| % Rogers & Moser (1994) | ||
| h3 = plot([-100 -100],[-100 -100],'k^','LineWidth',2,'MarkerSize',8); | ||
| plot(r1994_tke_transport(:,1),r1994_tke_transport(:,2),'b^','LineWidth',2,'MarkerSize',8); | ||
| plot(r1994_tke_production(:,1),r1994_tke_production(:,2),'g^','LineWidth',2,'MarkerSize',8); | ||
| plot(r1994_tke_dissipation(:,1),r1994_tke_dissipation(:,2),'r^','LineWidth',2,'MarkerSize',8); | ||
|
|
||
| % Vaghefi (2014) | ||
| h4 = plot([-100 -100],[-100 -100],'k+','LineWidth',2,'MarkerSize',8); | ||
| plot(v2014_tke_transport(:,1),v2014_tke_transport(:,2),'b+','LineWidth',2,'MarkerSize',8); | ||
| plot(v2014_tke_production(:,1),v2014_tke_production(:,2),'g+','LineWidth',2,'MarkerSize',8); | ||
| plot(v2014_tke_dissipation(:,1),v2014_tke_dissipation(:,2),'r+','LineWidth',2,'MarkerSize',8); | ||
|
|
||
| % Wang et al. (2022) | ||
| h5 = plot([-100 -100],[-100 -100],'k*','LineWidth',2,'MarkerSize',8); | ||
| plot(w2022_tke_transport(:,1),w2022_tke_transport(:,2),'b*','LineWidth',2,'MarkerSize',8); | ||
| plot(w2022_tke_production(:,1),w2022_tke_production(:,2),'g*','LineWidth',2,'MarkerSize',8); | ||
| plot(w2022_tke_dissipation(:,1),w2022_tke_dissipation(:,2),'r*','LineWidth',2,'MarkerSize',8); | ||
|
|
||
| legend([h1,h2,h3,h4,h5], {"$\mbox{Present}$", ... | ||
| "$\mbox{Pantano \& Sarkar (2002)}$", ... | ||
| "$\mbox{Rogers \& Moser (1994)}$", ... | ||
| "$\mbox{Vaghefi (2014)}$", ... | ||
| "$\mbox{Wang et al. (2022)}$"}, ... | ||
| 'interpreter','latex','location','northeast'); | ||
|
|
||
| saveas(f1, "results/tke_budget/avg_self_similar","png"); | ||
| close(f1); | ||
| end |
Binary file not shown.
Binary file added
BIN
+203 KB
examples/3D_turb_mixing/turbulence_stat/results/Reynolds_stress/tstep_11520.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+184 KB
examples/3D_turb_mixing/turbulence_stat/results/tke_budget/avg_self_similar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+211 KB
examples/3D_turb_mixing/turbulence_stat/results/tke_budget/tstep_11520.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.