-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathburgersPhysicalLES.m
69 lines (61 loc) · 1.28 KB
/
burgersPhysicalLES.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
clear all
close all
run('/Users/Eric/local/adimat-0.6.0-4971-GNU_Linux-x86_64/ADiMat_startup');
%% Run settings
global nx x dx k dt u Q nu turbmodel Cs Delta tausgs
nx = 40;
L = 2.*pi;
dx = L/(nx);
x = linspace(0,2.*pi - dx,nx);
k = linspace(-nx/2,nx/2 - 1,nx)';
t = 0;
et = 2;
nu = 1e-2;
dt = 1e-3;
iter = 0;
turbmodel = 2;'smagorinsky';
Cs = 0.2;
Delta = pi/20;
h = figure;
DNS = load('DNSdata/DNSkurgtad.mat');
Delta = pi/20.;
kc = 20;
%%% Initial Conditions=
%u = sin(x)';
u = real(interp1(DNS.x,DNS.ufiltsave(:,1),x)');
[nut,tausgs] = smagorinsky(u,dx);
%tausgs = interp1(DNS.x, DNS.tauSGSsave(:,1),x);
uhat = myfft(u,nx);
U2Qmap();
rk4const = [1./4,1./3,1./2,1.];
iter2 = 1;
%%% Filter Info
usave = [u];
uhatsave = [uhat];
tsave = [t];
while (t < et)
iter = iter + 1;
advanceSolution();
Q2Umap();
t = t + dt;
if (mod(iter,10) == 0)
[val,DNSind] = min(abs(t - DNS.tsave));
tsave = [tsave,t];
usave = [usave,u];
uhatsave = [uhatsave;uhat];
iter2 = iter2 + 1;
subplot(1,2,1)
plot(x,real(u))
hold on
plot(DNS.x,DNS.ufiltsave(:,DNSind));
drawnow
hold off
subplot(1,2,2)
plot(x,real(tausgs))
hold on
%plot(DNS.x,real(DNS.tauSGSsave(:,DNSind)))
plot(x,interp1(DNS.x,DNS.tauSGSsave(:,DNSind),x))
hold off
t
end
end