Skip to content

Conversation

zhichen3
Copy link
Collaborator

add inviscid burger problem based on advection problem

@zhichen3 zhichen3 changed the title [WIP] add inviscid burger solver add inviscid burger solver Mar 23, 2023
@zingale
Copy link
Collaborator

zingale commented Mar 24, 2023

can you add the name of the solver to the main README.md in the list of solvers and also take a pass at making a sphinx docs page for this solver?

xtmp = max(np.max(np.abs(u)), self.SMALL) / self.cc_data.grid.dx
ytmp = max(np.max(np.abs(v)), self.SMALL) / self.cc_data.grid.dy

self.dt = cfl / (xtmp + ytmp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that this is the correct timestep limiter. I think that we should essentially do the same thing that is done in the CTU advection or compressible solver


if scalar_name == "x-velocity":

u_xt = riemann(my_data, ul_x, ur_x)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

direction defaults to None in riemann, so you always need to pass in the direction to riemann()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not certain how to proceed with riemann problem. Say that we're advecting x-velocity, u, then the shock speed in the x-direction is simply 0.5*(u_l + u_r), where u_l and u_r are the left and right interface states for u, which means I don't need to pass in a direction (at least for the way that I wrote the riemann(), although it could be confusing). But the shock speed in the y-direction we should calculate(?) that as (f(u_r) - f(u_l)) / (u_r - u_l)and here f(u_r)should bev_r*u_r, where v_ris the right interface velocity in the y-direction, and here is where I use thedirection` option to distinguish whether I switch to calculating the shock speed that way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay I see what you are saying. I will try something later.

@zhichen3
Copy link
Collaborator Author

I think the problem is that I'm calculating the x and y velocities fluxes independently of each other, which means that I'm not using the most updated transverse velocities.

@zhichen3
Copy link
Collaborator Author

Okay, I feel like I will just copy what incompressible did... And make changes from there. (xD)

@zhichen3
Copy link
Collaborator Author

I think this works now. I'll do some cleaning later.

Copy link
Contributor

@simonguichandut simonguichandut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Mostly some language editing..

README.md Outdated
- `advection_weno`: a method-of-lines WENO solver for linear
advection.
- 'burgers': a second-order unsplit solver for invsicid Burgers' equation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backticks (`)

Burgers' Equations
==================

Burgers' Equations are nonlinear hyperbolic equations. It has the same form as the advection equation, except that the quantity that we're advecting is the velocity itself.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has or they have?

that we're advecting -> being advected

We use a second-order (piecewise linear) unsplit Godunov method
(following Colella 1990).
Our convection is that the fluxes are going to be defined on the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

condition/criterion?

xctr = 0.5*(xmin + xmax)
yctr = 0.5*(ymin + ymax)

A = 0.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is A here? Maybe define the problem at the top of the file, see e.g. incompressible/problems/shear.py

vbar_adv.v(buf=1)[:, :] = 0.5*(vhat_adv.v(buf=1) + vhat_adv.jp(-1, buf=1))

# Apply transverse correction terms:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you just add some comments here indicating what the tranverse term is that you are adding. Just what is in the incompressible solver?

@zingale
Copy link
Collaborator

zingale commented Apr 7, 2023

add inviscid burger problem based on advection problem
the interface state prediction follows the incompressible solver closely

@zingale zingale merged commit 3ed568e into python-hydro:main Apr 7, 2023
@zingale zingale mentioned this pull request Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants