Hello,
I am a new user of Dedalus. I am wondering if Dedalus can solve an eigenvalue problem or a boundary value problem with a step function parameter. For example, in the following code, instead of 'problem.substitutions['f'] = "1.0" ', I would like to substitute f with a step function of the form of
f = 0.5 for f < 0
f = 1 for f > 0.
Is something like this possible?
Thanks in advance,
Zoe
Ny = 51 # number of points in y direction
Ly = 5*np.pi # width the domain
kmax = np.pi # horizontal wave number extrema
kx_global = np.linspace(-kmax,kmax,100)
# Create bases and domain
y_basis = de.Chebyshev('y', Ny, interval=(-Ly/2, Ly/2))
domain = de.Domain([y_basis], grid_dtype=np.complex128, comm=MPI.COMM_SELF) # build a physical domain
# EVP -> setting up eigenvalue problem
problem = de.EVP(domain, variables=['u','v','h'], eigenvalue='omega')
# Dirichlet preconditioning that sparifies Dirchlet boundary (interpolation at the Chebyshev interval endpoints)
# Only necessary for Dirichlet boundary condition
problem.meta[:]['y']['dirichlet'] = True
problem.parameters['Ly'] = Ly
problem.parameters['kx'] = 1 # why do we take kx = 1 but later change kx?
problem.parameters['pi'] = np.pi
# Use substitutions for x and t derivatives
problem.substitutions['dx(A)'] = "1j*kx*A"
problem.substitutions['dt(A)'] = "-1j*omega*A"
problem.substitutions['w'] = "dx(u) + dy(v)"
problem.substitutions['f'] = "1.0"
problem.add_equation("dt(u) + dx(h) - f * v = 0")
problem.add_equation("dt(v) + dy(h) + f * u = 0")
problem.add_equation("dt(h) + w = 0")
problem.add_bc("left(v) = 0")
problem.add_bc("right(v) = 0")