Esempio n. 1
0
nd = 2

T = opts.T
nDTout = opts.nDTout

L = (75.0, 30.0)
g = 9.81
# PARAMETERS #
mannings = 0.02

domainRect = RectangularDomain(L=L)
if opts.structured:
    domain = domainRect
else:
    domainRect.writePoly("hump")
    domain = PlanarStraightLineGraphDomain("hump")
    domain.boundaryTags = domainRect.boundaryTags
#This is relevant just when use_second_order_NonFlatB_with_EV_stabilization=True
cE = 1
LUMPED_MASS_MATRIX = 0

bt = domain.boundaryTags
bt['front'] = bt['bottom']
bt['back'] = bt['top']
domain.writePoly("tank2d")


######################
##### BATHYMETRY #####
######################
Esempio n. 2
0
nd=2

T=opts.T
nDTout=opts.nDTout

L=(75.0,30.0)
g = 9.81
# PARAMETERS #
mannings=0.02

domainRect = RectangularDomain(L=L)
if opts.structured:
    domain=domainRect
else:
    domainRect.writePoly("hump")
    domain = PlanarStraightLineGraphDomain("hump")
    domain.boundaryTags = domainRect.boundaryTags
#This is relevant just when use_second_order_NonFlatB_with_EV_stabilization=True
cE=1
LUMPED_MASS_MATRIX=0

bt = domain.boundaryTags
bt['front'] = bt['bottom']
bt['back'] = bt['top']
domain.writePoly("tank2d")

######################
##### BATHYMETRY #####
######################
def bathymetry_function(X):
Esempio n. 3
0
###################
# DOMAIN AND MESH #
###################
L = (75.0, 30.0)
refinement = opts.refinement
rectangle = RectangularDomain(L=L)

# CREATE REFINEMENT #
nnx0 = 6
nnx = (nnx0 - 1) * (2**refinement) + 1
nny = old_div((nnx - 1), 2) + 1
he = old_div(L[0], float(nnx - 1))
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("dam3bumps")
    domain = PlanarStraightLineGraphDomain(fileprefix="dam3bumps")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2, )
    nnx = None
    nny = None

domain.MeshOptions.nnx = nnx
domain.MeshOptions.nny = nny

######################
##### BATHYMETRY #####
######################


def bathymetry_function(X):
    x = X[0]
Esempio n. 4
0
h0 = 10
a = 3000
B = 2
k = 0.001
p = old_div(np.sqrt(8 * g * h0), a)
s = old_div(np.sqrt(p**2 - k**2), 2.)
mannings = k

cE = 1
LUMPED_MASS_MATRIX = 0
LINEAR_FRICTION = 1

bt = domain.boundaryTags
bt['front'] = bt['bottom']
bt['back'] = bt['top']
domain.writePoly("tank2d")


######################
##### BATHYMETRY #####
######################
def bathymetry_function(X):
    x = X[0]
    return h0 * (x - old_div(L[0], 2))**2 / a / a


def eta_function(x, t):
    coeff1 = a**2 * B**2 / 8. / g / g / h0
    coeff2 = -B**2 / 4. / g
    coeff3 = old_div(-1., g)
Esempio n. 5
0
###################
# DOMAIN AND MESH #
###################
L = (48.8, 26.5)  # this is length in x direction and y direction
refinement = opts.refinement
rectangle = RectangularDomain(L=L, x=[0, -13.25, 0])

# CREATE REFINEMENT #
nnx0 = 6
nnx = (nnx0 - 1) * (2**refinement) + 1
nny = old_div((nnx - 1), 2) + 1
he = old_div(L[0], float(nnx - 1))
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("reef")
    domain = PlanarStraightLineGraphDomain(fileprefix="reef")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2, )
    nnx = None
    nny = None

###############################
#  CONSTANTS NEEDED FOR SETUP #
###############################
g = 9.81

# stuff for solitary wave
h0 = 0.78
alpha = 0.4  # 0.5 * h0
xs = 5.0
r = np.sqrt(old_div(3. * alpha, (4. * h0**2 * (h0 + alpha))))
Esempio n. 6
0
k=0.002
p = np.sqrt(8*g*h0)/a
s = np.sqrt(p**2 - k**2)/2.
mannings=k

domain = RectangularDomain(L=L)

#This is relevant just when use_second_order_NonFlatB_with_EV_stabilization=True
cE=1
LUMPED_MASS_MATRIX=0
LINEAR_FRICTION=1

bt = domain.boundaryTags
bt['front'] = bt['bottom']
bt['back'] = bt['top']
domain.writePoly("tank2d")

######################
##### BATHYMETRY #####
######################
def bathymetry_function(X):
    import numpy as np
    x = X[0]
    y = X[1] 
    r2 = (x-L[0]/2.)**2+(y-L[1]/2.)**2
    return h0*r2/a/a

def eta_function(X,t):
    x = X[0]
    y = X[1]
Esempio n. 7
0
###################
# DOMAIN AND MESH #
###################
L = (50.0, 1.0)
refinement = opts.refinement
rectangle = RectangularDomain(L=L, x=[-35.0, 0, 0])  # x is origin

# CREATE REFINEMENT #
nnx0 = 6
nnx = (nnx0 - 1) * (2**refinement) + 1
nny = old_div((nnx - 1), 20) + 1
he = old_div(L[0], float(nnx - 1))
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("runup")
    domain = PlanarStraightLineGraphDomain(fileprefix="runup")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2, )
    nnx = None
    nny = None

###############################
#  CONSTANTS NEEDED FOR SETUP #
###############################
g = 9.81  # gravity
h0 = 1.0  # water depth
a = 0.28  # relative amplitude
slope = 1.0 / 19.85  # beach slope
k_wavenumber = np.sqrt(3.0 * a / (4.0 * h0**3))  # wavenumber
z = np.sqrt(3.0 * a * h0) / (2.0 * h0 * np.sqrt(h0 * (1.0 + a))
                             )  # width of solitary wave
# DOMAIN AND MESH #
###################
L = (25.0, 1.0)
refinement = opts.refinement
rectangle = RectangularDomain(L=L, x=[0, 0, 0])

# CREATE REFINEMENT #
nnx0 = 6
nnx = (nnx0 - 1) * (2**refinement) + 1
nny = old_div((nnx - 1), 10) + 1
he = old_div(L[0], float(nnx - 1))
triangleOptions = "pAq30Dena%f" % (0.5 * he**2, )
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("bump")
    domain = PlanarStraightLineGraphDomain(fileprefix="bump")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2, )
    nnx = None
    nny = None

##########################################
# DEFINE INITIAL CONSTANTS AND FUNCTIONS #
##########################################
g = 9.81

# constants for transcritical bump
hL = 0.28205279813802181
q_in = 0.18

Esempio n. 9
0
    shock_y = -L[0]#hack to get signed distance right in 2D
    shock_z = 0.5*L[2]
else:
    nny=nnx
    shock_x = 0.5*L[0]
    shock_y = 0.5*L[1]
    shock_z = 0.9*L[2]

regularGrid=True
if regularGrid:
    from proteus.Domain import RectangularDomain
    domain = RectangularDomain(L)
else:
    from tank3dDomain import *
    domain = tank3d(L=L)
    domain.writePoly("tank3d")
    domain.writePLY("tank3d")
    domain.writeAsymptote("tank3d")
    triangleOptions="VApq1.25q12ena%21.16e" % ((he**3)/6.0,)
    bt = domain.boundaryTags
    
waterLevel = 0.5*L[2]
slopeAngle = 0.5*(pi/2.0)

#water
rho_0=998.2
nu_0=1.004e-6
#air
rho_1=1.205
nu_1= 1.500e-5 #* 1000.0
#rho_1 = rho_0
Esempio n. 10
0
# DOMAIN AND MESH #
###################
L = (25.0, 2.0)
refinement = opts.refinement
rectangle = RectangularDomain(L=L, x=[0, 0, 0])

# CREATE REFINEMENT #
nnx0 = 6
nnx = (nnx0 - 1) * (2**refinement) + 1
nny = old_div((nnx - 1), 10) + 1
he = old_div(L[0], float(nnx - 1))
triangleOptions = "pAq30Dena%f" % (0.5 * he**2, )
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("solitary")
    domain = PlanarStraightLineGraphDomain(fileprefix="solitary")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2, )
    nnx = None
    nny = None
domain.MeshOptions.nnx = nnx
domain.MeshOptions.nny = nny
##################################
# SOLITARY WAVE FUCTION AND BATH #
##################################
g = 9.81

# constants for solitary wave
h0 = 0.5
alpha = 0.2 * h0
xs = 5.0
Esempio n. 11
0
# DOMAIN AND MESH #
###################
L = (30.0, 2.0)
refinement = opts.refinement
rectangle = RectangularDomain(L=L, x=[-15, 0, 0])

# CREATE REFINEMENT #
nnx0 = 6
nnx = (nnx0 - 1) * (2**refinement) + 1
nny = old_div((nnx - 1), 10) + 1
he = old_div(L[0], float(nnx - 1))
triangleOptions = "pAq30Dena%f" % (0.5 * he**2, )
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("step")
    domain = PlanarStraightLineGraphDomain(fileprefix="step")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2, )
    nnx = None
    nny = None

domain.MeshOptions.nnx = nnx
domain.MeshOptions.nny = nny

##################################
# SOLITARY WAVE FUCTION AND BATH #
##################################
g = 9.81

# constants for solitary wave
h0 = 0.20
Esempio n. 12
0
###################
# DOMAIN AND MESH #
###################
L = (15.0, 2.0)  # this is domain length in x direction and y direction
refinement = opts.refinement
rectangle = RectangularDomain(L=L)

# CREATE REFINEMENT #
nnx0 = 6
nnx = (nnx0 - 1) * (2**refinement) + 1
nny = old_div((nnx - 1), 10) + 1
he = old_div(L[0], float(nnx - 1))
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("seawall")
    domain = PlanarStraightLineGraphDomain(fileprefix="seawall")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2,)
    nnx = None
    nny = None

###############################
#  CONSTANTS NEEDED FOR SETUP #
###############################
g = 9.81
h0 = 0.2  # water depth
a = 0.35  # relative amplitude
k_wavenumber = np.sqrt(3.0 * a / (4.0 * h0**3))  # wavenumber
z = np.sqrt(3.0 * a * h0) / (2.0 * h0 * np.sqrt(h0 * (1.0 + a)))  # width
c = np.sqrt(g * (1.0 + a) * h0)  # wave celerity
x0 = 5.9  # initial location of solitary wave
Esempio n. 13
0
###################
# DOMAIN AND MESH #
###################
L = (20.0, 20.0)  # this is length in x direction and y direction
refinement = opts.refinement
rectangle = RectangularDomain(L=L)

# CREATE REFINEMENT #
nnx = 50
nny = 50
he = old_div(L[0], float(nnx - 1))
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("circular_damBreak")
    domain = PlanarStraightLineGraphDomain(fileprefix="circular_damBreak")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2, )
    nnx = None
    nny = None

######################
##### BATHYMETRY #####
######################


def bathymetry_function(X):
    x = X[0]
    return x * 0.

Esempio n. 14
0
###################
# DOMAIN AND MESH #
###################
L = (25.0, 30.0)  # this is length in x direction and y direction
refinement = opts.refinement
rectangle = RectangularDomain(L=L)

# CREATE REFINEMENT #
nnx0 = 6
nnx = (nnx0 - 1) * (2**refinement) + 1
nny = old_div((nnx - 1), 2) + 1
he = old_div(L[0], float(nnx - 1))
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("island")
    domain = PlanarStraightLineGraphDomain(fileprefix="island")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2, )
    nnx = None
    nny = None

###############################
#  CONSTANTS NEEDED FOR SETUP #
###############################
g = 9.81

# stuff for solitary wave
h0 = 0.32
alpha = 0.181 * h0
xs = 7.56023
if opts.which_case == 1:
Esempio n. 15
0
# DOMAIN AND MESH #
###################
L = (30.0, 25.0)  # this is length in x direction and y direction
refinement = opts.refinement
rectangle = RectangularDomain(L=L)

# CREATE REFINEMENT #
nnx0 = 6
nnx = (nnx0 - 1) * (2**refinement) + 1
nny = old_div((nnx - 1), 2) + 1
he = old_div(L[0], float(nnx - 1))
triangleOptions = "pAq30Dena%f" % (0.5 * he**2, )
if opts.structured:
    domain = rectangle
else:
    rectangle.writePoly("well_balancing")
    domain = PlanarStraightLineGraphDomain(fileprefix="well_balancing")
    domain.MeshOptions.triangleOptions = "pAq30Dena%f" % (0.5 * opts.he**2, )
    nnx = None
    nny = None

###############################
#  CONSTANTS NEEDED FOR SETUP #
###############################
g = 9.81
h0 = 1.0

# stuff for cone bathymetry
htop = 0.625
rcone = 3.6
scone = 4.0