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