-
Notifications
You must be signed in to change notification settings - Fork 129
add inviscid burger solver #144
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
Conversation
can you add the name of the solver to the main |
pyro/burgers/simulation.py
Outdated
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) |
There was a problem hiding this comment.
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
pyro/burgers/advective_fluxes.py
Outdated
|
||
if scalar_name == "x-velocity": | ||
|
||
u_xt = riemann(my_data, ul_x, ur_x) |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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 be
v_r*u_r, where
v_ris the right interface velocity in the y-direction, and here is where I use the
direction` option to distinguish whether I switch to calculating the shock speed that way.
There was a problem hiding this comment.
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.
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. |
Okay, I feel like I will just copy what incompressible did... And make changes from there. (xD) |
I think this works now. I'll do some cleaning later. |
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backticks (`)
docs/source/burgers_basics.rst
Outdated
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. |
There was a problem hiding this comment.
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
pyro/burgers/advective_fluxes.py
Outdated
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: | ||
|
There was a problem hiding this comment.
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?
add inviscid burger problem based on advection problem |
add inviscid burger problem based on advection problem