Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented framework for spectral methods and Rayleigh Benard Convection with ultraspherical method #476

Merged
merged 13 commits into from
Sep 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions pySDC/implementations/problem_classes/Burgers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@


class Burgers1D(GenericSpectralLinear):
"""
See https://en.wikipedia.org/wiki/Burgers'_equation
Discretization is done with a Chebychov method, which requires a first order derivative formulation.
Feel free to do a more efficient implementation using an ultraspherical method to avoid the first order business.
"""
tlunet marked this conversation as resolved.
Show resolved Hide resolved

dtype_u = mesh
dtype_f = imex_mesh
Expand Down Expand Up @@ -125,9 +130,12 @@ def plot(self, u, t=None, fig=None, comp='u'): # pragma: no cover


class Burgers2D(GenericSpectralLinear):
"""
See documentation of `Burgers1D`.
"""

dtype_u = mesh
dtype_f = imex_mesh
xp = np

def __init__(self, nx=64, nz=64, epsilon=0.1, fux=2, fuz=1, mode='T2U', **kwargs):
tlunet marked this conversation as resolved.
Show resolved Hide resolved
tlunet marked this conversation as resolved.
Show resolved Hide resolved
self._makeAttributeAndRegister(*locals().keys(), localVars=locals(), readOnly=True)
Expand Down Expand Up @@ -187,9 +195,6 @@ def u_exact(self, t=0, *args, noise_level=0, **kwargs):
me[iu] = self.xp.cos(self.X * self.fux) * self.xp.sin(self.Z * np.pi * self.fuz) + self.BCtopu
me[iux] = -self.xp.sin(self.X * self.fux) * self.fux * self.xp.sin(self.Z * np.pi * self.fuz)
me[iuz] = self.xp.cos(self.X * self.fux) * self.xp.cos(self.Z * np.pi * self.fuz) * np.pi * self.fuz
# me[iu] = self.xp.cos(self.X * self.fux) * (self.Z+1)*(self.Z-1) + self.BCtopu
# me[iux] = -self.xp.sin(self.X * self.fux) * self.fux * (self.Z+1)*(self.Z-1)
# me[iuz] = self.xp.cos(self.X * self.fux) * 2 * self.Z

me[iv] = (self.BCtop + self.BCbottom) / 2 + (self.BCtop - self.BCbottom) / 2 * self.Z
me[ivz][:] = (self.BCtop - self.BCbottom) / 2
Expand Down