def setgeo(rundata):
    try:
        geo_data = rundata.geo_data
    except:
        print('*** Error, this rundata has no geo_data attribute')
        raise AttributeError('Missing geo_data attribute')
    geo_data.gravity = 9.81
    geo_data.coordinate_system = 1
    geo_data.earth_radius = 6367.5e3
    geo_data.coriolis_forcing = False
    geo_data.sea_level = 0.0
    geo_data.dry_tolerance = 1.e-4
    geo_data.friction_forcing = False
    geo_data.manning_coefficient = 0.035
    geo_data.friction_depth = 1.e6
    geo_data.update_tol = geo_data.dry_tolerance
    geo_data.refine_tol = 0.0
    refinement_data = rundata.refinement_data
    refinement_data.wave_tolerance = 1.e-5
    refinement_data.speed_tolerance = [1e-8]
    refinement_data.deep_depth = 1e2
    refinement_data.max_level_deep = 3
    refinement_data.variable_dt_refinement_ratios = True
    topo_data = rundata.topo_data
    topo_data.topofiles.append([3, 1, 5, 0., 1.e10, "topo.asc"])   
    dtopo_data = rundata.dtopo_data
    rundata.qinit_data.qinit_type = 0
    rundata.qinit_data.qinitfiles = []
    fixedgrids = rundata.fixed_grid_data
    from clawpack.geoclaw.data import LandSpillData
    rundata.add_data(LandSpillData(), 'landspill_data')
    landspill = rundata.landspill_data
    landspill.ref_mu = 32.333949956156545
    landspill.ref_temperature = 15.0
    landspill.ambient_temperature = 15.5
    landspill.density = 856.7
    ptsources_data = landspill.point_sources
    ptsources_data.n_point_sources = 1
    ptsources_data.point_sources.append(
        [[-12329642.982379265, 4924382.823358205], 2, [ 7200.        , 17011.25490802], [0.13248952, 0.07142289]])
    darcy_weisbach_data = landspill.darcy_weisbach_friction
    darcy_weisbach_data.type = 4
    darcy_weisbach_data.dry_tol = 1e-4
    darcy_weisbach_data.friction_tol = 1e6
    darcy_weisbach_data.default_roughness = 0.1
    darcy_weisbach_data.filename = 'roughness.txt'
    hydro_feature_data = landspill.hydro_features
    hydro_feature_data.files = ['hydro_0.asc']
    evaporation_data = landspill.evaporation
    evaporation_data.type = 1
    evaporation_data.coefficients = [1.89 , 0.045]
    return rundata
Beispiel #2
0
def setgeo(rundata):
    #-------------------
    """
    Set GeoClaw specific runtime parameters.
    For documentation see ....
    """

    try:
        geo_data = rundata.geo_data
    except:
        print("*** Error, this rundata has no geo_data attribute")
        raise AttributeError("Missing geo_data attribute")

    # == Physics ==
    geo_data.gravity = 9.81
    geo_data.coordinate_system = 1
    geo_data.earth_radius = 6367.5e3

    # == Forcing Options
    geo_data.coriolis_forcing = False

    # == Algorithm and Initial Conditions ==
    geo_data.sea_level = 0.0
    geo_data.dry_tolerance = 1.e-4
    geo_data.friction_forcing = False
    geo_data.manning_coefficient = 0.035
    geo_data.friction_depth = 1.e6

    # extra parameters
    geo_data.update_tol = geo_data.dry_tolerance
    geo_data.refine_tol = 0.0

    # Refinement data
    refinement_data = rundata.refinement_data
    refinement_data.wave_tolerance = 1.e-5
    refinement_data.speed_tolerance = [1e-8]
    refinement_data.deep_depth = 1e2
    refinement_data.max_level_deep = 3
    refinement_data.variable_dt_refinement_ratios = True

    # == settopo.data values ==
    topo_data = rundata.topo_data
    # for topography, append lines of the form
    #    [topotype, minlevel, maxlevel, t1, t2, fname]
    topo_data.topofiles.append(
        [3, 1, 5, 0., 1.e10, '../common-files/utah_hill.asc'])

    # == setdtopo.data values ==
    dtopo_data = rundata.dtopo_data
    # for moving topography, append lines of the form :   (<= 1 allowed for now!)
    #   [topotype, minlevel,maxlevel,fname]

    # == setqinit.data values ==
    rundata.qinit_data.qinit_type = 0
    rundata.qinit_data.qinitfiles = []
    # for qinit perturbations, append lines of the form: (<= 1 allowed for now!)
    #   [minlev, maxlev, fname]

    # == setfixedgrids.data values ==
    fixedgrids = rundata.fixed_grid_data
    # for fixed grids append lines of the form
    # [t1,t2,noutput,x1,x2,y1,y2,xpoints,ypoints,\
    #  ioutarrivaltimes,ioutsurfacemax]

    # Land-spill module settings
    from clawpack.geoclaw.data import LandSpillData
    rundata.add_data(LandSpillData(), 'landspill_data')
    landspill = rundata.landspill_data
    landspill.ref_mu = 332.  # cP @ 15 degree C
    landspill.ref_temperature = 15.
    landspill.ambient_temperature = 25.
    landspill.density = 9.266e2  # kg / m^3 @ 15 degree C; will overwrite rho in GeoClaw

    # Point sources
    ptsources_data = landspill.point_sources
    ptsources_data.n_point_sources = 1
    ptsources_data.point_sources.append([[-12443619., 4977641.], 2,
                                         [1800., 12600.], [0.5, 0.1]])

    # Darcy-Weisbach friction
    darcy_weisbach_data = landspill.darcy_weisbach_friction
    darcy_weisbach_data.type = 4
    darcy_weisbach_data.dry_tol = 1e-4
    darcy_weisbach_data.friction_tol = 1e6
    darcy_weisbach_data.default_roughness = 0.0
    darcy_weisbach_data.filename = "roughness.txt"

    # hydrological features
    hydro_feature_data = landspill.hydro_features
    hydro_feature_data.files.append("../common-files/hill_hydro.asc")

    # Evaporation
    evaporation_data = landspill.evaporation
    evaporation_data.type = 1
    evaporation_data.coefficients = [1.38, 0.045]

    return rundata