Ejemplo n.º 1
0
f.read(B, 'B')
f.read(mask, 'mask')

config = default_config()
config['output_path'] = out_dir

model = model.Model(config)
model.set_mesh(mesh)
model.set_surface_and_bed(S, B)
model.set_subdomains(ff, cf, ff_acc)
model.initialize_variables()

model.init_mask(mask)
model.init_U(in_dir + 'u.xml', in_dir + 'v.xml', in_dir + 'w.xml')
model.init_T(in_dir + 'T.xml')
model.init_W(in_dir + 'W.xml')
model.init_E(1.0)

model.calc_eta()

us = model.vert_extrude(model.u, d='down')
vs = model.vert_extrude(model.v, d='down')
ws = model.vert_extrude(model.w, d='down')

etabar = model.calc_vert_average(model.eta)
ubar = model.calc_vert_average(model.u)
vbar = model.calc_vert_average(model.v)
wbar = model.calc_vert_average(model.w)

model.save_pvd(etabar, 'etabar')
model.save_pvd(ubar, 'ubar')
Ejemplo n.º 2
0
model = model.Model(config)
model.set_mesh(mesh)
model.set_surface_and_bed(S, B)
model.set_subdomains(ff, cf, ff_acc)
model.initialize_variables()

model.init_viscosity_mode('full')
model.init_mask(mask)
model.init_q_geo(model.ghf)
model.init_T_surface(T_s)
model.init_adot(adot)
model.init_E(1.0)

model.init_T(in_dir + 'T.xml')  # temp
model.init_beta(in_dir + 'beta.xml')  # friction
model.init_W(in_dir + 'W.xml')  # water
model.init_E_shf(in_dir + 'E_shf.xml')  # enhancement
model.init_U(in_dir + 'u.xml', in_dir + 'v.xml', in_dir + 'w.xml')

# solve the BP model :
F = solvers.SteadySolver(model, config)
F.solve()

model.save_xml(model.T, 'T')
model.save_xml(model.W, 'W')
model.save_xml(model.u, 'u')
model.save_xml(model.v, 'v')
model.save_xml(model.w, 'w')
model.save_xml(model.Mb, 'Mb')
Ejemplo n.º 3
0
model.init_q_geo(model.ghf)
model.init_T_surface(T_s)
model.init_adot(adot)
model.init_U_ob(u_ob, v_ob)
model.init_E(1.0)

#model.init_u_lat(model.u_ob)
#model.init_v_lat(model.v_ob)
model.init_u_lat(0.0)
model.init_v_lat(0.0)
model.init_w_lat(0.0)

# use T0 and beta0 from the previous run :
if i > 0:
    model.init_T(dir_b + str(i - 1) + '/T.xml')  # temp
    model.init_W(dir_b + str(i - 1) + '/W.xml')  # water
    model.init_beta(dir_b + str(i - 1) + '/beta.xml')  # friction
else:
    model.init_T(model.T_w - 30.0)
    model.init_beta_SIA()
    #model.init_beta(100.0)

model.save_pvd(model.beta, 'beta0')
model.save_pvd(model.U_ob, 'U_ob')

F = solvers.SteadySolver(model, config)
F.solve()

params['newton_solver']['maximum_iterations'] = 25
config['velocity']['solve_vert_velocity'] = False
config['velocity']['use_U0'] = False