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

Navier-Stokes in 2D on DGMulti and TreeMesh #1165

Merged
merged 78 commits into from
Jul 29, 2022
Merged

Conversation

andrewwinters5000
Copy link
Member

First implementation of the compressible Naiver-Stokes equations which extends the capability added by #1156 . Should be useful to determine if the current boundary condition strategy and other storage architectures extend to equation systems.

@jlchan jlchan self-requested a review June 7, 2022 20:46
@codecov
Copy link

codecov bot commented Jun 7, 2022

Codecov Report

Merging #1165 (3281b49) into parabolic-treemesh (39d06de) will decrease coverage by 0.01%.
The diff coverage is 97.12%.

❗ Current head 3281b49 differs from pull request most recent head 98ea1bd. Consider uploading reports for the commit 98ea1bd to get more accurate results

@@                  Coverage Diff                   @@
##           parabolic-treemesh    #1165      +/-   ##
======================================================
- Coverage               96.79%   96.78%   -0.01%     
======================================================
  Files                     309      326      +17     
  Lines                   24258    25034     +776     
======================================================
+ Hits                    23479    24228     +749     
- Misses                    779      806      +27     
Flag Coverage Δ
unittests 96.78% <97.12%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/solvers/dgsem_tree/dg.jl 100.00% <ø> (ø)
src/equations/laplace_diffusion_2d.jl 81.25% <81.25%> (ø)
src/equations/compressible_navier_stokes_2d.jl 88.33% <88.33%> (ø)
src/solvers/dgmulti/dg_parabolic.jl 93.38% <93.38%> (ø)
...ization/semidiscretization_hyperbolic_parabolic.jl 96.43% <96.43%> (ø)
src/solvers/dgsem_tree/dg_2d_parabolic.jl 99.60% <99.60%> (ø)
examples/dgmulti_2d/elixir_advection_diffusion.jl 100.00% <100.00%> (ø)
...multi_2d/elixir_advection_diffusion_nonperiodic.jl 100.00% <100.00%> (ø)
.../dgmulti_2d/elixir_advection_diffusion_periodic.jl 100.00% <100.00%> (ø)
...les/dgmulti_2d/elixir_navier_stokes_convergence.jl 100.00% <100.00%> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39d06de...98ea1bd. Read the comment docs.

@ranocha ranocha changed the base branch from dev to parabolic-treemesh June 8, 2022 15:29
@ranocha
Copy link
Member

ranocha commented Jun 8, 2022

I updated some of our branches and changed the base of this one to the parabolic TreeMesh stuff to make it easier to review this PR.

Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this first draft, @andrewwinters5000! I am sure @sloede and @jlchan will also have some comments and ideas.

src/Trixi.jl Outdated Show resolved Hide resolved
Comment on lines 9 to 15
# I really do not like this structure but it should work for now
equations_parabolic = CompressibleNavierStokes2D(1.4, # gamma
1000, # Reynolds number
0.72, # Prandtl number
0.5, # free-stream Mach number
1.0, # thermal diffusivity
equations)
Copy link
Member

Choose a reason for hiding this comment

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

Do we need all of these parameters? If so, should we maybe create a constructor with keywords?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. I am not sure if we need all these constants. For example, the Prandtl number basically never changes för the ideal gas assumption. I threw in all the constants I thought we would need and am open to trimming it down. Also, we could possibly store mu = 1 / Reynolds for the sake of code readability.
  2. Keywords is probably the best way to do this but I wasn't sure if having the constructor look like
function CompressibleNavierStokes2D(equations; gamma, Reynolds, Prandtl, Mach_freestream, kappa)

would be kosher to have the call structure

equations_parabolic = CompressibleNavierStokes2D(gamma=1.4,
                                                 Reynolds=1000,
                                                 Prandtl=0.72,
                                                 Mach_freestream=0.5,
                                                 kappa=1.0,  # thermal diffusivity
                                                 equations)

for the sake of consistency with the LaplaceEquation2D where equations comes last.

Copy link
Member

Choose a reason for hiding this comment

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

Keyword arguments need to come after positional ones, so it could be

CompressibleNavierStokes2D(equations; Reynolds, Prandtl, Mach_freestream, kappa)

where we should grab gamma from equations.

Copy link
Member

Choose a reason for hiding this comment

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

@sloede We should probably unify the argument names with the lattice Boltzmann stuff (using Ma and Re for now).

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

# TODO:
# 1) For now I save gamma and inv(gamma-1) again, but we could potentially reuse them from
# the Euler equations
# 2) Add more here and probably some equations
Copy link
Member

Choose a reason for hiding this comment

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

👍

src/equations/compressible_navier_stokes_2d.jl Outdated Show resolved Hide resolved
src/equations/compressible_navier_stokes_2d.jl Outdated Show resolved Hide resolved
src/equations/compressible_navier_stokes_2d.jl Outdated Show resolved Hide resolved
Comment on lines 81 to 86
# This is the flexibility a user should have to select the different gradient variable types
# varnames(::typeof(cons2prim) , ::CompressibleNavierStokes2D) = ("v1", "v2", "T")
# varnames(::typeof(cons2entropy), ::CompressibleNavierStokes2D) = ("w2", "w3", "w4")

varnames(variable_mapping, equations_parabolic::CompressibleNavierStokes2D) =
varnames(variable_mapping, equations_parabolic.equations)
Copy link
Member

Choose a reason for hiding this comment

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

I think varnames is meant to still give the variable names of the underlying conserved (or transformed) variables, not their gradients. But we should probably make this more clear in the other parts.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, okay. I got confused then. In my other codes I carry around an nvars for the conservative variables and a separate nvars_grad for the number of gradient variables.

Copy link
Member Author

@andrewwinters5000 andrewwinters5000 Jun 9, 2022

Choose a reason for hiding this comment

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

From my end it would be helpful to (somewhere) have the constructor for the parabolic equations output what are the gradient variables for the user. What I mean is that the equations constructors would report something like the following to the screen

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CompressibleEulerEquations2D                                                                     │
│ ════════════════════════════                                                                     │
│ #variables: ………………………………………………… 4                                                                │
│ │ variable 1: …………………………………………… rho                                                              │
│ │ variable 2: …………………………………………… rho_v1                                                           │
│ │ variable 3: …………………………………………… rho_v2                                                           │
│ │ variable 4: …………………………………………… rho_e                                                            │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CompressibleNavierStokesEquations2D                                                              │
│ ═══════════════════════════════════                                                              │
│ gradient variables: …………………………… primitive                                                        │
│ #variables: ………………………………………………… 3                                                                │
│ │ variable 1: …………………………………………… v1                                                               │
│ │ variable 2: …………………………………………… v2                                                               │
│ │ variable 3: …………………………………………… T                                                                │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this sounds reasonable. Could you please add this to our issue #1147 tracking parabolic stuff?

src/equations/compressible_navier_stokes_2d.jl Outdated Show resolved Hide resolved
@andrewwinters5000
Copy link
Member Author

I updated some of our branches and changed the base of this one to the parabolic TreeMesh stuff to make it easier to review this PR.

Thanks!

@andrewwinters5000 andrewwinters5000 mentioned this pull request Jun 10, 2022
35 tasks
@jlchan
Copy link
Contributor

jlchan commented Jul 20, 2022

I'll investigate that - the odd behavior I observe is on y_neg, so this seems consistent.

One very odd observation is that the parabolic RHS for TreeMesh is 10x smaller than that of DGMulti, up to maybe 6-7 digits. This seems much more odd to me...

EDIT: the 10x thing wasn't related to a bug, it was just a difference in the Reynolds numbers set for each example in my local branch.

@jlchan
Copy link
Contributor

jlchan commented Jul 28, 2022

Curious - if I set Re = 1e14 to make the parabolic terms small and use a SemidiscretizationHyperbolic (ignoring parabolic terms but still using the same Navier-Stokes source term) then DGSEM with TreeMesh still crashes. Can anyone else confirm this?

@jlchan
Copy link
Contributor

jlchan commented Jul 28, 2022

I think the issue is somehow related to slip wall BCs for TreeMesh. I made an issue with a MWE for it here #1190.

@jlchan
Copy link
Contributor

jlchan commented Jul 28, 2022

Hopefully these recent changes fix things. I get convergence now for compressible Navier-Stokes using TreeMesh now.

I've added tests for both TreeMesh and DGMulti now. @ranocha @andrewwinters5000 @sloede - if the tests pass, is there anything else we need to add to this PR before merging into dev?

@jlchan jlchan marked this pull request as ready for review July 28, 2022 19:40
@jlchan jlchan changed the title [WIP] Navier-Stokes in 2D on TreeMesh Navier-Stokes in 2D on DGMulti and TreeMesh Jul 28, 2022
Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Looks quite good already! From my point of view, we can merge this once the following comments are addressed.

examples/dgmulti_2d/elixir_navier_stokes_convergence.jl Outdated Show resolved Hide resolved
examples/dgmulti_2d/elixir_navier_stokes_convergence.jl Outdated Show resolved Hide resolved
examples/tree_2d_dgsem/elixir_navier_stokes_convergence.jl Outdated Show resolved Hide resolved
src/equations/compressible_navier_stokes_2d.jl Outdated Show resolved Hide resolved
src/equations/compressible_navier_stokes_2d.jl Outdated Show resolved Hide resolved
src/equations/compressible_navier_stokes_2d.jl Outdated Show resolved Hide resolved
src/equations/compressible_navier_stokes_2d.jl Outdated Show resolved Hide resolved
@sloede
Copy link
Member

sloede commented Jul 29, 2022

Would it make sense for me to review this as well? If yes: Is it possible that the original branch parabolic-treemesh is currently not up-to-date with main, whereas this one is? The diff seems to show differences that are not due to Navier-Stokes being added...

@jlchan
Copy link
Contributor

jlchan commented Jul 29, 2022

Hm...since this PR is merging into parabolic-treemesh, wouldn't that bring parabolic-treemeshup to date with main as well?

@jlchan
Copy link
Contributor

jlchan commented Jul 29, 2022

I think that's correct; we stopped working on parabolic-treemesh after @andrewwinters5000 introduced this PR.

@ranocha
Copy link
Member

ranocha commented Jul 29, 2022

Will do some cleanup and then trigger the merge. I think @sloede does not need to review this right now since we will have several other rounds of review

@sloede
Copy link
Member

sloede commented Jul 29, 2022

OK, got it 👍 Will not review.

@ranocha ranocha merged commit 6002ba6 into parabolic-treemesh Jul 29, 2022
@ranocha ranocha deleted the nav_stokes_2d branch July 29, 2022 14:51
sloede added a commit that referenced this pull request Aug 9, 2022
* Add prototype for advection-diffusion elixir for TreeMesh2D

* Initial implementation of `calc_gradient!` for TreeMesh{2}

* First complete implementation of the parabolic rhs operator for TreeMesh

* Make it work

* Add first elixir that works

* Clean up elixir

* first draft of container for Navier-Stokes constants and fluxes

* remove unneeded temperature computation

* draft of elixir with possible boundary condition structure

* added manufactured solution and source term

* fix typo in function name for MMS

* update variable names for consistency. improve comments

* fix dumb typos in new equation system name

* actually export new equations

* add comment near variable_mapping declaration.

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* parabolic equations now exported separately

* change name to CompressibleNavierStokesEquations2D

* export NS with proper name

* explicitly require compressible Euler in the type parameter

* name kinematic viscosity nu for consistency with Lattice-Boltzmann

* add promotion in constructor

* make Reynolds, Prandtl, Mach, and kappa keyword arguments

* update constructor call in elixir

* reduce computation by exploiting stress tensor symmetry

* fix unpacking of flux

* modifying parabolic cache creation

in cache, we assume we take the gradient of all hyperbolic variables. since the number of parabolic variables can differ from the number of hyperbolic variables, we pass in the hyperbolic equations to `create_cache_parabolic` now

* comments

* comments

* formatting and renaming equations to equations_hyperbolic


formatting comments

* fix unpacking of gradients in flux

* adding CNS BCs

* adding lid-driven cavity elixir

* adding variable transform, editing cons2prim for CNS

* add prim2cons for NS (inconsistent right now)

* add draft of DGMulti Navier Stokes convergence elixir

* converging solution using elixir for TreeMesh with BCs

* fixing DGMulti advection diffusion elixir convergence

* naming equations as parabolic/hyperbolic

* generalizing transform_variables

* add TODO


more todos

* additional checks on get_unsigned_normal

* adding isothermal BC

* commenting out unused CNS functions for now

* fix call to transform_variables

* comments and cleanup

* changing default solver and Re for cavity

* adding more advection diffusion tests

* label tests

* add gradient_variables field to SemidiscretizationHyperbolicParabolic

* Revert "add gradient_variables field to SemidiscretizationHyperbolicParabolic"

This reverts commit 063b602.

* allowing for specialization in transform_variables

adding a function `gradient_variable_transformation` which should get specialized if the gradient variables are not conservative variables

* formatting and comments

* reverting elixir

* comments

* standardizing time tol

* minor fix to CNS boundary flux for convenience

make it so that the density state is computed correctly, even though it's not used

* formatting + comments

* using primitive variables in viscous flux instead of conservative

* minor formatting

* add CNS tests

* fix test

* testing if scoping issues fix TreeMesh tests

* decreasing timestep tol for TreeMesh parabolic test

* enabling periodic BCs for TreeMesh + more tests

* fix density BC flux (unused, but could be useful)

* adding non-working TreeMesh elixirs

* adding AD checks

* standardizing parameters in convergence elixirs

* minor cleanup

* revert DGMulti CNS elixir setup back to the one used in tests

* adding TreeMesh CNS convergence test

* removing redundant elixir

* add more tests

* add more test

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* set version to v0.4.43

* set development version to v0.4.44-pre

* add YouTube links to JuliaCon presentations (#1192)

* add YouTube links to JuliaCon presentations

* Apply suggestions from code review

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* improved readability of equation docstrings in compressible Euler files

* Navier-Stokes in 2D on DGMulti and TreeMesh (#1165)

* first draft of container for Navier-Stokes constants and fluxes

* remove unneeded temperature computation

* draft of elixir with possible boundary condition structure

* added manufactured solution and source term

* fix typo in function name for MMS

* update variable names for consistency. improve comments

* fix dumb typos in new equation system name

* actually export new equations

* add comment near variable_mapping declaration.

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* parabolic equations now exported separately

* change name to CompressibleNavierStokesEquations2D

* export NS with proper name

* explicitly require compressible Euler in the type parameter

* name kinematic viscosity nu for consistency with Lattice-Boltzmann

* add promotion in constructor

* make Reynolds, Prandtl, Mach, and kappa keyword arguments

* update constructor call in elixir

* reduce computation by exploiting stress tensor symmetry

* fix unpacking of flux

* modifying parabolic cache creation

in cache, we assume we take the gradient of all hyperbolic variables. since the number of parabolic variables can differ from the number of hyperbolic variables, we pass in the hyperbolic equations to `create_cache_parabolic` now

* comments

* comments

* formatting and renaming equations to equations_hyperbolic


formatting comments

* fix unpacking of gradients in flux

* adding CNS BCs

* adding lid-driven cavity elixir

* adding variable transform, editing cons2prim for CNS

* add prim2cons for NS (inconsistent right now)

* add draft of DGMulti Navier Stokes convergence elixir

* converging solution using elixir for TreeMesh with BCs

* fixing DGMulti advection diffusion elixir convergence

* naming equations as parabolic/hyperbolic

* generalizing transform_variables

* add TODO


more todos

* additional checks on get_unsigned_normal

* adding isothermal BC

* commenting out unused CNS functions for now

* fix call to transform_variables

* comments and cleanup

* changing default solver and Re for cavity

* adding more advection diffusion tests

* label tests

* add gradient_variables field to SemidiscretizationHyperbolicParabolic

* Revert "add gradient_variables field to SemidiscretizationHyperbolicParabolic"

This reverts commit 063b602.

* allowing for specialization in transform_variables

adding a function `gradient_variable_transformation` which should get specialized if the gradient variables are not conservative variables

* formatting and comments

* reverting elixir

* comments

* standardizing time tol

* minor fix to CNS boundary flux for convenience

make it so that the density state is computed correctly, even though it's not used

* formatting + comments

* using primitive variables in viscous flux instead of conservative

* minor formatting

* add CNS tests

* fix test

* testing if scoping issues fix TreeMesh tests

* decreasing timestep tol for TreeMesh parabolic test

* enabling periodic BCs for TreeMesh + more tests

* fix density BC flux (unused, but could be useful)

* adding non-working TreeMesh elixirs

* adding AD checks

* standardizing parameters in convergence elixirs

* minor cleanup

* revert DGMulti CNS elixir setup back to the one used in tests

* adding TreeMesh CNS convergence test

* removing redundant elixir

* add more tests

* add more test

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* add docstrings

Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Jesse Chan <[email protected]>

* add docstring for CNS equations

* removing some addressed TODOs

* adjust definition of the kappa constant

* avoid overwriting u_grad with viscous_flux results

* remove old TODOs

* clarify TODOs for later

* removing let statements

* rearrange main docstring. Fix typos in math environment causing it to not parse

* update TODO notes

* Apply suggestions from code review

Co-authored-by: Andrew Winters <[email protected]>

* update TODO notes

* Apply suggestions from code review

Co-authored-by: Andrew Winters <[email protected]>

* update TODO notes

* changing diffusivity names

Auto stash before merge of "parabolic-treemesh" and "origin/parabolic-treemesh"

* Reynolds/Prandtl number name changes for consistency

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Co-authored-by: Andrew Winters <[email protected]>

* fixing bug introduced by GH code review

* moving manufactured solution into the CNS equations file

* fix allocation issue

* get_diffusivity -> diffusivity

* removing cruft code, adding comment on messy prim2cons routine

* moving manufactured solution back into elixirs

* Update examples/dgmulti_2d/elixir_advection_diffusion_nonperiodic.jl

* TODO -> Todo, and .6 -> 0.6


d

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* adding note to Adiabatic/Isothermal BCs

* replacing CompressibleNavierStokesEquations with ...Diffusion

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* documenting Jacobian sign flip

* remove extra arg to `gradient_variable_transformation`

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* change warning to error

* fix bug introduced by search/replace

* dg_parabolic -> parabolic_scheme

* BoundaryConditionViscousWall -> BoundaryConditionNavierStokesWall

* u_grad -> gradients

* fix test

* renaming

* update comment

* converting to signature `flux(u, gradients, orientation, equations)`

* using prolong2interfaces/boundaries

* unpacking `gradients` and `flux_viscous`

* using calc_surface_integral!

* adding @muladd

* Apply suggestions from code review

* update comments

* Rename grad_u -> gradients

* Update src/equations/compressible_navier_stokes_2d.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* Rename remaining grad_u/u_grad -> gradients

* Refactor into prolong2interfaces!

* Refactor calc_volume_integral!

* Refactor calc_interface_flux

* Refactor prolong2boundaries!

* Refactor calc_divergence!

* Formatting consistency

* Remove dispatch on volume integral type

* Add comment on why surface_integral is passed to prolong2interfaces!

* Explicitly use weak form volume integral to allow easy overriding in test

* Add flux differencing test for CNS test

* Remove erroneous P4estMesh{2} dispatch

* Remove non-cons terms from parabolic solver

Co-authored-by: Andrew Winters <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Jesse Chan <[email protected]>
Co-authored-by: Jesse Chan <[email protected]>
ranocha added a commit that referenced this pull request Oct 11, 2022
* Parabolic terms for DGMulti (#1136)

* minor formatting

* adding multi-term semidiscretization

* fixing bug and adding test

* changing name

* changing name, importing SplitODEFunction

* fixing test by adding norm

* trying another test fix

* adding norm back

* adjusting tol

* try to fix test again

* syntax error

* removing norm frm test

* adding cache to parabolic terms (enable reuse of inviscid cache)

* generalize dgmulti iterators

* fix typo

* generalizing reset_du! for dgmulti

* WIP gradient and divergence computations

* fix name

* more generalization

* divergence + remove repeated code

* adding cache

* remove test

* update diffusion test

* update diffusion rhs

* moving routines around

* fix multiple includes

* removing time dependence for now from viscous rhs

* export ScalarDiffusion2D

* fix test

* working periodic advection RHS

* cleanup and comments

* making periodic advection-diffusion example

* trim whitespace

* adding t back in to parabolic rhs


add t back in

* refactoring boundary condition code

* update elixir with BCs

* change default DGMulti interface flux behavior

same as in #1139

* cleanup

* renaming variables

* BC prepping

* cleanup of elixir

* more name fixing

* Update src/semidiscretization/semidiscretization_hyperbolic_parabolic.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* adding Neumann BCs

* switching to weak form


weak form


more weak form


weak form

* fixing cache variable names

* simplified parabolic boundary flux treatement

* updated elixir with different types of BCs

* Update src/semidiscretization/semidiscretization_hyperbolic_parabolic.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* Update src/semidiscretization/semidiscretization_hyperbolic_parabolic.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* Update src/equations/equations.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* rhs! -> rhs_parabolic!

* move Gradient/Divergence types

* add "no boundary condition" BC

* rename ScalarDiffusion -> LaplaceDiffusion


r


r

* rhs -> rhs_parabolic! again

* comments

* moving tests around

* scalarDiffusion -> LaplaceDiffusion

* tuple-based constructor

* updating examples

* add ScalarPlotData2D docstring (#1145)

Co-authored-by: Jesse Chan <[email protected]>

* Apply suggestions from code review

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>

* renaming for consistency

parabolic_equations -> equations_parabolic
no_boundary_condition -> boundary_condition_do_nothing

* move Neumann BCs into equations.jl

* renaming, e.g., ParabolicEquations -> EquationsParabolic, etc

* rename test module

* generalize LaplaceDiffusion2D to any number of variables

* removing saveat times and standardizing `tol` names

* parabolic_cache -> cache_parabolic


cache

* renaming `create_cache` -> `create_cache_parabolic`

avoids conflicts when using dg::DGMultiFluxDiff

* Update examples/dgmulti_2d/elixir_advection_diffusion.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* Update src/equations/equations.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* Update src/semidiscretization/semidiscretization_hyperbolic_parabolic.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* parabolic_boundary_conditions -> boundary_conditions_parabolic

similarly for hyperbolic
d

* Update src/semidiscretization/semidiscretization_hyperbolic_parabolic.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* add equations as field to LaplaceDiffusion2D

* moving Neumann BCs into equations.jl and adding default BC behavior

* running parabolic tests, adding integration test

* adding parabolic tests to ci

* missing comma

* Update src/equations/laplace_diffusion_2d.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* fix test

* fix test typo

* fix tests (for real this time)

* improve test coverage

Co-authored-by: Jesse Chan <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* Additional work on parabolic terms  (#1148)

* make "do nothing BC" a struct, move it to basic_types

* add varnames for LaplaceDiffusion

* add forgotten @threaded

* update comment

* Revert "add forgotten @threaded"

This reverts commit 1564501.

* add @threaded (without enumerate)

* remove periodic advection diffusion elixir (redundant)

* adding test

* one more test

* Update src/basic_types.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

Co-authored-by: Jesse Chan <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>

* Reorganization of boundary conditions (#1152)

* moving "default" boundary conditions back into equations file

* add periodic advection_diffusion back in

* updating test

* update test

* Apply suggestions from code review

Co-authored-by: Jesse Chan <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>

* Adding parabolic solver option (#1153)

* adding parabolic solver types

* incorporating parabolic solver types into dg_parabolic penalties

* specializing parabolic solver options in LaplaceDiffusion2D

* moving things around to fix CI

* dropped arg in test

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* renaming files and ViscousFlux solvers


renaming files


rename


rename

* Added TODO note for penalty term

* ViscousFlux___ -> ViscousFormulation___

* move function def around

Co-authored-by: Jesse Chan <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>

* rearrange include order

* Add support for hyperbolic-parabolic systems to TreeMesh2D (#1156)

* Add prototype for advection-diffusion elixir for TreeMesh2D

* Initial implementation of `calc_gradient!` for TreeMesh{2}

* First complete implementation of the parabolic rhs operator for TreeMesh

* Make it work

* Add first elixir that works

* Clean up elixir

* first draft of container for Navier-Stokes constants and fluxes

* remove unneeded temperature computation

* draft of elixir with possible boundary condition structure

* added manufactured solution and source term

* fix typo in function name for MMS

* update variable names for consistency. improve comments

* fix dumb typos in new equation system name

* actually export new equations

* add comment near variable_mapping declaration.

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* parabolic equations now exported separately

* change name to CompressibleNavierStokesEquations2D

* export NS with proper name

* explicitly require compressible Euler in the type parameter

* name kinematic viscosity nu for consistency with Lattice-Boltzmann

* add promotion in constructor

* make Reynolds, Prandtl, Mach, and kappa keyword arguments

* update constructor call in elixir

* reduce computation by exploiting stress tensor symmetry

* fix unpacking of flux

* modifying parabolic cache creation

in cache, we assume we take the gradient of all hyperbolic variables. since the number of parabolic variables can differ from the number of hyperbolic variables, we pass in the hyperbolic equations to `create_cache_parabolic` now

* comments

* comments

* formatting and renaming equations to equations_hyperbolic


formatting comments

* fix unpacking of gradients in flux

* adding CNS BCs

* adding lid-driven cavity elixir

* adding variable transform, editing cons2prim for CNS

* add prim2cons for NS (inconsistent right now)

* add draft of DGMulti Navier Stokes convergence elixir

* converging solution using elixir for TreeMesh with BCs

* fixing DGMulti advection diffusion elixir convergence

* naming equations as parabolic/hyperbolic

* generalizing transform_variables

* add TODO


more todos

* additional checks on get_unsigned_normal

* adding isothermal BC

* commenting out unused CNS functions for now

* fix call to transform_variables

* comments and cleanup

* changing default solver and Re for cavity

* adding more advection diffusion tests

* label tests

* add gradient_variables field to SemidiscretizationHyperbolicParabolic

* Revert "add gradient_variables field to SemidiscretizationHyperbolicParabolic"

This reverts commit 063b602.

* allowing for specialization in transform_variables

adding a function `gradient_variable_transformation` which should get specialized if the gradient variables are not conservative variables

* formatting and comments

* reverting elixir

* comments

* standardizing time tol

* minor fix to CNS boundary flux for convenience

make it so that the density state is computed correctly, even though it's not used

* formatting + comments

* using primitive variables in viscous flux instead of conservative

* minor formatting

* add CNS tests

* fix test

* testing if scoping issues fix TreeMesh tests

* decreasing timestep tol for TreeMesh parabolic test

* enabling periodic BCs for TreeMesh + more tests

* fix density BC flux (unused, but could be useful)

* adding non-working TreeMesh elixirs

* adding AD checks

* standardizing parameters in convergence elixirs

* minor cleanup

* revert DGMulti CNS elixir setup back to the one used in tests

* adding TreeMesh CNS convergence test

* removing redundant elixir

* add more tests

* add more test

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* set version to v0.4.43

* set development version to v0.4.44-pre

* add YouTube links to JuliaCon presentations (#1192)

* add YouTube links to JuliaCon presentations

* Apply suggestions from code review

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* improved readability of equation docstrings in compressible Euler files

* Navier-Stokes in 2D on DGMulti and TreeMesh (#1165)

* first draft of container for Navier-Stokes constants and fluxes

* remove unneeded temperature computation

* draft of elixir with possible boundary condition structure

* added manufactured solution and source term

* fix typo in function name for MMS

* update variable names for consistency. improve comments

* fix dumb typos in new equation system name

* actually export new equations

* add comment near variable_mapping declaration.

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* parabolic equations now exported separately

* change name to CompressibleNavierStokesEquations2D

* export NS with proper name

* explicitly require compressible Euler in the type parameter

* name kinematic viscosity nu for consistency with Lattice-Boltzmann

* add promotion in constructor

* make Reynolds, Prandtl, Mach, and kappa keyword arguments

* update constructor call in elixir

* reduce computation by exploiting stress tensor symmetry

* fix unpacking of flux

* modifying parabolic cache creation

in cache, we assume we take the gradient of all hyperbolic variables. since the number of parabolic variables can differ from the number of hyperbolic variables, we pass in the hyperbolic equations to `create_cache_parabolic` now

* comments

* comments

* formatting and renaming equations to equations_hyperbolic


formatting comments

* fix unpacking of gradients in flux

* adding CNS BCs

* adding lid-driven cavity elixir

* adding variable transform, editing cons2prim for CNS

* add prim2cons for NS (inconsistent right now)

* add draft of DGMulti Navier Stokes convergence elixir

* converging solution using elixir for TreeMesh with BCs

* fixing DGMulti advection diffusion elixir convergence

* naming equations as parabolic/hyperbolic

* generalizing transform_variables

* add TODO


more todos

* additional checks on get_unsigned_normal

* adding isothermal BC

* commenting out unused CNS functions for now

* fix call to transform_variables

* comments and cleanup

* changing default solver and Re for cavity

* adding more advection diffusion tests

* label tests

* add gradient_variables field to SemidiscretizationHyperbolicParabolic

* Revert "add gradient_variables field to SemidiscretizationHyperbolicParabolic"

This reverts commit 063b602.

* allowing for specialization in transform_variables

adding a function `gradient_variable_transformation` which should get specialized if the gradient variables are not conservative variables

* formatting and comments

* reverting elixir

* comments

* standardizing time tol

* minor fix to CNS boundary flux for convenience

make it so that the density state is computed correctly, even though it's not used

* formatting + comments

* using primitive variables in viscous flux instead of conservative

* minor formatting

* add CNS tests

* fix test

* testing if scoping issues fix TreeMesh tests

* decreasing timestep tol for TreeMesh parabolic test

* enabling periodic BCs for TreeMesh + more tests

* fix density BC flux (unused, but could be useful)

* adding non-working TreeMesh elixirs

* adding AD checks

* standardizing parameters in convergence elixirs

* minor cleanup

* revert DGMulti CNS elixir setup back to the one used in tests

* adding TreeMesh CNS convergence test

* removing redundant elixir

* add more tests

* add more test

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* add docstrings

Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Jesse Chan <[email protected]>

* add docstring for CNS equations

* removing some addressed TODOs

* adjust definition of the kappa constant

* avoid overwriting u_grad with viscous_flux results

* remove old TODOs

* clarify TODOs for later

* removing let statements

* rearrange main docstring. Fix typos in math environment causing it to not parse

* update TODO notes

* Apply suggestions from code review

Co-authored-by: Andrew Winters <[email protected]>

* update TODO notes

* Apply suggestions from code review

Co-authored-by: Andrew Winters <[email protected]>

* update TODO notes

* changing diffusivity names

Auto stash before merge of "parabolic-treemesh" and "origin/parabolic-treemesh"

* Reynolds/Prandtl number name changes for consistency

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Co-authored-by: Andrew Winters <[email protected]>

* fixing bug introduced by GH code review

* moving manufactured solution into the CNS equations file

* fix allocation issue

* get_diffusivity -> diffusivity

* removing cruft code, adding comment on messy prim2cons routine

* moving manufactured solution back into elixirs

* Update examples/dgmulti_2d/elixir_advection_diffusion_nonperiodic.jl

* TODO -> Todo, and .6 -> 0.6


d

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* adding note to Adiabatic/Isothermal BCs

* replacing CompressibleNavierStokesEquations with ...Diffusion

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* documenting Jacobian sign flip

* remove extra arg to `gradient_variable_transformation`

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* change warning to error

* fix bug introduced by search/replace

* dg_parabolic -> parabolic_scheme

* BoundaryConditionViscousWall -> BoundaryConditionNavierStokesWall

* u_grad -> gradients

* fix test

* renaming

* update comment

* converting to signature `flux(u, gradients, orientation, equations)`

* using prolong2interfaces/boundaries

* unpacking `gradients` and `flux_viscous`

* using calc_surface_integral!

* adding @muladd

* Apply suggestions from code review

* update comments

* Rename grad_u -> gradients

* Update src/equations/compressible_navier_stokes_2d.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* Rename remaining grad_u/u_grad -> gradients

* Refactor into prolong2interfaces!

* Refactor calc_volume_integral!

* Refactor calc_interface_flux

* Refactor prolong2boundaries!

* Refactor calc_divergence!

* Formatting consistency

* Remove dispatch on volume integral type

* Add comment on why surface_integral is passed to prolong2interfaces!

* Explicitly use weak form volume integral to allow easy overriding in test

* Add flux differencing test for CNS test

* Remove erroneous P4estMesh{2} dispatch

* Remove non-cons terms from parabolic solver

Co-authored-by: Andrew Winters <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Jesse Chan <[email protected]>
Co-authored-by: Jesse Chan <[email protected]>

* Add commentary on reuse of interfaces/boundaries data structures (#1199)

* Add comments on storing flux values in `u`

* Rearrange function names for consistency

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update src/solvers/dgsem_tree/dg_2d_parabolic.jl

Co-authored-by: Andrew Winters <[email protected]>

Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Andrew Winters <[email protected]>

* Adding parabolic term description to NEWS.md (#1207)

* Add Literate docs for advection-diffusion (#1208)

* adding literate docs for advection-diffusion

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* rename "adding parabolic terms" -> "parabolic terms"

Co-authored-by: Hendrik Ranocha <[email protected]>

* Adding a tutorial on adding new parabolic terms (#1209)

* Viscous terms from entropy gradients (#1202)

* first draft of entropy stable gradients

* update TODOs

* added elixir with discontinuous solution for ES testing

* forgot one TODO marker

* adding GradientVariables**** type parameter

* fix bug (missing type param in constructor)

* add elixir with periodic CNS manufactured solution

* fix gradient conversion

* fix entropy variables w/BCs

* updating elixirs with `gradient_variables=GradientVariablesPrimitive()`

* Update src/equations/compressible_navier_stokes_2d.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* removing unused routines

* removing specialized entropy2cons and cons2entropy routines

* adding more tests

* removing unused elixirs

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>

* adding docs/warning for gradient variable type

* extracting w_inner[4] into a more clearly named variable

Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Jesse Chan <[email protected]>
Co-authored-by: Jesse Chan <[email protected]>
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Co-authored-by: Jesse Chan <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>

* adding some minor documentation (#1214)

* fix parabolic PID (#1224)

* fix parabolic PID

* activate analysis_callback in Navier-Stokes convergence test

* fix typo

* Rescale compressible Navier-Stokes (#1230)

* remove the nondimensionalization and update the docstring for CNS

* update TreeMesh elixirs and test values

* update the elixirs and test values for DGMulti

* fix unbalanced parentheses

* file renaming for consistency

* update file names in the parabolic test script

* remove the gas constant as a parameter and update comments

* rename viscosity to dynamic_viscosity

* add comment about units in the docstring

* Update src/equations/compressible_navier_stokes_2d.jl

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* unify notation to call the viscosity mu

* fix undefined variable

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

* improve type stability of semidiscretize for parabolic semi (#1231)

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Andrew Winters <[email protected]>
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.

4 participants