Пример #1
0
    ("cfl", 0.5, "Target cfl"),
    ("freezeLevelSet", True, "No motion to the levelset"),
    ("movingDomain", True, "Moving domain and mesh option"),
    ("nd", 2, "used in signed distance function"),
    ("Tend", 60., "total simulation time"),
    ("fract", 1., "total simulation time/ chosen simulation time"),
    ("Np", 10., " Output points per period Tp/Np"),
    ("dt_init", 0.001, "initial time step"),
    ("refinement_level", 2.5,
     "to define characteristic element size he, he=radius/refinement_level")
])

#############################        Domain & Waves      ################################
# --- Domain
domain = Domain.PlanarStraightLineGraphDomain()
tank = Tank2D(domain, opts.tank_dim)

# --- WAVE input
current = wt.SteadyCurrent(U=opts.U, mwl=opts.mwl, rampTime=opts.rampTime)

# --- Script on wave length
# wave_length=wave.wavelength

# --- Sponge
tank.setSponge(x_n=opts.left_sponge, x_p=None)

# --- Refinement
he = opts.radius / opts.refinement_level
smoothing = opts.ecH * he

dragAlpha = 5 * (2 * np.pi / opts.Tt[1]) / 1e-6
Пример #2
0
# | |_| | (_) | | | | | | (_| | | | | |
# |____/ \___/|_| |_| |_|\__,_|_|_| |_|
# Domain
# All geometrical options go here (but not mesh options)

if opts.useHex or opts.structured:
    domain = Domain.RectangularDomain(tank_dim)
    boundaryTags = domain.boundaryTags
else:
    domain = Domain.PlanarStraightLineGraphDomain()

# ----- TANK ----- #

justTank = False
if justTank:
    tank = Tank2D(domain, tank_dim)
    tank.facets = np.array([[[0, 1, 2, 3]]])
    tank.facetFlags = np.array([1])
else:
    bt = {'x-': 1, 'x+': 2, 'y-': 3, 'y+': 4}
    tank = CustomShape(domain,
                       vertices=[[0.0, 0.0], [0.0, tank_dim[1]],
                                 [0.5 * tank_dim[0], tank_dim[1]],
                                 [tank_dim[0], tank_dim[1]],
                                 [tank_dim[0], 0.0], [0.5 * tank_dim[0], 0.0]],
                       vertexFlags=[
                           bt['y-'], bt['y+'], bt['y+'], bt['y+'], bt['y-'],
                           bt['y-']
                       ],
                       segments=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5],
                                 [5, 0], [2, 5]],
Пример #3
0
def create_tank2D(domain, dim=(0., 0.), coords=None):
    return Tank2D(domain, dim, coords)
Пример #4
0
def create_tank2D(domain, dim=(0., 0.), coords=None, from_0=True):
    return Tank2D(domain, dim, coords, from_0)