-
Notifications
You must be signed in to change notification settings - Fork 112
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 1D #1597
Navier-Stokes 1D #1597
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1597 +/- ##
===========================================
+ Coverage 84.97% 96.30% +11.33%
===========================================
Files 402 405 +3
Lines 33046 33250 +204
===========================================
+ Hits 28078 32020 +3942
+ Misses 4968 1230 -3738
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Thanks for adding this! I just have a small comment on coverage
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.
Thanks for catching these!
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 doesn't look like the 1D parabolic boundary conditions are tested anywhere. Would it be possible to modify this elixir to be non-periodic?
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.
Should be, I can try the y-direction from the 2D example to test wall & adiabatic BCs.
""" | ||
struct BoundaryConditionNavierStokesWall | ||
|
||
Creates a wall-type boundary conditions for the compressible Navier-Stokes equations. | ||
The fields `boundary_condition_velocity` and `boundary_condition_heat_flux` are intended | ||
to be boundary condition types such as the `NoSlip` velocity boundary condition and the | ||
`Adiabatic` or `Isothermal` heat boundary condition. | ||
|
||
!!! warning "Experimental feature" | ||
This is an experimental feature and may change in future releases. | ||
""" | ||
struct BoundaryConditionNavierStokesWall{V, H} | ||
boundary_condition_velocity::V | ||
boundary_condition_heat_flux::H | ||
end | ||
|
||
""" | ||
struct NoSlip | ||
|
||
Use to create a no-slip boundary condition with `BoundaryConditionNavierStokesWall`. The field `boundary_value_function` | ||
should be a function with signature `boundary_value_function(x, t, equations)` | ||
and should return a `SVector{NDIMS}` whose entries are the velocity vector at a | ||
point `x` and time `t`. | ||
""" | ||
struct NoSlip{F} | ||
boundary_value_function::F # value of the velocity vector on the boundary | ||
end | ||
|
||
""" | ||
struct Isothermal | ||
|
||
Used to create a no-slip boundary condition with [`BoundaryConditionNavierStokesWall`](@ref). | ||
The field `boundary_value_function` should be a function with signature | ||
`boundary_value_function(x, t, equations)` and return a scalar value for the | ||
temperature at point `x` and time `t`. | ||
""" | ||
struct Isothermal{F} | ||
boundary_value_function::F # value of the temperature on the boundary | ||
end | ||
|
||
""" | ||
struct Adiabatic | ||
|
||
Used to create a no-slip boundary condition with [`BoundaryConditionNavierStokesWall`](@ref). | ||
The field `boundary_value_normal_flux_function` should be a function with signature | ||
`boundary_value_normal_flux_function(x, t, equations)` and return a scalar value for the | ||
normal heat flux at point `x` and time `t`. | ||
""" | ||
struct Adiabatic{F} | ||
boundary_value_normal_flux_function::F # scaled heat flux 1/T * kappa * dT/dn | ||
end |
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.
Aren't these structs already defined in the file for the 2D system? Since the structs are generic, could we please move them to another file - maybe src/equations/compressible_navier_stokes.jl
?
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.
Yes and no - I moved them from 2D to 1D for now. Adding a seperate file src/equations/compressible_navier_stokes.jl
is a more expressive way, I think
""" | ||
!!! warning "Experimental code" | ||
This code is experimental and may be changed or removed in any future release. | ||
|
||
`GradientVariablesPrimitive` and `GradientVariablesEntropy` are gradient variable type parameters | ||
for `CompressibleNavierStokesDiffusion1D`. By default, the gradient variables are set to be | ||
`GradientVariablesPrimitive`. Specifying `GradientVariablesEntropy` instead uses the entropy variable | ||
formulation from | ||
- Hughes, Mallet, Franca (1986) | ||
A new finite element formulation for computational fluid dynamics: I. Symmetric forms of the | ||
compressible Euler and Navier-Stokes equations and the second law of thermodynamics. | ||
[https://doi.org/10.1016/0045-7825(86)90127-1](https://doi.org/10.1016/0045-7825(86)90127-1) | ||
|
||
Under `GradientVariablesEntropy`, the Navier-Stokes discretization is provably entropy stable. | ||
""" | ||
struct GradientVariablesPrimitive end | ||
struct GradientVariablesEntropy end |
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.
See below
So I adapted the non-periodic direction from the 2D example. For this, I had to add Convergence of the example:
|
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.
Looks very good. I have two minor suggestions to make sure we test all the BC and gradient variables functionality.
examples/tree_1d_dgsem/elixir_navierstokes_convergence_walls.jl
Outdated
Show resolved
Hide resolved
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.
Looks great! Thanks for adding this.
Related to #1147
Convergence study: