Skip to content

Commit

Permalink
cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmontoya committed Jul 27, 2023
1 parent 2f4ea39 commit d7819e9
Show file tree
Hide file tree
Showing 5 changed files with 2,642 additions and 2,340 deletions.
2,076 changes: 1,189 additions & 887 deletions examples/advection_2d.ipynb

Large diffs are not rendered by default.

145 changes: 73 additions & 72 deletions examples/burgers_1d.ipynb

Large diffs are not rendered by default.

2,750 changes: 1,373 additions & 1,377 deletions examples/euler_vortex_2d.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/ConservationLaws/linear_advection_diffusion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ end

@inline conservative_to_primitive(::AdvectionType, u) = u
@inline conservative_to_entropy(::AdvectionType, u) = u
@inline entropy_to_conservative(::AdvectionType, u) = u
@inline entropy(::AdvectionType, u) = 0.5*u[1]^2

@inline function wave_speed(conservation_law::AdvectionType{d},
Expand Down
10 changes: 6 additions & 4 deletions src/Solvers/flux_differencing_form.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
end

# specialized for no entropy projection
# (only provably stable for diagonal-E nodal)
@inline function get_nodal_values!(
::AbstractMassMatrixSolver,
::AbstractConservationLaw,
Expand All @@ -39,6 +38,7 @@ end
end

# specialized for nodal schemes (not necessarily diagonal-E)
# this is really an "entropy extrapolation" and not "projection"
@inline function get_nodal_values!(
::AbstractMassMatrixSolver,
conservation_law::AbstractConservationLaw,
Expand All @@ -61,6 +61,7 @@ end
end

# general (i.e. suitable for modal) approach
# uses a full entropy projection
@inline function get_nodal_values!(
mass_solver::AbstractMassMatrixSolver,
conservation_law::AbstractConservationLaw,
Expand All @@ -77,19 +78,20 @@ end
for i in axes(u_q, 1)
w_q[i,:] .= conservative_to_entropy(conservation_law,u_q[i,:])
end
w = similar(u)

# project entropy variables and store modal coeffs in w
w = similar(u)
lmul!(WJ, w_q)
mul!(w, V', w_q)
mass_matrix_solve!(mass_solver, k, w, u_q)
mass_matrix_solve!(mass_solver, k, w, w_q)

# get nodal values of projected entropy variables
mul!(w_q, V, w)
mul!(w_f, R, w_q)

# convert back to conservative variables
for i in axes(u_q, 1)
u_q[i,:] .= entropy_to_conservative(conservation_law,w_q[i,:])
u_q[i,:] .= entropy_to_conservative(conservation_law, w_q[i,:])
end
for i in axes(u_f, 1)
u_f[i,:] .= entropy_to_conservative(conservation_law, w_f[i,:])
Expand Down

0 comments on commit d7819e9

Please sign in to comment.