Skip to content

Commit

Permalink
Merge branch 'main' into AMR_Parabolic_2D3D_Tree
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring authored Sep 20, 2023
2 parents 4699a10 + ea4e2cd commit 306c9b0
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 43 deletions.
38 changes: 28 additions & 10 deletions src/equations/compressible_navier_stokes_1d.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# By default, Julia/LLVM does not use fused multiply-add operations (FMAs).
# Since these FMAs can increase the performance of many numerical algorithms,
# we need to opt-in explicitly.
# See https://ranocha.de/blog/Optimizing_EC_Trixi for further details.
@muladd begin
#! format: noindent

@doc raw"""
CompressibleNavierStokesDiffusion1D(equations; mu, Pr,
gradient_variables=GradientVariablesPrimitive())
Expand Down Expand Up @@ -77,7 +84,8 @@ w_2 = \frac{\rho v1}{p},\, w_3 = -\frac{\rho}{p}
This code is experimental and may be changed or removed in any future release.
"""
struct CompressibleNavierStokesDiffusion1D{GradientVariables, RealT <: Real,
E <: AbstractCompressibleEulerEquations{1}} <:
E <: AbstractCompressibleEulerEquations{1}
} <:
AbstractCompressibleNavierStokesDiffusion{1, 3}
# TODO: parabolic
# 1) For now save gamma and inv(gamma-1) again, but could potentially reuse them from the Euler equations
Expand Down Expand Up @@ -109,7 +117,8 @@ function CompressibleNavierStokesDiffusion1D(equations::CompressibleEulerEquatio
CompressibleNavierStokesDiffusion1D{typeof(gradient_variables), typeof(gamma),
typeof(equations)}(gamma, inv_gamma_minus_one,
μ, Pr, kappa,
equations, gradient_variables)
equations,
gradient_variables)
end

# TODO: parabolic
Expand Down Expand Up @@ -263,7 +272,8 @@ end
u_inner,
orientation::Integer,
direction,
x, t,
x,
t,
operator_type::Gradient,
equations::CompressibleNavierStokesDiffusion1D{
GradientVariablesPrimitive
Expand All @@ -278,7 +288,8 @@ end
u_inner,
orientation::Integer,
direction,
x, t,
x,
t,
operator_type::Divergence,
equations::CompressibleNavierStokesDiffusion1D{
GradientVariablesPrimitive
Expand All @@ -299,7 +310,8 @@ end
u_inner,
orientation::Integer,
direction,
x, t,
x,
t,
operator_type::Gradient,
equations::CompressibleNavierStokesDiffusion1D{
GradientVariablesPrimitive
Expand All @@ -316,7 +328,8 @@ end
u_inner,
orientation::Integer,
direction,
x, t,
x,
t,
operator_type::Divergence,
equations::CompressibleNavierStokesDiffusion1D{
GradientVariablesPrimitive
Expand All @@ -337,7 +350,8 @@ end
w_inner,
orientation::Integer,
direction,
x, t,
x,
t,
operator_type::Gradient,
equations::CompressibleNavierStokesDiffusion1D{
GradientVariablesEntropy
Expand All @@ -354,7 +368,8 @@ end
w_inner,
orientation::Integer,
direction,
x, t,
x,
t,
operator_type::Divergence,
equations::CompressibleNavierStokesDiffusion1D{
GradientVariablesEntropy
Expand All @@ -374,7 +389,8 @@ end
w_inner,
orientation::Integer,
direction,
x, t,
x,
t,
operator_type::Gradient,
equations::CompressibleNavierStokesDiffusion1D{
GradientVariablesEntropy
Expand All @@ -394,10 +410,12 @@ end
w_inner,
orientation::Integer,
direction,
x, t,
x,
t,
operator_type::Divergence,
equations::CompressibleNavierStokesDiffusion1D{
GradientVariablesEntropy
})
return SVector(flux_inner[1], flux_inner[2], flux_inner[3])
end
end # @muladd
Loading

0 comments on commit 306c9b0

Please sign in to comment.