Ejemplo n.º 1
0

def x_mom_DBC(X, flag):
    if X[0] == X_coords[0] or X[0] == X_coords[1]:
        return lambda X, t: 0.0


def y_mom_DBC(X, flag):
    if X[1] == Y_coords[0] or X[1] == Y_coords[1]:
        return lambda X, t: 0.0


# ********************************** #
# ***** Create mySWFlowProblem ***** #
# ********************************** #
outputStepping = SWFlowProblem.OutputStepping(opts.final_time,
                                              dt_output=opts.dt_output)
initialConditions = {
    'water_height': water_height_at_t0(),
    'x_mom': x_mom_at_t0(),
    'y_mom': y_mom_at_t0(),
    'h_times_eta': heta_at_t0(),
    'h_times_w': hw_at_t0()
}
boundaryConditions = {
    'water_height': lambda x, flag: None,
    'x_mom': x_mom_DBC,
    'y_mom': y_mom_DBC,
    'h_times_eta': lambda x, flag: None,
    'h_times_w': lambda x, flag: None
}
# **************************** #
Ejemplo n.º 2
0
def water_height_DBC(X, flag):
    return None


def x_mom_DBC(X, flag):
    if X[0] == X_coords[0] or X[0] == X_coords[1]:
        return lambda X, t: 0.0


# ********************************** #
# ***** Create mySWFlowProblem ***** #
# ********************************** #
# redefine time here
T = opts.final_time
Tstar = T * np.sqrt(h0 / g)
outputStepping = SWFlowProblem.OutputStepping(Tstar, dt_output=opts.dt_output)
initialConditions = {
    'water_height': water_height_at_t0(),
    'x_mom': x_mom_at_t0(),
    'y_mom': y_mom_at_t0(),
    'h_times_eta': heta_at_t0(),
    'h_times_w': hw_at_t0()
}
boundaryConditions = {
    'water_height': lambda x, flag: None,
    'x_mom': x_mom_DBC,
    'y_mom': y_mom_DBC,
    'h_times_eta': lambda x, flag: None,
    'h_times_w': lambda x, flag: None
}