[13636] | 1 | import os.path
|
---|
| 2 | import numpy
|
---|
| 3 | import inspect
|
---|
[16170] | 4 | from verbose import verbose
|
---|
[13636] | 5 | from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
|
---|
[16170] | 6 | from paterson import paterson
|
---|
| 7 | from SetIceSheetBC import SetIceSheetBC
|
---|
[21170] | 8 | from arch import *
|
---|
[13636] | 9 |
|
---|
| 10 | #Start defining model parameters here
|
---|
| 11 |
|
---|
| 12 | #Geometry
|
---|
[13676] | 13 | hmin=300.
|
---|
| 14 | hmax=1000.
|
---|
[13636] | 15 | ymin=numpy.min(md.mesh.y)
|
---|
| 16 | ymax=numpy.max(md.mesh.y)
|
---|
[16063] | 17 | xmin=min(md.mesh.x)
|
---|
| 18 | xmax=max(md.mesh.x)
|
---|
[21409] | 19 | md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin)
|
---|
[17590] | 20 | md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20.
|
---|
| 21 | md.geometry.surface=md.geometry.base+md.geometry.thickness
|
---|
[13636] | 22 |
|
---|
| 23 | #Initial velocity
|
---|
[21170] | 24 | x = numpy.array(archread('../Data/SquareSheetConstrained.arch','x'))
|
---|
| 25 | y = numpy.array(archread('../Data/SquareSheetConstrained.arch','y'))
|
---|
| 26 | vx = numpy.array(archread('../Data/SquareSheetConstrained.arch','vx'));
|
---|
| 27 | vy = numpy.array(archread('../Data/SquareSheetConstrained.arch','vy'));
|
---|
| 28 | index = archread('../Data/SquareSheetConstrained.arch','index').astype(int);
|
---|
[13636] | 29 |
|
---|
| 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)
|
---|
[21409] | 32 | md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
|
---|
| 33 | md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
|
---|
[13636] | 34 |
|
---|
| 35 | #Materials
|
---|
[21409] | 36 | md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
|
---|
[13636] | 37 | md.materials.rheology_B=paterson(md.initialization.temperature)
|
---|
[21409] | 38 | md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
|
---|
[13636] | 39 |
|
---|
[18761] | 40 | #Calving
|
---|
[21409] | 41 | md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices))
|
---|
| 42 | md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices))
|
---|
[17438] | 43 |
|
---|
[13636] | 44 | #Friction
|
---|
[21409] | 45 | md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
|
---|
[15988] | 46 | md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
|
---|
[21409] | 47 | md.friction.p=numpy.ones((md.mesh.numberofelements))
|
---|
| 48 | md.friction.q=numpy.ones((md.mesh.numberofelements))
|
---|
[13636] | 49 |
|
---|
| 50 | #Numerical parameters
|
---|
[15771] | 51 | md.stressbalance.viscosity_overshoot=0.0
|
---|
[15767] | 52 | md.masstransport.stabilization=1.
|
---|
[13636] | 53 | md.thermal.stabilization=1.
|
---|
| 54 | md.verbose=verbose(0)
|
---|
[14102] | 55 | md.settings.waitonlock=30
|
---|
[15771] | 56 | md.stressbalance.restol=0.05
|
---|
[13636] | 57 | md.steadystate.reltol=0.05
|
---|
[15771] | 58 | md.stressbalance.reltol=0.05
|
---|
| 59 | md.stressbalance.abstol=float('NaN')
|
---|
[13636] | 60 | md.timestepping.time_step=1.
|
---|
| 61 | md.timestepping.final_time=3.
|
---|
| 62 |
|
---|
[14826] | 63 | #GIA:
|
---|
[21409] | 64 | md.gia.lithosphere_thickness=100.*numpy.ones((md.mesh.numberofvertices)); # in km
|
---|
| 65 | md.gia.mantle_viscosity=1.*10**21*numpy.ones((md.mesh.numberofvertices)); # in Pa.s
|
---|
[14826] | 66 | md.materials.lithosphere_shear_modulus=6.7*10**10; # in Pa
|
---|
| 67 | md.materials.lithosphere_density=3.32; # in g/cm^-3
|
---|
| 68 | md.materials.mantle_shear_modulus=1.45*10**11; # in Pa
|
---|
| 69 | md.materials.mantle_density=3.34; # in g/cm^-3
|
---|
| 70 |
|
---|
[13636] | 71 | #Boundary conditions:
|
---|
| 72 | md=SetIceSheetBC(md)
|
---|
| 73 |
|
---|
| 74 | #Change name so that no test have the same name
|
---|
| 75 | if len(inspect.stack()) > 2:
|
---|
| 76 | md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
|
---|