Пример #1
0
                          QXinit=Q_IN,
                          QYinit=0.)

################################################################################
#
# Boundary conditions:
#---------------------

fluvial_flowrates = [
    fk.FluvialFlowRate(ref=1,
                       flowrate=Q_IN,
                       x_flux_direction=1.0,
                       y_flux_direction=0.0)
]

fluvial_heights = [fk.FluvialHeight(ref=2, height=H_OUT)]
torrential_outs = [fk.TorrentialOut(ref=2)]

slides = [fk.Slide(ref=3), fk.Slide(ref=4)]

################################################################################
#
# Problem definition:
#--------------------

if FLOW == 'sub' or 'trans_shock':
    problem = fk.Problem(
        simutime,
        triangular_mesh,
        layer,
        primitives,
Пример #2
0
if not args.nographics:
    fk_plt.plot_init_1d(triangular_mesh, h_0, 'x', '$H_0$')

primitives = fk.Primitive(triangular_mesh,
                          layer,
                          height_funct=h_0,
                          Uinit=0.,
                          Vinit=0.)

################################################################################
#
# Boundary conditions:
#---------------------

fluvial_heights = [
    fk.FluvialHeight(ref=1, height=H_L),
    fk.FluvialHeight(ref=2, height=H_R)
]
slides = [fk.Slide(ref=3), fk.Slide(ref=4)]

################################################################################
#
# Problem definition:
#--------------------

problem = fk.Problem(
    simutime,
    triangular_mesh,
    layer,
    primitives,
    fluvial_heights=fluvial_heights,
Пример #3
0
fluvial_flowrates = [
    fk.FluvialFlowRate(ref=1,
                       time_dependent_flowrate=flowrate,
                       x_flux_direction=1.0,
                       y_flux_direction=0.0,
                       tracers_inlet={
                           'polluant_0': 0.,
                           'polluant_1': 10.
                       })
]

fluvial_heights = [
    fk.FluvialHeight(ref=2,
                     height=2.,
                     tracers_inlet={
                         'polluant_0': 0.,
                         'polluant_1': 10.
                     })
]

slides = [fk.Slide(ref=3)]

################################################################################
#
#.. note::
#   Note that tracer labels have been used to provide tracer value at inlet
#   boundary condition. In our case, we provide the same boundary condition inlet
#   values as for tracer initialization.

################################################################################
#
Пример #4
0
layer = fk.Layer(NL, triangular_mesh, topography=0.)

primitives = fk.Primitive(triangular_mesh, layer, height=1.0)

flowrate = fk.TimeDependentFlowRate(times=[0.0, 1000.0, 10000],
                                    flowrates=[0.0, 10.0, 10.0])

fluvial_flowrates = [
    fk.FluvialFlowRate(ref=2,
                       time_dependent_flowrate=flowrate,
                       x_flux_direction=1.0,
                       y_flux_direction=0.0)
]

slides = [fk.Slide(ref=1)]
fluvial_heights = [fk.FluvialHeight(ref=3, height=1.)]

################################################################################
#
# Plot boundary conditions on mesh:
#-----------------------------------
#
#To check boundary labels:
#
colors = {0: 'blue', 1: 'red', 2: 'green', 3: 'purple'}

fig = plt.figure()
ax = fig.add_subplot(111)
ax.triplot(triangular_mesh.triangulation.x, triangular_mesh.triangulation.y,
           triangular_mesh.triangulation.trivtx)
Пример #5
0
def H_0(x, y):
    return ETA * H0 / A**2 * (2 * (x - 0.5 * L) - ETA) - Topo(x, y)


if not args.nographics:
    fk_plt.plot_init_1d_slice(triangular_mesh,
                              surf_xy=H_0,
                              topo_xy=Topo,
                              surface_type='height')

################################################################################
#
# Boundary conditions:
#---------------------

fluvial_heights = [fk.FluvialHeight(ref=r, height=0.0) for r in [1, 2, 3, 4]]

################################################################################
#
# Problem definition:
#--------------------

problem = fk.Problem(
    simutime,
    triangular_mesh,
    layer,
    primitives,
    fluvial_heights=fluvial_heights,
    analytic_sol=thacker2d_analytic,
    numerical_parameters={
        'ipres': IPRES,
Пример #6
0
dir_path = os.path.abspath(os.path.dirname(sys.argv[0]))
triangular_mesh = fk.TriangularMesh.from_msh_file(dir_path +
                                                  '/inputs/simple_canal.msh')

if not args.nographics:
    fk_plt.plot_mesh(triangular_mesh, plot_labels=False)

fluvial_flowrates = [
    fk.FluvialFlowRate(ref=1,
                       flowrate=Q0,
                       x_flux_direction=1.0,
                       y_flux_direction=0.0)
]

fluvial_heights = [fk.FluvialHeight(ref=2, height=2.)]

slides = [fk.Slide(ref=3), fk.Slide(ref=4)]

################################################################################
#
# Resolution:
#--------------------
#
#We loop over friction laws:
#

C = 0
for law, coef in FRICTION_PARAMS.items():

    print(" ")