-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8ab1ce
commit d678061
Showing
11 changed files
with
89 additions
and
49 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 |
---|---|---|
|
@@ -7,8 +7,8 @@ | |
% Output arguments: | ||
% xt,yt : xx-component, yy-component of trajectory final position | ||
% time_note : tspan time if a trajectory left interpolant domain | ||
% TSE_Bar_EPS,TRA_Bar_EPS,TRA_EPS : Single trajectory metrics from | ||
% section IV in [1] | ||
% TSE_Bar_EPS,TRA_Bar_EPS,TSE_EPS : Single trajectory metrics from | ||
% section IV in [1] (Theorem 3) | ||
|
||
%-------------------------------------------------------------------------- | ||
% Author: Nikolas Aksamit [email protected] | ||
|
@@ -25,7 +25,7 @@ | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
|
||
function [xt,yt,time_note,TSE_Bar_EPS,TRA_Bar_EPS,TRA_EPS] = Advect_and_Calculate_2DUnsteady(tspan,xx,yy,U_Interp,V_Interp,NCores) | ||
function [xt,yt,time_note,TSE_Bar_EPS,TRA_Bar_EPS,TSE_EPS] = Advect_and_Calculate_2DUnsteady(tspan,xx,yy,U_Interp,V_Interp,NCores) | ||
|
||
%%% Calculate v_0 as spatio-temporal mean of the flow in your domain of | ||
%%% interest | ||
|
@@ -131,19 +131,14 @@ | |
|
||
V1 = cat(1,V1_spmd{:}); | ||
V2 = cat(1,V2_spmd{:}); | ||
V1_EPS=[V1/v_0, ones(size(V1,1),1)]; | ||
V2_EPS=[V2/v_0, ones(size(V1,1),1)]; | ||
|
||
V1_EPS=V1_EPS./(sqrt(sum(V1_EPS.*V1_EPS,2))); | ||
V2_EPS=V2_EPS./(sqrt(sum(V2_EPS.*V2_EPS,2))); | ||
TRA_EPS=real(acos(V1_EPS(:,1).*V2_EPS(:,1)+V1_EPS(:,2).*V2_EPS(:,2))); | ||
TSE_EPS=1/(tspan(end)-tspan(1))*log(sqrt((sum(V2.*V2,2)+v_0.^2)./(sum(V1.*V1,2).^2+v_0.^2))); | ||
|
||
xt = cat(2,x_spmd{:}); | ||
yt = cat(2,y_spmd{:}); | ||
time_note = cat(2,time_note{:}); | ||
|
||
TSE_Bar_EPS=cat(2,TSE_EPS_spmd{:})/(tspan(end)-tspan(1)); | ||
TRA_Bar_EPS=cat(2,TRA_EPS_spmd{:}); | ||
TRA_Bar_EPS=cat(2,TRA_EPS_spmd{:})/(tspan(end)-tspan(1)); | ||
|
||
clear x_spmd y_spmd | ||
|
||
|
This file contains 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 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 |
---|---|---|
|
@@ -7,8 +7,8 @@ | |
% Output arguments: | ||
% xt,yt,zt : xx-component, yy-component, zz-component of trajectory final position | ||
% time_note : tspan time if a trajectory left interpolant domain | ||
% TSE_Bar_EPS,TRA_Bar_EPS,TRA_EPS : Single trajectory metrics from | ||
% section IV in [1] | ||
% TSE_Bar_EPS,TRA_Bar_EPS,TSE_EPS : Single trajectory metrics from | ||
% section IV in [1] (Theorem 3) | ||
|
||
%-------------------------------------------------------------------------- | ||
% Author: Nikolas Aksamit [email protected] | ||
|
@@ -25,7 +25,7 @@ | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
|
||
function [xt,yt,zt,time_note,TSE_Bar_EPS,TRA_Bar_EPS,TRA_EPS] = Advect_and_Calculate_3DUnsteady(tspan,xx,yy,zz,U_Interp,V_Interp,W_Interp,NCores) | ||
function [xt,yt,zt,time_note,TSE_Bar_EPS,TRA_Bar_EPS,TSE_EPS] = Advect_and_Calculate_3DUnsteady(tspan,xx,yy,zz,U_Interp,V_Interp,W_Interp,NCores) | ||
|
||
%%% Calculate v_0 as spatio-temporal mean of the flow in your domain of | ||
%%% interest | ||
|
@@ -147,12 +147,7 @@ | |
|
||
V1 = cat(1,V1_spmd{:}); | ||
V2 = cat(1,V2_spmd{:}); | ||
V1_EPS=[V1/v_0, ones(size(V1,1),1)]; | ||
V2_EPS=[V2/v_0, ones(size(V1,1),1)]; | ||
|
||
V1_EPS=V1_EPS./(sqrt(sum(V1_EPS.*V1_EPS,2))); | ||
V2_EPS=V2_EPS./(sqrt(sum(V2_EPS.*V2_EPS,2))); | ||
TRA_EPS=real(acos(V1_EPS(:,1).*V2_EPS(:,1)+V1_EPS(:,2).*V2_EPS(:,2)+V1_EPS(:,3).*V2_EPS(:,3))); | ||
TSE_EPS=1/(tspan(end)-tspan(1))*log(sqrt((sum(V2.*V2,2)+v_0.^2)./(sum(V1.*V1,2).^2+v_0.^2))); | ||
|
||
xt = cat(2,x_spmd{:}); | ||
yt = cat(2,y_spmd{:}); | ||
|
This file contains 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 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 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
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.
This file contains 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,54 @@ | ||
-------------------------------------------------------------------------- | ||
Author: Nikolas Aksamit [email protected] | ||
-------------------------------------------------------------------------- | ||
|
||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
%%% References: | ||
[1] Haller, G., Aksamit, N. O., & Bartos, A. P. E. (2021). Quasi-Objective Coherent Structure Diagnostics from Single Trajectories. | ||
Chaos, 31, 043131-1–17. https://doi.org/10.1063/5.0044151 | ||
[2] Aksamit, N.O., Haller, G. (2021). Objective Momentum Barriers in Wall Turbulence. | ||
In Review, http://arxiv.org/abs/2106.07372 | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
%%% Calculate TRA and TSE diagnostics for 2D and 3D, steady and unsteady flows. | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
The four “Advect_and_Calculate” scripts provide the tools to calculate TRA, and TSE values as described in [1] for both 2D and 3D, steady and unsteady flows. For the unsteady cases, the extended phase space versions are calculated which require a choice of v_0. The default choice is the spatio-temporal mean of the flow velocity magnitude in the domain of interest. | ||
|
||
Each Advect_and_Calculate script uses similar input formats: | ||
|
||
Advect_and_Calculate_2DSteady.m | ||
% Input arguments: | ||
tspan : Discrete advection timesteps used for RK4 advection scheme. This must include all intermediate steps between initial and final times(e.g. tspan=linspace(t_initial,t_final,100). For the steady case, these are dummy times as the velocity field is autonomous. | ||
xx,yy : Initial positions for advection. These must be formatted as Nx1 vectors | ||
U_Interp,V_Interp : Velocity field interpolants with inputs (xx,yy) | ||
NCores : Number of Cores for parpool | ||
|
||
% Output arguments: | ||
xt,yt : xx-component, yy-component of trajectory final position. | ||
time_note : tspan time if a trajectory left interpolant domain | ||
TSE_Bar,TSE,TRA_Bar,TRA : Single trajectory metrics from section II and III in [1] | ||
|
||
Advect_and_Calculate_2DUnsteady.m | ||
% Input arguments: | ||
tspan : Discrete advection timesteps used for RK4 advection scheme. This must include all intermediate steps between initial and final times(e.g. tspan=linspace(t_initial,t_final,100). For the unsteady case, these are times used in the velocity field interplant. | ||
xx,yy : Initial positions for advection. These must be formatted as Nx1 vectors | ||
U_Interp,V_Interp : Velocity field interpolants with inputs (time,xx,yy) | ||
NCores : Number of Cores for parpool | ||
|
||
% Output arguments: | ||
xt,yt : xx-component, yy-component of trajectory final position. | ||
time_note : tspan time if a trajectory left interpolant domain | ||
TSE_Bar,TSE,TRA_Bar : Extended phase-space single trajectory metrics from section IV [1] | ||
|
||
Note: For unsteady cases you can modify v_0, or leave as the mean of values used to define flow field interpolants. Advect_and_Calculate_3DSteady.m and Advect_and_Calculate_3DUnsteady.m are of the same format, with an extra z-component. | ||
|
||
Demo_Unsteady2D.m | ||
Demonstration of unsteady TRA and TSE calculations for geostrophic ocean current data as in [1]. | ||
|
||
Demo_Steady3D.m | ||
Demonstration of steady TRA and TSE calculations for Johns Hopkins Turbulence Database Re=1000 Channel flow as in [2]. | ||
|
||
Demo_Steady3D_Geometry.m | ||
Demonstration of steady NTRA and NTSE (normalized) calculations for Johns Hopkins Turbulence Database Re=1000 Channel flow as in [2]. | ||
|