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