source: issm/trunk-jpl/test/Par/SquareShelfConstrained.js@ 22575

Last change on this file since 22575 was 22575, checked in by Mathieu Morlighem, 7 years ago

CHG: no more overshoot

  • Property svn:executable set to *
File size: 2.8 KB
RevLine 
[19718]1function parameterize(md){
2
3 //Geometry
4 var hmin=300;
5 var hmax=1000;
6 var ymin=ArrayMin(md.mesh.y);
7 var ymax=ArrayMax(md.mesh.y);
8 var xmin=ArrayMin(md.mesh.x);
9 var xmax=ArrayMax(md.mesh.x);
10
11 md.geometry.thickness=NewArrayFill(md.mesh.numberofvertices,0);
12 md.geometry.base=NewArrayFill(md.mesh.numberofvertices,0);
13 md.geometry.surface=NewArrayFill(md.mesh.numberofvertices,0);
14 md.geometry.bed=NewArrayFill(md.mesh.numberofvertices,0);
15
16 for(i=0;i<md.mesh.numberofvertices;i++){
17 md.geometry.thickness[i]=hmax+(hmin-hmax)*(md.mesh.y[i]-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x[i]-xmin)/(xmax-xmin);
18 md.geometry.base[i]=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness[i];
19 md.geometry.surface[i]=md.geometry.base[i]+md.geometry.thickness[i];
[19753]20 md.geometry.bed[i]=md.geometry.base[i]-10;
[19718]21 }
22
[19753]23 //Initial velocity: no ncreader for now, so we just load arrays.
24 /*x = transpose(ncread('../Data/SquareShelfConstrained.nc','x'));
[19718]25 y = transpose(ncread('../Data/SquareShelfConstrained.nc','y'));
26 vx = transpose(ncread('../Data/SquareShelfConstrained.nc','vx'));
27 vy = transpose(ncread('../Data/SquareShelfConstrained.nc','vy'));
[19753]28 index = transpose(ncread('../Data/SquareShelfConstrained.nc','index'));*/
29
[19718]30 md.initialization.vx=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y);
31 md.initialization.vy=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y);
[19753]32 md.initialization.vel=ArrayMag(md.initialization.vx,md.initialization.vy);
33 md.initialization.vz=NewArrayFill(md.mesh.numberofvertices,0);
34 md.initialization.pressure=NewArrayFill(md.mesh.numberofvertices,0);
[19718]35
36 //Materials
[19753]37 md.initialization.temperature=NewArrayFill(md.mesh.numberofvertices,273-20);
[19718]38 md.materials.rheology_B=paterson(md.initialization.temperature);
[19753]39 md.materials.rheology_n=NewArrayFill(md.mesh.numberofelements,3);
[19718]40
41 //Surface mass balance and basal melting
[19753]42 md.smb.mass_balance=NewArrayFill(md.mesh.numberofvertices,10);
43 md.basalforcings.floatingice_melting_rate=NewArrayFill(md.mesh.numberofvertices,5.0);
44 md.basalforcings.groundedice_melting_rate=NewArrayFill(md.mesh.numberofvertices,5.0);
[19718]45
46 //Friction
[19753]47 md.friction.coefficient=NewArrayFill(md.mesh.numberofvertices,20);
48 for(var i=0;i<md.mesh.numberofvertices;i++)if(md.mask.groundedice_levelset[i]<0)md.friction.coefficient[i]=0;
49 md.friction.p=NewArrayFill(md.mesh.numberofelements,1);
50 md.friction.q=NewArrayFill(md.mesh.numberofelements,1);
[19718]51
52 //Numerical parameters
53 md.masstransport.stabilization=1;
54 md.thermal.stabilization=1;
[19768]55 md.verbose=new verbose(0);
[19718]56 md.settings.waitonlock=30;
57 md.stressbalance.restol=0.05;
58 md.stressbalance.reltol=0.05;
59 md.steadystate.reltol=0.05;
60 md.stressbalance.abstol=NaN;
61 md.timestepping.time_step=1;
62 md.timestepping.final_time=3;
63
64 //Deal with boundary conditions:
[19768]65 SetIceShelfBC(md);
[19718]66
67 //Change name so that no tests have the same name
[19768]68 md.miscellaneous.name='test101';
[19718]69}
Note: See TracBrowser for help on using the repository browser.