[25023] | 1 | #Test Name: SquareSheetHydrologyGlaDS
|
---|
| 2 | import numpy as np
|
---|
| 3 | from model import *
|
---|
| 4 | from triangle import triangle
|
---|
| 5 | from setmask import setmask
|
---|
| 6 | from setflowequation import setflowequation
|
---|
| 7 | from parameterize import parameterize
|
---|
| 8 | from solve import solve
|
---|
| 9 | from SetIceSheetBC import SetIceSheetBC
|
---|
| 10 | from generic import generic
|
---|
| 11 |
|
---|
[28013] | 12 | # Create model
|
---|
[25023] | 13 | md = triangle(model(), '../Exp/Square.exp', 50000.)
|
---|
| 14 | md.mesh.x = md.mesh.x / 100
|
---|
| 15 | md.mesh.y = md.mesh.y / 100
|
---|
| 16 | md.miscellaneous.name = 'testChannels'
|
---|
| 17 |
|
---|
[28013] | 18 | # Miscellaneous
|
---|
| 19 | md = setmask(md, '', '') # Everywhere grounded
|
---|
| 20 | md = setflowequation(md, 'SSA', 'all')
|
---|
| 21 | md.stressbalance.maxiter = 2 # Make sure it runs quickly...
|
---|
| 22 |
|
---|
| 23 | # Some constants
|
---|
[25023] | 24 | md.constants.g = 9.8
|
---|
| 25 | md.materials.rho_ice = 910
|
---|
| 26 |
|
---|
[28013] | 27 | # Geometry
|
---|
[25023] | 28 | md.geometry.surface = -0.02 * md.mesh.x + 320
|
---|
| 29 | md.geometry.bed = np.zeros((md.mesh.numberofvertices))
|
---|
| 30 | md.geometry.base = md.geometry.bed
|
---|
| 31 | md.geometry.thickness = md.geometry.surface - md.geometry.bed
|
---|
| 32 |
|
---|
[28013] | 33 | # Define initial conditions
|
---|
[25023] | 34 | md.initialization.vx = 1.0e-6 * md.constants.yts * np.ones((md.mesh.numberofvertices))
|
---|
| 35 | md.initialization.vy = np.zeros((md.mesh.numberofvertices))
|
---|
| 36 | md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
|
---|
| 37 | md.initialization.watercolumn = 0.03 * np.ones((md.mesh.numberofvertices))
|
---|
| 38 | md.initialization.hydraulic_potential = md.materials.rho_ice * md.constants.g * md.geometry.thickness
|
---|
| 39 |
|
---|
[28013] | 40 | #cMaterials
|
---|
[25029] | 41 | md.materials.rheology_B = (5e-25)**(-1./3.) * np.ones((md.mesh.numberofvertices))
|
---|
[25023] | 42 | md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
|
---|
| 43 |
|
---|
[28013] | 44 | #cFriction
|
---|
[25023] | 45 | md.friction.coefficient = np.zeros((md.mesh.numberofvertices))
|
---|
| 46 | md.friction.p = np.ones((md.mesh.numberofelements))
|
---|
| 47 | md.friction.q = np.ones((md.mesh.numberofelements))
|
---|
| 48 | #md.friction.coupling = 0
|
---|
| 49 |
|
---|
[28013] | 50 | #Bcoundary conditions:
|
---|
[25023] | 51 | md = SetIceSheetBC(md)
|
---|
| 52 |
|
---|
| 53 | md.inversion.iscontrol = 0
|
---|
| 54 | md.transient = transient.deactivateall(md.transient)
|
---|
| 55 | md.transient.ishydrology = 1
|
---|
| 56 |
|
---|
| 57 | # Set numerical conditions
|
---|
| 58 | md.timestepping.time_step = 0.1 / 365
|
---|
| 59 | md.timestepping.final_time = 0.4 / 365
|
---|
| 60 |
|
---|
| 61 | #Change hydrology class to Glads model
|
---|
| 62 | md.hydrology = hydrologyglads()
|
---|
| 63 | md.hydrology.ischannels = 1
|
---|
| 64 | md.hydrology.englacial_void_ratio = 1.e-5
|
---|
| 65 | md.hydrology.moulin_input = np.zeros((md.mesh.numberofvertices))
|
---|
| 66 | md.hydrology.neumannflux = np.zeros((md.mesh.numberofelements))
|
---|
| 67 | md.hydrology.bump_height = 1.e-1 * np.ones((md.mesh.numberofvertices))
|
---|
| 68 | md.hydrology.sheet_conductivity = 1.e-3 * np.ones((md.mesh.numberofvertices))
|
---|
[28013] | 69 | md.hydrology.channel_conductivity = 5.e-2 * np.ones((md.mesh.numberofvertices))
|
---|
[25023] | 70 |
|
---|
| 71 | # BCs for hydrology
|
---|
| 72 | pos = np.where(np.logical_and(md.mesh.x == 100, md.mesh.vertexonboundary))
|
---|
| 73 | md.hydrology.spcphi = np.nan * np.ones((md.mesh.numberofvertices))
|
---|
| 74 | md.hydrology.spcphi[pos] = md.materials.rho_ice * md.constants.g * md.geometry.thickness[pos]
|
---|
| 75 |
|
---|
| 76 | md.cluster = generic('np', 2)
|
---|
[28013] | 77 | md = solve(md, 'Transient') # Or 'tr'
|
---|
[25023] | 78 |
|
---|
[28013] | 79 | # Fields and tolerances to track changes
|
---|
[25023] | 80 | field_names = ['HydrologySheetThickness1', 'HydraulicPotential1', 'ChannelArea1',
|
---|
| 81 | 'HydrologySheetThickness2', 'HydraulicPotential2', 'ChannelArea2',
|
---|
| 82 | 'HydrologySheetThickness3', 'HydraulicPotential3', 'ChannelArea3',
|
---|
| 83 | 'HydrologySheetThickness4', 'HydraulicPotential4', 'ChannelArea4']
|
---|
[28013] | 84 | field_tolerances = [5e-11, 2e-08, 3e-07,
|
---|
| 85 | 2e-10, 2e-08, 4e-07,
|
---|
| 86 | 3e-10, 2e-08, 4e-07,
|
---|
| 87 | 4e-10, 1e-08, 4e-07]
|
---|
[25023] | 88 | field_values = [md.results.TransientSolution[0].HydrologySheetThickness,
|
---|
| 89 | md.results.TransientSolution[0].HydraulicPotential,
|
---|
| 90 | md.results.TransientSolution[0].ChannelArea,
|
---|
| 91 | md.results.TransientSolution[1].HydrologySheetThickness,
|
---|
| 92 | md.results.TransientSolution[1].HydraulicPotential,
|
---|
| 93 | md.results.TransientSolution[1].ChannelArea,
|
---|
| 94 | md.results.TransientSolution[2].HydrologySheetThickness,
|
---|
| 95 | md.results.TransientSolution[2].HydraulicPotential,
|
---|
| 96 | md.results.TransientSolution[2].ChannelArea,
|
---|
| 97 | md.results.TransientSolution[3].HydrologySheetThickness,
|
---|
| 98 | md.results.TransientSolution[3].HydraulicPotential,
|
---|
| 99 | md.results.TransientSolution[3].ChannelArea]
|
---|