source: issm/trunk-jpl/test/Par/SquareSheetConstrained.py@ 24862

Last change on this file since 24862 was 24862, checked in by Mathieu Morlighem, 5 years ago

CHG: renaming groundedice_levelset -> ocean_levelset (negative if ocean present, positive outside

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