Changeset 4884
- Timestamp:
- 07/29/10 12:49:25 (15 years ago)
- Location:
- issm/trunk/test/Validation/RoundIceSheet
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/test/Validation/RoundIceSheet/Circ.par
r3768 r4884 1 1 %Ok, start defining model parameters here 2 md.np=3; 3 md.cluster='wilkes'; 2 4 3 5 disp(' creating thickness'); … … 39 41 disp(' boundary conditions for diagnostic model: '); 40 42 %Build gridonicefront, array of boundary grids belonging to the icefront: 41 gridonicefront=double(md.gridonboundary); 42 43 md.gridondirichlet_diag=zeros(md.numberofgrids,1); 44 pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1; 45 md.dirichletvalues_diag=zeros(md.numberofgrids,2); 43 md=SetMarineIceSheetBC(md,'Front.exp'); 46 44 47 45 radius=sqrt((md.x).*md.x+(md.y).*md.y); 48 pos=find(radius==min(radius)); md.gridondirichlet_diag(pos)=1;46 pos=find(radius==min(radius)); 49 47 md.x(pos)=0; md.y(pos)=0; %the closest node to the center is changed to be exactly at the center 50 48 51 pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2))); 52 md.segmentonneumann_diag=md.segments(pos,:); 53 md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure) 54 55 disp(' boundary conditions for thermal model: '); 56 md.gridondirichlet_thermal=zeros(md.numberofgrids,1); 49 md.spcvelocity(pos,1:3)=1; 50 md.spcvelocity(pos,4:6)=0; -
issm/trunk/test/Validation/RoundIceSheet/runme.m
r899 r4884 3 3 %This solution is valid for a circular contour 4 4 5 %You can adjust the parameters numberofpoints and density to refine the mesh and check the precision of your solution. You can change the number of layers of the domain with the parameter layernumber. 5 %You can adjust the parameters resolution(density) and the numberoflayers of the model to refine the mesh and check the precision of your solution. You can change the number of layers of the domain with the parameter layernumber. 6 numlayers=10; 7 resolution=40000; 6 8 7 9 %To begin with the numerical model 8 10 md=model; 9 11 10 numberofgrids=20; 11 density=190000; 12 layernumber=4; 13 14 %First we have to create the domain outline 15 contour=CreateDomainOutline(numberofgrids,750000); 16 17 expgen('DomainOutline.exp',contour,1); 18 md=mesh(md,'DomainOutline.exp',density) 19 20 %move the closest node to the center 21 [mini pos]=min(md.x.^2+md.y.^2); 22 md.x(pos)=0; 23 md.y(pos)=0; 24 25 %Then we have to create the geography and the parameters of the mesh 12 md=roundmesh(md,750000,resolution); 26 13 md=geography(md,'',''); %We can not test iceshelves nor ice rises with this analytical solution 27 14 28 15 %We now create a file Front.exp needed to parameterize but the analytical solution can't support an icefront so this file is empty 29 front=CreateDomainOutline(numberofgrids,1000000); 30 16 front=CreateDomainOutline(40,1000000); 31 17 expgen('Front.exp',front,1); 32 33 18 md=parameterize(md,'Circ.par'); 34 19 … … 40 25 41 26 %We extrude the model to have a 3d model 42 md=extrude(md, layernumber,3);27 md=extrude(md,numlayers,1); 43 28 md=setelementstype(md,'Pattyn','all'); 44 29 45 30 %Spc the grids on the bed 46 31 pos=find(md.gridonbed); 47 md. gridondirichlet_diag(pos)=1;32 md.spcvelocity(pos,1:3)=1; 48 33 34 md.verbose=10; 49 35 %Now we can solve the problem 50 md=solve(md,'analysis_type', 'diagnostic','package','ice');36 md=solve(md,'analysis_type',DiagnosticSolutionEnum); 51 37 52 38 %Calculate the depth averaged velocity field (2d): 53 39 vel=zeros(md.numberofgrids2d,1); 54 40 41 vx=zeros(md.numberofgrids,1); 42 vx(md.results.DiagnosticSolution.Vx.index)=md.results.DiagnosticSolution.Vx.value; 43 vy=zeros(md.numberofgrids,1); 44 vy(md.results.DiagnosticSolution.Vy.index)=md.results.DiagnosticSolution.Vy.value; 45 55 46 grid_vel=0; 56 47 for i=1:md.numberofgrids2d 57 48 for j=1:(md.numlayers-1) 58 grid_vel=grid_vel+1/(2*(md.numlayers-1))*(sqrt( md.results.diagnostic.vx(i+j*md.numberofgrids2d,1).^2+...59 md.results.diagnostic.vy(i+j*md.numberofgrids2d,1).^2)+...60 sqrt( md.results.diagnostic.vx(i+(j-1)*md.numberofgrids2d,1).^2+md.results.diagnostic.vy(i+(j-1)*md.numberofgrids2d,1).^2));49 grid_vel=grid_vel+1/(2*(md.numlayers-1))*(sqrt(vx(i+j*md.numberofgrids2d,1).^2+... 50 vy(i+j*md.numberofgrids2d,1).^2)+... 51 sqrt(vx(i+(j-1)*md.numberofgrids2d,1).^2+vy(i+(j-1)*md.numberofgrids2d,1).^2)); 61 52 end 62 53 vel(i,1)=grid_vel;
Note:
See TracChangeset
for help on using the changeset viewer.