1 | %Test Name: EISMINTRoundIceSheetStaticFS
|
---|
2 | %The aim of this program is to compare a model with an analytical solution given in SSA EISMINT : Lessons in Ice-Sheet Modeling.
|
---|
3 | printingflag=false;
|
---|
4 |
|
---|
5 | numlayers=10;
|
---|
6 | resolution=30000.;
|
---|
7 |
|
---|
8 | %To begin with the numerical model
|
---|
9 | md=model();
|
---|
10 | md=roundmesh(md,750000.,resolution);
|
---|
11 | md=setmask(md,'',''); %We can not test iceshelves nor ice rises with this analytical solution
|
---|
12 | md=parameterize(md,'../Par/RoundSheetStaticEISMINT.par');
|
---|
13 |
|
---|
14 | %Calculation of the analytical 2d velocity field
|
---|
15 | constant=0.3;
|
---|
16 | vx_obs=constant/2.*md.mesh.x.*(md.geometry.thickness).^-1;
|
---|
17 | vy_obs=constant/2.*md.mesh.y.*(md.geometry.thickness).^-1;
|
---|
18 | vel_obs=sqrt((md.inversion.vx_obs).^2+(md.inversion.vy_obs).^2);
|
---|
19 |
|
---|
20 | %We extrude the model to have a 3d model
|
---|
21 | md=extrude(md,numlayers,1.);
|
---|
22 | md=setflowequation(md,'FS','all');
|
---|
23 |
|
---|
24 | %Spc the nodes on the bed
|
---|
25 | pos=find(md.mesh.vertexonbase);
|
---|
26 | md.stressbalance.spcvx(pos)=0.;
|
---|
27 | md.stressbalance.spcvy(pos)=0.;
|
---|
28 | md.stressbalance.spcvz(pos)=0.;
|
---|
29 |
|
---|
30 | %Now we can solve the problem
|
---|
31 | md.cluster=generic('name',oshostname(),'np',8);
|
---|
32 | md=solve(md,'Stressbalance');
|
---|
33 |
|
---|
34 | %Calculate the depth averaged velocity field (2d):
|
---|
35 | vx=(md.results.StressbalanceSolution.Vx);
|
---|
36 | vy=(md.results.StressbalanceSolution.Vy);
|
---|
37 | vel=zeros(md.mesh.numberofvertices2d,1);
|
---|
38 |
|
---|
39 | for i=1:md.mesh.numberofvertices2d
|
---|
40 | node_vel=0.;
|
---|
41 | for j=1:md.mesh.numberoflayers-1
|
---|
42 | node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*...
|
---|
43 | (sqrt(vx(i+j*md.mesh.numberofvertices2d,1).^2+vy(i+j*md.mesh.numberofvertices2d,1).^2)+...
|
---|
44 | sqrt(vx(i+(j-1)*md.mesh.numberofvertices2d,1).^2+vy(i+(j-1)*md.mesh.numberofvertices2d,1).^2));
|
---|
45 | end
|
---|
46 | vel(i,1)=node_vel;
|
---|
47 | end
|
---|
48 |
|
---|
49 | %Plot of the velocity from the exact and calculated solutions
|
---|
50 | figure(1)
|
---|
51 | subplot(2,2,1)
|
---|
52 | p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
|
---|
53 | vel,'FaceColor','interp','EdgeColor','none');
|
---|
54 | title('Modelled velocity','FontSize',14,'FontWeight','bold')
|
---|
55 | colorbar;
|
---|
56 | caxis([0 200]);
|
---|
57 |
|
---|
58 | subplot(2,2,2)
|
---|
59 | p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
|
---|
60 | vel_obs,'FaceColor','interp','EdgeColor','none');
|
---|
61 | title('Analytical velocity','FontSize',14,'FontWeight','bold')
|
---|
62 | colorbar;
|
---|
63 | caxis([0 200]);
|
---|
64 |
|
---|
65 | subplot(2,2,3)
|
---|
66 | hold on;
|
---|
67 | plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.');
|
---|
68 | plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.');
|
---|
69 | title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold');
|
---|
70 | xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold');
|
---|
71 | ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold');
|
---|
72 | legend('calculated velocity','exact velocity');
|
---|
73 | axis([0 750000 0 200]);
|
---|
74 | hold off;
|
---|
75 |
|
---|
76 | subplot(2,2,4)
|
---|
77 | p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
|
---|
78 | abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none');
|
---|
79 | title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
|
---|
80 | colorbar;
|
---|
81 | caxis([0 100]);
|
---|
82 |
|
---|
83 | if printingflag,
|
---|
84 | set(gcf,'Color','w')
|
---|
85 | printmodel('FSstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
|
---|
86 | system(['mv FSstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet']);
|
---|
87 | end
|
---|
88 |
|
---|
89 | %Fields and tolerances to track changes
|
---|
90 | field_names ={ ...
|
---|
91 | 'Vx','Vy','Vel', ...
|
---|
92 | };
|
---|
93 | field_tolerances={ ...
|
---|
94 | 1e-12,1e-12,1e-12, ...
|
---|
95 | };
|
---|
96 | field_values={ ...
|
---|
97 | vx,vy,vel, ...
|
---|
98 | };
|
---|