plot_stobj.m
clearvars; clc; % plot_stobj.m
ta_2mu32=importdata("data\stobj\ta_2mu32");
ta_3mu32=importdata("data\stobj\ta_3mu32");
ta_2th32=importdata("data\stobj\ta_2th32");
fig1=figure(1);
% set(gca,'ylim',[0,1]); hold on;
x_1=ta_2mu32(:,1); y_1=ta_2mu32(:,2);
plt1=plot(x_1,y_1); hold on; plt1.LineWidth=1.5; plt1.Color='blue';
x_1=ta_2th32(:,1); y_1=ta_2th32(:,2);
plt1=plot(x_1,y_1); hold on; plt1.LineWidth=1.5; plt1.Color='red';
x_1=ta_3mu32(:,1); y_1=ta_3mu32(:,2);
plt1=plot(x_1,y_1); hold on; plt1.LineWidth=1.5; plt1.Color='blue';
xL1=xlabel('Time (s)'); hold on; xL1.FontSize = 17;
yL1=ylabel('VOF'); hold on; yL1.FontSize = 17;
plotDB1.m
clearvars; clc; % plotDB1.m
DB1ZX=importdata(".\data\damB\DB1ZX.csv");
DB1WU=importdata(".\data\damB\DB1WU.csv");
DBN1ZX=importdata(".\data\damB\DBN1ZX.csv");
DBN1WU=importdata(".\data\damB\DBN1WU.csv");
DB1mu=importdata(".\data\damB\t_Ux");
DBN1mu=importdata(".\data\damB\t_Fx");
fig1=figure(1);
set(gca,'xlim',[0,2.5],'ylim',[-0.5,4]); hold on;
x=DB1ZX(:,1); y=DB1ZX(:,2);
sc1=scatter(x,y); hold on;
sc1.SizeData=40; sc1.MarkerEdgeColor='Red'; sc1.Marker='x';
x=DB1WU(:,1); y=DB1WU(:,2);
sc1=scatter(x,y); hold on;
sc1.SizeData=40; sc1.MarkerEdgeColor='Blue'; sc1.Marker='^';
x=DB1mu(:,1); y=DB1mu(:,2);
plt1=plot(x,y); hold on; plt1.LineWidth = 1.5; plt1.Color = 'Black';
xL1=xlabel('Time (s)'); hold on; xL1.FontSize = 17;
yL1=ylabel('Ux (m/s)'); hold on; yL1.FontSize = 17;
fig2=figure(2);
set(gca,'xlim',[0,2.5],'ylim',[-15,45]); hold on;
x=DBN1ZX(:,1); y=DBN1ZX(:,2);
sc1=scatter(x,y); hold on;
sc1.SizeData=40; sc1.MarkerEdgeColor='Red'; sc1.Marker='x';
x=DBN1WU(:,1); y=DBN1WU(:,2);
sc1=scatter(x,y); hold on;
sc1.SizeData=40; sc1.MarkerEdgeColor='Blue'; sc1.Marker='^';
x=DBN1mu(:,1); y=DBN1mu(:,3);
plt1=plot(x,y); hold on; plt1.LineWidth = 1.5; plt1.Color = 'Black';
xL1=xlabel('Time (s)'); hold on; xL1.FontSize = 17;
yL1=ylabel('Fx (N)'); hold on; yL1.FontSize = 17;
rc_Tmepe_t125.m
clearvars; clc; % rc_Tmepe_t125.m
bkg_mat=importdata("data\gL\rc_bkg");
g0L1_mat=importdata("data\gL\rc_g0L1");
g0L2_mat=importdata("data\gL\rc_g0L2");
g0L3_mat=importdata("data\gL\rc_g0L3");
g0L4_mat=importdata("data\gL\rc_g0L4");
g0L5_mat=importdata("data\gL\rc_g0L5");
g1L1_mat=importdata("data\gL\rc_g1L1");
g1L2_mat=importdata("data\gL\rc_g1L2");
g1L3_mat=importdata("data\gL\rc_g1L3");
g1L4_mat=importdata("data\gL\rc_g1L4");
g1L5_mat=importdata("data\gL\rc_g1L5");
a1=0:0.2:1; a1 = a1(1,2:size(a1,2));
fig1=figure(1);
x_0=bkg_mat(:,1); y_0=bkg_mat(:,2);
plt0=plot(x_0,y_0); hold on; plt0.LineWidth=1.5; plt0.Color=[0,0,0];
x_1=g0L1_mat(:,1); y_1=g0L1_mat(:,2);
plt1=plot(x_1,y_1); hold on; plt1.LineWidth=1.5; plt1.Color=[0,0,1,a1(1)];
x_2=g0L2_mat(:,1); y_2=g0L2_mat(:,2);
plt2=plot(x_2,y_2); hold on; plt2.LineWidth=1.5; plt2.Color=[0,0,1,a1(2)];
x_3=g0L3_mat(:,1); y_3=g0L3_mat(:,2);
plt3=plot(x_3,y_3); hold on; plt3.LineWidth=1.5; plt3.Color=[0,0,1,a1(3)];
x_4=g0L4_mat(:,1); y_4=g0L4_mat(:,2);
plt4=plot(x_4,y_4); hold on; plt4.LineWidth=1.5; plt4.Color=[0,0,1,a1(4)];
x_4=g0L4_mat(:,1); y_4=g0L4_mat(:,2);
plt4=plot(x_4,y_4); hold on; plt4.LineWidth=1.5; plt4.Color=[0,0,1,a1(4)];
x_5=g0L5_mat(:,1); y_5=g0L5_mat(:,2);
plt5=plot(x_5,y_5); hold on; plt5.LineWidth=1.5; plt5.Color=[0,0,1,a1(5)];
x_6=g1L1_mat(:,1); y_6=g1L1_mat(:,2);
plt6=plot(x_6,y_6); hold on; plt6.LineWidth=1.5; plt6.Color=[1,0,0,a1(1)];
x_7=g1L2_mat(:,1); y_7=g1L2_mat(:,2);
plt7=plot(x_7,y_7); hold on; plt7.LineWidth=1.5; plt7.Color=[1,0,0,a1(2)];
x_8=g1L3_mat(:,1); y_8=g1L3_mat(:,2);
plt8=plot(x_8,y_8); hold on; plt8.LineWidth=1.5; plt8.Color=[1,0,0,a1(3)];
x_9=g1L4_mat(:,1); y_9=g1L4_mat(:,2);
plt9=plot(x_9,y_9); hold on; plt9.LineWidth=1.5; plt9.Color=[1,0,0,a1(4)];
x_10=g1L5_mat(:,1); y_10=g1L5_mat(:,2);
plt10=plot(x_10,y_10); hold on; plt10.LineWidth=1.5; plt10.Color=[1,0,0,a1(5)];
xL1 = xlabel('time(s)'); yL1 = ylabel('Em'); xL1.FontSize = 15; yL1.FontSize = 15;
saveas(gcf,'tmErc2.png'); saveas(gcf,'tmErc2.eps','epsc2'); close all;
fig2=figure(2);
x_0=bkg_mat(:,1); y_0=bkg_mat(:,3);
plt0=plot(x_0,y_0); hold on; plt0.LineWidth=1.5; plt0.Color=[0,0,0];
x_1=g0L1_mat(:,1); y_1=g0L1_mat(:,3);
plt1=plot(x_1,y_1); hold on; plt1.LineWidth=1.5; plt1.Color=[0,0,1,a1(1)];
x_2=g0L2_mat(:,1); y_2=g0L2_mat(:,3);
plt2=plot(x_2,y_2); hold on; plt2.LineWidth=1.5; plt2.Color=[0,0,1,a1(2)];
x_3=g0L3_mat(:,1); y_3=g0L3_mat(:,3);
plt3=plot(x_3,y_3); hold on; plt3.LineWidth=1.5; plt3.Color=[0,0,1,a1(3)];
x_5=g0L5_mat(:,1); y_5=g0L5_mat(:,3);
plt5=plot(x_5,y_5); hold on; plt5.LineWidth=1.5; plt5.Color=[0,0,1,a1(5)];
x_6=g1L1_mat(:,1); y_6=g1L1_mat(:,3);
plt6=plot(x_6,y_6); hold on; plt6.LineWidth=1.5; plt6.Color=[1,0,0,a1(1)];
x_7=g1L2_mat(:,1); y_7=g1L2_mat(:,3);
plt7=plot(x_7,y_7); hold on; plt7.LineWidth=1.5; plt7.Color=[1,0,0,a1(2)];
x_8=g1L3_mat(:,1); y_8=g1L3_mat(:,3);
plt8=plot(x_8,y_8); hold on; plt8.LineWidth=1.5; plt8.Color=[1,0,0,a1(3)];
x_9=g1L4_mat(:,1); y_9=g1L4_mat(:,3);
plt9=plot(x_9,y_9); hold on; plt9.LineWidth=1.5; plt9.Color=[1,0,0,a1(4)];
x_10=g1L5_mat(:,1); y_10=g1L5_mat(:,3);
plt10=plot(x_10,y_10); hold on; plt10.LineWidth=1.5; plt10.Color=[1,0,0,a1(5)];
xL1 = xlabel('time(s)'); yL1 = ylabel('Ep'); xL1.FontSize = 15; yL1.FontSize = 15;
saveas(gcf,'tpErc2.png'); saveas(gcf,'tpErc2.eps','epsc2'); close all;
rs_Tmepe_t125.m
clearvars; clc; % rs_Tmepe_t125.m
bkg_mat=importdata("data\gL\rs_bkg");
g0L1_mat=importdata("data\gL\rs_g0L1");
g0L2_mat=importdata("data\gL\rs_g0L2");
g0L4_mat=importdata("data\gL\rs_g0L4");
g0L5_mat=importdata("data\gL\rs_g0L5");
g1L1_mat=importdata("data\gL\rs_g1L1");
g1L2_mat=importdata("data\gL\rs_g1L2");
g1L3_mat=importdata("data\gL\rs_g1L3");
g1L4_mat=importdata("data\gL\rs_g1L4");
g1L5_mat=importdata("data\gL\rs_g1L5");
a1=0:0.2:1; a1 = a1(1,2:size(a1,2));
fig1=figure(1);
x_0=bkg_mat(:,1); y_0=bkg_mat(:,2);
plt0=plot(x_0,y_0); hold on; plt0.LineWidth=1.5; plt0.Color=[0,0,0];
x_1=g0L1_mat(:,1); y_1=g0L1_mat(:,2);
plt1=plot(x_1,y_1); hold on; plt1.LineWidth=1.5; plt1.Color=[0,0,1,a1(1)];
x_2=g0L2_mat(:,1); y_2=g0L2_mat(:,2);
plt2=plot(x_2,y_2); hold on; plt2.LineWidth=1.5; plt2.Color=[0,0,1,a1(2)];
x_4=g0L4_mat(:,1); y_4=g0L4_mat(:,2);
plt4=plot(x_4,y_4); hold on; plt4.LineWidth=1.5; plt4.Color=[0,0,1,a1(4)];
x_5=g0L5_mat(:,1); y_5=g0L5_mat(:,2);
plt5=plot(x_5,y_5); hold on; plt5.LineWidth=1.5; plt5.Color=[0,0,1,a1(5)];
x_6=g1L1_mat(:,1); y_6=g1L1_mat(:,2);
plt6=plot(x_6,y_6); hold on; plt6.LineWidth=1.5; plt6.Color=[1,0,0,a1(1)];
x_7=g1L2_mat(:,1); y_7=g1L2_mat(:,2);
plt7=plot(x_7,y_7); hold on; plt7.LineWidth=1.5; plt7.Color=[1,0,0,a1(2)];
x_8=g1L3_mat(:,1); y_8=g1L3_mat(:,2);
plt8=plot(x_8,y_8); hold on; plt8.LineWidth=1.5; plt8.Color=[1,0,0,a1(3)];
x_9=g1L4_mat(:,1); y_9=g1L4_mat(:,2);
plt9=plot(x_9,y_9); hold on; plt9.LineWidth=1.5; plt9.Color=[1,0,0,a1(4)];
x_10=g1L5_mat(:,1); y_10=g1L5_mat(:,2);
plt10=plot(x_10,y_10); hold on; plt10.LineWidth=1.5; plt10.Color=[1,0,0,a1(5)];
xL1 = xlabel('time(s)'); yL1 = ylabel('Em'); xL1.FontSize = 15; yL1.FontSize = 15;
saveas(gcf,'tmErs2.png'); saveas(gcf,'tmErs2.eps','epsc2'); close all;
fig2=figure(2);
x_0=bkg_mat(:,1); y_0=bkg_mat(:,3);
plt0=plot(x_0,y_0); hold on; plt0.LineWidth=1.5; plt0.Color=[0,0,0];
x_1=g0L1_mat(:,1); y_1=g0L1_mat(:,3);
plt1=plot(x_1,y_1); hold on; plt1.LineWidth=1.5; plt1.Color=[0,0,1,a1(1)];
x_2=g0L2_mat(:,1); y_2=g0L2_mat(:,3);
plt2=plot(x_2,y_2); hold on; plt2.LineWidth=1.5; plt2.Color=[0,0,1,a1(2)];
x_4=g0L4_mat(:,1); y_4=g0L4_mat(:,3);
plt4=plot(x_4,y_4); hold on; plt4.LineWidth=1.5; plt4.Color=[0,0,1,a1(4)];
x_5=g0L5_mat(:,1); y_5=g0L5_mat(:,3);
plt5=plot(x_5,y_5); hold on; plt5.LineWidth=1.5; plt5.Color=[0,0,1,a1(5)];
x_6=g1L1_mat(:,1); y_6=g1L1_mat(:,3);
plt6=plot(x_6,y_6); hold on; plt6.LineWidth=1.5; plt6.Color=[1,0,0,a1(1)];
x_7=g1L2_mat(:,1); y_7=g1L2_mat(:,3);
plt7=plot(x_7,y_7); hold on; plt7.LineWidth=1.5; plt7.Color=[1,0,0,a1(2)];
x_8=g1L3_mat(:,1); y_8=g1L3_mat(:,3);
plt8=plot(x_8,y_8); hold on; plt8.LineWidth=1.5; plt8.Color=[1,0,0,a1(3)];
x_9=g1L4_mat(:,1); y_9=g1L4_mat(:,3);
plt9=plot(x_9,y_9); hold on; plt9.LineWidth=1.5; plt9.Color=[1,0,0,a1(4)];
x_10=g1L5_mat(:,1); y_10=g1L5_mat(:,3);
plt10=plot(x_10,y_10); hold on; plt10.LineWidth=1.5; plt10.Color=[1,0,0,a1(5)];
xL1 = xlabel('time(s)'); yL1 = ylabel('Ep'); xL1.FontSize = 15; yL1.FontSize = 15;
saveas(gcf,'tpErs2.png'); saveas(gcf,'tpErs2.eps','epsc2'); close all;
2Dshear.mcr
#!MC 1410
$!PAGECONTROL CLEAR
$!ReadDataSet '"StandardSyntax" "1.0" "FEALoaderVersion" "436" "FILENAME_File" "C:\myPC\myFile\SJTU_G11\Sundry\research\postPro\case\system\controlDict" "AutoAssignStrandIDs" "Yes"'
DataSetReader = 'OpenFOAM (FEA)'
$!PlotType = Cartesian2D
$!TwoDAxis XDetail{RangeMin = 0.0}
$!TwoDAxis XDetail{RangeMax = 1.0}
$!TwoDAxis AxisMode = Independent
$!TwoDAxis YDetail{RangeMin = 0.0}
$!TwoDAxis YDetail{RangeMax = 1.0}
$!TwoDAxis YDetail{Ticks{ShowOnAxisLine = No}}
$!TwoDAxis YDetail{TickLabel{ShowOnAxisLine = No}}
$!TwoDAxis YDetail{Title{ShowOnAxisLine = No}}
$!TwoDAxis YDetail{AxisLine{Show = No}}
$!TwoDAxis XDetail{Ticks{ShowOnAxisLine = No}}
$!TwoDAxis XDetail{TickLabel{ShowOnAxisLine = No}}
$!TwoDAxis XDetail{Title{ShowOnAxisLine = No}}
$!TwoDAxis XDetail{AxisLine{Show = No}}
$!View MakeCurrentViewNice
$!FrameLayout ShowBorder = No
$!TwoDAxis GridArea{DrawBorder = No}
$!FieldLayers ShowContour = Yes
$!GlobalTime SolutionTime = 0.05
$!FieldMap [4] Shade{Show = No}
$!FieldMap [4] Contour{ContourType = Lines}
$!SetContourVar
Var = 'alpha1'
ContourGroup = 1
$!ContourLevels New
ContourGroup = 1
RawData
1
0.5
$!FieldMap [4] Contour{LinePattern = Solid}
$!FieldMap [4] Contour{PatternLength = 0.5}
$!FieldMap [4] Contour{LineThickness = 0.5}
$!GlobalContour 1 Legend{Show = No}
$!FieldMap [4] Mesh{Color = Custom2}
$!FieldMap [4] Contour{Color = Red}
3DdamBreak.mcr
#!MC 1410
$!PAGECONTROL CLEAR
$!ReadDataSet '"StandardSyntax" "1.0" "FEALoaderVersion" "436" "FILENAME_File" "C:\myPC\myFile\SJTU_G11\Sundry\research\postPro\case\system\controlDict" "AutoAssignStrandIDs" "Yes"'
DataSetReader = 'OpenFOAM (FEA)'
$!FrameName = 'alpha.water'
$!GlobalTime SolutionTime = 0.0
$!ThreeDView
PSIAngle = 60.0
ThetaAngle = 145.0
AlphaAngle = 0.0
ViewerPosition
{
X = -4.55
Y = 7.75
Z = 5.6
}
ViewWidth = 1.6
$!ActiveFieldMaps -= [2]
$!ActiveFieldMaps -= [3]
$!IsoSurfaceLayers Show = Yes
$!IsoSurfaceAttributes 1 DefinitionContourGroup = 1
$!SetContourVar
Var = 'alpha.water'
ContourGroup = 1
$!ContourLevels Add
ContourGroup = 1
RawData
1
0.5
$!IsoSurfaceAttributes 1 Shade{Show = Yes}
$!IsoSurfaceAttributes 1 IsoSurfaceSelection = ThreeSpecificValues
$!IsoSurfaceAttributes 1 Isovalue1 = 0.5
$!IsoSurfaceAttributes 1 Isovalue2 = 0.75
$!IsoSurfaceAttributes 1 Isovalue3 = 0.25
$!IsoSurfaceAttributes 1 Contour{Show = No}
$!GlobalContour 1 Legend{Show = No}
$!IsoSurfaceAttributes 1 Shade{Color = Blue}
$!ThreeDAxis FrameAxis{Show = No}
$!IsoSurfaceAttributes 1 Effects{UseTranslucency = Yes}
$!IsoSurfaceAttributes 1 Effects{SurfaceTranslucency = 70}
$!FrameLayout ShowBorder = No
$!FieldLayers ShowEdge = Yes
$!FieldMap [1] EdgeLayer{Show = Yes}
$!View FitSurfaces
ConsiderBlanking = Yes
$!FieldMap [4] Shade{Color = Yellow}
$!RedrawAll
$!CreateNewFrame
XYPos
{
X = 1.0
Y = 2.0
}
Width = 9.0
Height = 6.0
$!FrameLayout ShowBorder = No
$!FrameLayout IsTransparent = Yes
$!FrameName = 'Frame Front'
$!LOOP 11
$!VARSET |time| = (0.25*(|LOOP|-1))
$!FrameControl ActivateByNumber
Frame = 1
$!GlobalTime SolutionTime = |time|
$!VARSET |times| = (|time|*100)
$!VARSET |FNAME| = "damBreak3d|times|"
$!FrameControl ActivateByNumber
Frame = 2
$!ExportSetup ExportFormat = EPS
$!ExportSetup ImageWidth = 960
$!ExportSetup PrintRenderType = Image
$!ExportSetup ExportFName = 'C:\myPC\myFile\SJTU_G11\Sundry\research\postPro\|FNAME|.eps'
$!Export
ExportRegion = CurrentFrame
$!ExportSetup ExportFormat = JPEG
$!ExportSetup ExportRegion = CurrentFrame
$!ExportSetup ImageWidth = 1000
$!ExportSetup ExportFName = 'C:\myPC\myFile\SJTU_G11\Sundry\research\postPro\|FNAME|.jpeg'
$!Export
ExportRegion = CurrentFrame
$!ENDLOOP
# $!QUIT
3DdamBreakOver.mcr
#!MC 1410
$!PAGECONTROL CLEAR
$!ReadDataSet '"StandardSyntax" "1.0" "FEALoaderVersion" "436" "FILENAME_File" "C:\myPC\myFile\SJTU_G11\Sundry\research\postPro\case\system\controlDict" "AutoAssignStrandIDs" "Yes"'
DataSetReader = 'OpenFOAM (FEA)'
$!FrameName = 'alpha.water'
$!GlobalTime SolutionTime = 0.0
$!ThreeDView
PSIAngle = 60.0
ThetaAngle = 145.0
AlphaAngle = 0.0
ViewerPosition
{
X = -4.55
Y = 7.75
Z = 5.6
}
ViewWidth = 1.6
$!ActiveFieldMaps -= [2]
$!ActiveFieldMaps -= [3]
$!ActiveFieldMaps -= [5]
$!IsoSurfaceLayers Show = Yes
$!IsoSurfaceAttributes 1 DefinitionContourGroup = 1
$!SetContourVar
Var = 'alpha.water'
ContourGroup = 1
$!ContourLevels Add
ContourGroup = 1
RawData
1
0.5
$!IsoSurfaceAttributes 1 Shade{Show = Yes}
$!IsoSurfaceAttributes 1 IsoSurfaceSelection = ThreeSpecificValues
$!IsoSurfaceAttributes 1 Isovalue1 = 0.5
$!IsoSurfaceAttributes 1 Isovalue2 = 0.75
$!IsoSurfaceAttributes 1 Isovalue3 = 0.25
$!IsoSurfaceAttributes 1 Contour{Show = No}
$!GlobalContour 1 Legend{Show = No}
$!IsoSurfaceAttributes 1 Shade{Color = Blue}
$!ThreeDAxis FrameAxis{Show = No}
$!IsoSurfaceAttributes 1 Effects{UseTranslucency = Yes}
$!IsoSurfaceAttributes 1 Effects{SurfaceTranslucency = 70}
$!FrameLayout ShowBorder = No
$!FieldLayers ShowEdge = Yes
$!FieldMap [1] EdgeLayer{Show = Yes}
$!View FitSurfaces
ConsiderBlanking = Yes
$!FieldMap [4] Shade{Color = Yellow}
$!RedrawAll
$!CreateNewFrame
XYPos
{
X = 1.0
Y = 2.0
}
Width = 9.0
Height = 6.0
$!FrameLayout ShowBorder = No
$!FrameLayout IsTransparent = Yes
$!FrameName = 'Frame Front'
$!LOOP 11
$!VARSET |time| = (0.25*(|LOOP|-1))
$!FrameControl ActivateByNumber
Frame = 1
$!GlobalTime SolutionTime = |time|
$!VARSET |times| = (|time|*100)
$!VARSET |FNAME| = "damBreak3d|times|"
$!FrameControl ActivateByNumber
Frame = 2
$!ExportSetup ExportFormat = EPS
$!ExportSetup ImageWidth = 960
$!ExportSetup PrintRenderType = Image
$!ExportSetup ExportFName = 'C:\myPC\myFile\SJTU_G11\Sundry\research\postPro\|FNAME|.eps'
$!Export
ExportRegion = CurrentFrame
$!ExportSetup ExportFormat = JPEG
$!ExportSetup ExportRegion = CurrentFrame
$!ExportSetup ImageWidth = 1000
$!ExportSetup ExportFName = 'C:\myPC\myFile\SJTU_G11\Sundry\research\postPro\|FNAME|.jpeg'
$!Export
ExportRegion = CurrentFrame
$!ENDLOOP
# $!QUIT
这些MATLAB脚本主要涉及从CSV和自定义格式文件中导入数据,然后使用散点图和线图对时间序列数据进行可视化。颜色映射被用来区分不同数据集,同时保存生成的图像为PNG和EPS格式。
1084

被折叠的 条评论
为什么被折叠?



