-
Notifications
You must be signed in to change notification settings - Fork 151
flux plus dissipation and global Lax-Friedrichs dissipation #480
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
03fd8a7
set version to v0.3.17 [skip ci]
ranocha 9f46c51
Create DocPreviewCleanup.yml (#473)
ranocha 0c38714
set development version to v0.3.18-pre [skip ci]
ranocha 0a7537a
CompatHelper: bump compat for "MPI" to "0.17" (#476)
github-actions[bot] f442742
set development version to v0.3.19-pre [skip ci]
ranocha 9341dc0
bump compat bounds for LoopVectorization
ranocha b9fa270
set version to v0.3.19
ranocha 8250896
Merge pull request #478 from trixi-framework/hr/update_LoopVectorization
ranocha 33657f4
set development version to v0.3.20-pre [skip ci]
ranocha 2971e9e
add FluxPlusDissipation and DissipationGlobalLaxFriedrichs
ranocha e0a015b
Merge branch 'es-vol-int' into hr/flux_plus_dissipation
ranocha c29b495
comment on include of numerical_fluxes.jl
ranocha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Doc Preview Cleanup | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
|
|
||
| jobs: | ||
| doc-preview-cleanup: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout gh-pages branch | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| ref: gh-pages | ||
|
|
||
| - name: Delete preview and history | ||
| run: | | ||
| git config user.name "Documenter.jl" | ||
| git config user.email "documenter@juliadocs.github.io" | ||
| git rm -rf "previews/PR$PRNUM" | ||
| git commit -m "delete preview" | ||
| git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) | ||
| env: | ||
| PRNUM: ${{ github.event.number }} | ||
|
|
||
| - name: Push changes | ||
| run: | | ||
| git push --force origin gh-pages-new:gh-pages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
|
|
||
| # This file contains general numerical fluxes that are not specific to certain equations | ||
|
|
||
| """ | ||
| flux_central(u_ll, u_rr, orientation, equations::AbstractEquations) | ||
|
|
||
| The classical central numerical flux `f((u_ll) + f(u_rr)) / 2`. When this flux is | ||
| used as volume flux, the discretization is equivalent to the classical weak form | ||
| DG method (except floating point errors). | ||
| """ | ||
| @inline function flux_central(u_ll, u_rr, orientation, equations::AbstractEquations) | ||
| # Calculate regular 1D fluxes | ||
| f_ll = flux(u_ll, orientation, equations) | ||
| f_rr = flux(u_rr, orientation, equations) | ||
|
|
||
| # Average regular fluxes | ||
| return 0.5 * (f_ll + f_rr) | ||
| end | ||
|
|
||
|
|
||
| # TODO: Must be documented and might need a better name | ||
| struct FluxComparedToCentral{Numflux} | ||
| numflux::Numflux | ||
| end | ||
|
|
||
| @inline function (f::FluxComparedToCentral{Numflux})(u_ll, u_rr, orientation, equations) where {Numflux} | ||
|
|
||
| f_baseline = f.numflux(u_ll, u_rr, orientation, equations) | ||
| f_central = flux_central(u_ll, u_rr, orientation, equations) | ||
| w_ll = cons2entropy(u_ll, equations) | ||
| w_rr = cons2entropy(u_rr, equations) | ||
| # The local entropy production of a numerical flux at an interface is | ||
| # dot(w_rr - w_ll, numerical_flux) - (psi_rr - psi_ll), | ||
| # see Tadmor (1987). Since the flux potential is the same for both, we can | ||
| # omit that part. | ||
| delta_entropy = dot(w_rr - w_ll, f_central - f_baseline) | ||
| if delta_entropy < 0 | ||
| return f_central | ||
| else | ||
| return 2 * f_baseline - f_central | ||
| end | ||
| end | ||
|
|
||
|
|
||
| """ | ||
| FluxPlusDissipation(numerical_flux, dissipation) | ||
|
|
||
| Combine a `numerical_flux` with a `dissipation` operator to create a new numerical flux. | ||
| """ | ||
| struct FluxPlusDissipation{NumericalFlux, Dissipation} | ||
| numerical_flux::NumericalFlux | ||
| dissipation::Dissipation | ||
| end | ||
|
|
||
| @inline function (numflux::FluxPlusDissipation{NumericalFlux, Dissipation})(u_ll, u_rr, orientation, equations) where {NumericalFlux, Dissipation} | ||
| @unpack numerical_flux, dissipation = numflux | ||
|
|
||
| return numerical_flux(u_ll, u_rr, orientation, equations) + dissipation(u_ll, u_rr, orientation, equations) | ||
| end | ||
|
|
||
|
|
||
| """ | ||
| DissipationGlobalLaxFriedrichs(λ) | ||
|
|
||
| Create a global Lax-Friedrichs dissipation operator with dissipation coefficient `λ`. | ||
| """ | ||
| struct DissipationGlobalLaxFriedrichs{RealT} | ||
| λ::RealT | ||
| end | ||
|
|
||
| @inline function (dissipation::DissipationGlobalLaxFriedrichs)(u_ll, u_rr, orientation, equations) | ||
| @unpack λ = dissipation | ||
| return -λ/2 * (u_rr - u_ll) | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.