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

Sutherlands Law for temperature dependent viscosity #1808

Merged
merged 45 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8b0ad52
sample 2D
DanielDoehring Jan 19, 2024
cb8366a
bug fixes
DanielDoehring Jan 19, 2024
4cb135b
typo
DanielDoehring Jan 21, 2024
4819fc3
sutherlands 1d
DanielDoehring Jan 21, 2024
56afd97
sutherlands 3d
DanielDoehring Jan 21, 2024
96339b9
Merge branch 'main' into SutherlandsLaw
DanielDoehring Jan 21, 2024
3ba7388
fmt
DanielDoehring Jan 21, 2024
4cf4db7
Merge branch 'main' into SutherlandsLaw
DanielDoehring Jan 22, 2024
fe859cc
Merge branch 'main' into SutherlandsLaw
DanielDoehring Jan 23, 2024
33e0c44
Merge branch 'main' into SutherlandsLaw
DanielDoehring Jan 31, 2024
428d05f
Merge branch 'main' into SutherlandsLaw
DanielDoehring Jan 31, 2024
9e8cf27
Merge branch 'main' into SutherlandsLaw
DanielDoehring Jan 31, 2024
df9a0cc
Merge branch 'main' into SutherlandsLaw
DanielDoehring Feb 1, 2024
5307c84
main merge
DanielDoehring Mar 6, 2024
bf1f79e
Merge branch 'main' into SutherlandsLaw
DanielDoehring Mar 6, 2024
9db2b64
test var mu
DanielDoehring Mar 6, 2024
d6fd3bd
variable mu
DanielDoehring Mar 6, 2024
ddc258b
Merge branch 'SutherlandsLaw' of github.com:DanielDoehring/Trixi.jl i…
DanielDoehring Mar 6, 2024
0507e1a
fmt
DanielDoehring Mar 6, 2024
bf88ef8
example using sutherland
DanielDoehring Mar 6, 2024
6e4f1d1
comment
DanielDoehring Mar 6, 2024
dc794f9
example
DanielDoehring Mar 6, 2024
4ddd55c
reset toml
DanielDoehring Mar 6, 2024
7abf37f
Merge branch 'main' into SutherlandsLaw
DanielDoehring Mar 6, 2024
4ec5a29
Merge branch 'main' into SutherlandsLaw
DanielDoehring Mar 6, 2024
1516991
Shorten
DanielDoehring Mar 7, 2024
15f47d6
Unit test
DanielDoehring Mar 7, 2024
08347d9
fmt
DanielDoehring Mar 7, 2024
99c7ef2
Update examples/tree_2d_dgsem/elixir_navierstokes_taylor_green_vortex…
DanielDoehring Mar 18, 2024
b07287d
remove todo
DanielDoehring Mar 18, 2024
40287d0
Merge branch 'main' into SutherlandsLaw
DanielDoehring Mar 18, 2024
319005e
Apply suggestions from code review
DanielDoehring Mar 18, 2024
4ddfaf6
test vals
DanielDoehring Mar 18, 2024
040eca8
non-functionalized mu
DanielDoehring Mar 19, 2024
1b55228
comments & dosctrings
DanielDoehring Mar 19, 2024
4580ac8
docstrings
DanielDoehring Mar 19, 2024
08bd818
fix tests
DanielDoehring Mar 19, 2024
b0d2c6e
avoid if
DanielDoehring Mar 22, 2024
03c7c88
docstring and comments
DanielDoehring Mar 22, 2024
e521e09
Merge branch 'main' into SutherlandsLaw
DanielDoehring Mar 22, 2024
e743e8d
Update src/equations/compressible_navier_stokes.jl
DanielDoehring Mar 22, 2024
5c4c001
fmt
DanielDoehring Mar 22, 2024
c9a26ae
Merge branch 'SutherlandsLaw' of github.com:DanielDoehring/Trixi.jl i…
DanielDoehring Mar 22, 2024
f9091d9
Merge branch 'main' into SutherlandsLaw
DanielDoehring Mar 25, 2024
042b18e
Merge branch 'main' into SutherlandsLaw
jlchan Mar 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/equations/compressible_navier_stokes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,17 @@ Under `GradientVariablesEntropy`, the Navier-Stokes discretization is provably e
"""
struct GradientVariablesPrimitive end
struct GradientVariablesEntropy end

"""
dynamic_viscosity(u, equations)

Wrapper for the dynamic viscosity that calls
`dynamic_viscosity(u, equations.mu, equations)` which dispatches on the type of
`equations.mu`.
For constant `equations.mu`, i.e., `equations.mu` is of `Real`-type it is returned directly.
In the opposite case, `equations.mu` is assumed to be a function with arguments
`u` and `equations` and is called with these arguments.
DanielDoehring marked this conversation as resolved.
Show resolved Hide resolved
"""
dynamic_viscosity(u, equations) = dynamic_viscosity(u, equations.mu, equations)
dynamic_viscosity(u, mu::Real, equations) = mu
dynamic_viscosity(u, mu::T, equations) where {T} = mu(u, equations)
10 changes: 3 additions & 7 deletions src/equations/compressible_navier_stokes_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,9 @@ function flux(u, gradients, orientation::Integer,
# In the simplest cases, the user passed in `mu` or `mu()`
# (which returns just a constant) but
# more complex functions like Sutherland's law are possible.
if equations.mu isa Real
mu = equations.mu
else
# The equations are equipped with a function that computes the dynamic viscosity mu
# from the current state.
mu = equations.mu(u, equations)
end
# `dynamic_viscosity` is a helper function that handles both cases
# by dispatching on the type of `equations.mu`.
mu = dynamic_viscosity(u, equations)

# viscous flux components in the x-direction
f1 = zero(rho)
Expand Down
10 changes: 3 additions & 7 deletions src/equations/compressible_navier_stokes_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,9 @@ function flux(u, gradients, orientation::Integer,
# In the simplest cases, the user passed in `mu` or `mu()`
# (which returns just a constant) but
# more complex functions like Sutherland's law are possible.
if equations.mu isa Real
mu = equations.mu
else
# The equations are equipped with a function that computes the dynamic viscosity mu
# from the current state.
mu = equations.mu(u, equations)
end
# `dynamic_viscosity` is a helper function that handles both cases
# by dispatching on the type of `equations.mu`.
mu = dynamic_viscosity(u, equations)

if orientation == 1
# viscous flux components in the x-direction
Expand Down
10 changes: 3 additions & 7 deletions src/equations/compressible_navier_stokes_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,9 @@ function flux(u, gradients, orientation::Integer,
# In the simplest cases, the user passed in `mu` or `mu()`
# (which returns just a constant) but
# more complex functions like Sutherland's law are possible.
if equations.mu isa Real
mu = equations.mu
else
# The equations are equipped with a function that computes the dynamic viscosity mu
# from the current state.
mu = equations.mu(u, equations)
end
# `dynamic_viscosity` is a helper function that handles both cases
# by dispatching on the type of `equations.mu`.
mu = dynamic_viscosity(u, equations)

if orientation == 1
# viscous flux components in the x-direction
Expand Down
Loading