[26358] | 1 | import inspect
|
---|
[13636] | 2 | import os.path
|
---|
[21657] | 3 | import numpy as np
|
---|
[26358] | 4 | from arch import *
|
---|
[13636] | 5 | from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
|
---|
[16170] | 6 | from paterson import paterson
|
---|
| 7 | from SetIceSheetBC import SetIceSheetBC
|
---|
[26358] | 8 | from verbose import verbose
|
---|
[13636] | 9 |
|
---|
| 10 | #Start defining model parameters here
|
---|
| 11 |
|
---|
[26358] | 12 | # Geometry
|
---|
| 13 | hmin = 300.0
|
---|
| 14 | hmax = 1000.0
|
---|
[24214] | 15 | ymin = np.min(md.mesh.y)
|
---|
| 16 | ymax = np.max(md.mesh.y)
|
---|
| 17 | xmin = np.min(md.mesh.x)
|
---|
| 18 | xmax = np.max(md.mesh.x)
|
---|
| 19 | md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin) + 0.1 * (hmin - hmax) * (md.mesh.x - xmin) / (xmax - xmin)
|
---|
[26358] | 20 | md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness + 20.0
|
---|
[26066] | 21 | md.geometry.bed = md.geometry.base
|
---|
[24214] | 22 | md.geometry.surface = md.geometry.base + md.geometry.thickness
|
---|
[13636] | 23 |
|
---|
[24214] | 24 | #Initial velocity
|
---|
| 25 | x = np.array(archread('../Data/SquareSheetConstrained.arch', 'x'))
|
---|
| 26 | y = np.array(archread('../Data/SquareSheetConstrained.arch', 'y'))
|
---|
| 27 | vx = np.array(archread('../Data/SquareSheetConstrained.arch', 'vx'))
|
---|
| 28 | vy = np.array(archread('../Data/SquareSheetConstrained.arch', 'vy'))
|
---|
| 29 | index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
|
---|
[13636] | 30 |
|
---|
[25455] | 31 | md.initialization.vx = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
|
---|
| 32 | md.initialization.vy = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
|
---|
[24214] | 33 | md.initialization.vz = np.zeros((md.mesh.numberofvertices))
|
---|
| 34 | md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
|
---|
[13636] | 35 |
|
---|
| 36 | #Materials
|
---|
[26358] | 37 | md.initialization.temperature = (273.0 - 20.0) * np.ones((md.mesh.numberofvertices))
|
---|
[24214] | 38 | md.materials.rheology_B = paterson(md.initialization.temperature)
|
---|
[26358] | 39 | md.materials.rheology_n = 3.0 * np.ones((md.mesh.numberofelements))
|
---|
[13636] | 40 |
|
---|
[18761] | 41 | #Calving
|
---|
[24214] | 42 | md.calving.calvingrate = np.zeros((md.mesh.numberofvertices))
|
---|
| 43 | md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
|
---|
[17438] | 44 |
|
---|
[13636] | 45 | #Friction
|
---|
[26358] | 46 | md.friction.coefficient = 20.0 * np.ones((md.mesh.numberofvertices))
|
---|
| 47 | md.friction.coefficient[np.where(md.mask.ocean_levelset < 0.0)[0]] = 0.0
|
---|
[24214] | 48 | md.friction.p = np.ones((md.mesh.numberofelements))
|
---|
| 49 | md.friction.q = np.ones((md.mesh.numberofelements))
|
---|
[13636] | 50 |
|
---|
| 51 | #Numerical parameters
|
---|
[26358] | 52 | md.masstransport.stabilization = 1.0
|
---|
| 53 | md.thermal.stabilization = 1.0
|
---|
[24214] | 54 | md.verbose = verbose(0)
|
---|
| 55 | md.settings.waitonlock = 30
|
---|
| 56 | md.stressbalance.restol = 0.05
|
---|
| 57 | md.steadystate.reltol = 0.05
|
---|
| 58 | md.stressbalance.reltol = 0.05
|
---|
| 59 | md.stressbalance.abstol = np.nan
|
---|
[26358] | 60 | md.timestepping.time_step = 1.0
|
---|
| 61 | md.timestepping.final_time = 3.0
|
---|
[24214] | 62 | md.groundingline.migration = 'None'
|
---|
[13636] | 63 |
|
---|
| 64 | #Boundary conditions:
|
---|
[24214] | 65 | md = SetIceSheetBC(md)
|
---|
[13636] | 66 |
|
---|
| 67 | #Change name so that no test have the same name
|
---|
| 68 | if len(inspect.stack()) > 2:
|
---|
[24214] | 69 | md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
|
---|