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

@muladd for Navier Stokes #1644

Merged
merged 4 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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}
ranocha marked this conversation as resolved.
Show resolved Hide resolved
} <:
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
Loading