예제 #1
0
#--------------------

primitives = fk.Primitive(triangular_mesh,
                          layer,
                          free_surface=FREE_SURFACE_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(
예제 #2
0
#
# Boundary conditions:
#---------------------
#
#Boundary conditions are the same as in reiver example excepts we define inlet
#flowrate in a input file.

times, flowrates = np.loadtxt('inputs/river_polluant_flowrate.txt',
                              unpack=True)
flowrate = fk.TimeDependentFlowRate(times=times, flowrates=flowrates)

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)]
예제 #3
0
primitives = fk.Primitive(triangular_mesh, layer, free_surface_funct=eta_0)
tracers = [fk.Tracer(triangular_mesh, layer, primitives, Tinit_funct=T_0)]

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

slides = [fk.Slide(ref=1), fk.Slide(ref=3)]
torrential_outs = [fk.TorrentialOut(ref=2)]
tube = fk.RectangularTube(xlim=(0.0, 4.0), ylim=(0.0, 6.0), zlim=(0.0, 6.0))
flowrate = fk.TimeDependentFlowRate(times=[0.0, 0.0], flowrates=[0.0, 0.0])
fluvial_flowrates = [
    fk.FluvialFlowRate(ref=4,
                       time_dependent_flowrate=flowrate,
                       rectangular_tube=tube,
                       x_flux_direction=1.0,
                       y_flux_direction=0.0)
]

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

thacker = fk.Problem(simutime,
                     triangular_mesh,
                     layer,
                     primitives,
                     tracers=tracers,
                     slides=slides,
예제 #4
0
simutime = fk.SimuTime(final_time=1500., time_iteration_max=100000)

triangular_mesh = fk.TriangularMesh.from_msh_file(
    '../simulations/inputs/river.msh')

NL = 8
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'}
예제 #5
0
layer_l = []
primitives_l = []
friction_l = []
viscosity_l = []
problem_l = []

triangular_mesh = fk.TriangularMesh.from_msh_file('../simulations/inputs/simple_canal.msh') 

################################################################################
#
#Boundary conditions are statically defined in this example but they could have 
#been changed as well.
#

fluvial_flowrates = [fk.FluvialFlowRate(ref=1,
                                  flowrate=5.,
                                  x_flux_direction=1.0,
                                  y_flux_direction=0.0)]
fluvial_heights = [fk.FluvialHeight(ref=2, height=2.)]
slide = [fk.Slide(ref=3), fk.Slide(ref=4)]

################################################################################
#
# Resolution: 
#--------------------
#
#We loop over cases:

for C, NL in enumerate(cases):

    print(" ")
    print(" ")