From 040eca81c5a6c1c94b0b60b0598f60354e22f050 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Tue, 19 Mar 2024 13:49:28 +0100 Subject: [PATCH] non-functionalized mu --- examples/dgmulti_2d/elixir_navierstokes_convergence.jl | 6 +++--- .../elixir_navierstokes_convergence_curved.jl | 6 +++--- .../elixir_navierstokes_lid_driven_cavity.jl | 2 +- examples/dgmulti_3d/elixir_navierstokes_convergence.jl | 6 +++--- .../elixir_navierstokes_convergence_curved.jl | 6 +++--- .../elixir_navierstokes_taylor_green_vortex.jl | 2 +- .../p4est_2d_dgsem/elixir_navierstokes_convergence.jl | 6 +++--- .../elixir_navierstokes_convergence_nonperiodic.jl | 6 +++--- .../elixir_navierstokes_lid_driven_cavity.jl | 2 +- .../elixir_navierstokes_lid_driven_cavity_amr.jl | 2 +- .../elixir_navierstokes_blast_wave_amr.jl | 2 +- .../p4est_3d_dgsem/elixir_navierstokes_convergence.jl | 6 +++--- .../elixir_navierstokes_taylor_green_vortex.jl | 2 +- .../elixir_navierstokes_taylor_green_vortex_amr.jl | 2 +- .../elixir_navierstokes_convergence_periodic.jl | 6 +++--- .../elixir_navierstokes_convergence_walls.jl | 6 +++--- .../elixir_navierstokes_convergence_walls_amr.jl | 6 +++--- .../tree_2d_dgsem/elixir_navierstokes_convergence.jl | 6 +++--- .../elixir_navierstokes_lid_driven_cavity.jl | 2 +- .../elixir_navierstokes_shearlayer_amr.jl | 2 +- .../elixir_navierstokes_taylor_green_vortex.jl | 2 +- .../tree_3d_dgsem/elixir_navierstokes_convergence.jl | 6 +++--- .../elixir_navierstokes_taylor_green_vortex.jl | 2 +- src/equations/compressible_navier_stokes_1d.jl | 10 +++++++--- src/equations/compressible_navier_stokes_2d.jl | 10 +++++++--- src/equations/compressible_navier_stokes_3d.jl | 10 +++++++--- 26 files changed, 68 insertions(+), 56 deletions(-) diff --git a/examples/dgmulti_2d/elixir_navierstokes_convergence.jl b/examples/dgmulti_2d/elixir_navierstokes_convergence.jl index f275fdaa9dd..38cf3d7984b 100644 --- a/examples/dgmulti_2d/elixir_navierstokes_convergence.jl +++ b/examples/dgmulti_2d/elixir_navierstokes_convergence.jl @@ -5,12 +5,12 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations2D(1.4) # Note: If you change the Navier-Stokes parameters here, also change them in the initial condition # I really do not like this structure but it should work for now -equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -55,7 +55,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Same settings as in `initial_condition` # Amplitude and shift diff --git a/examples/dgmulti_2d/elixir_navierstokes_convergence_curved.jl b/examples/dgmulti_2d/elixir_navierstokes_convergence_curved.jl index 16db3ff7cbf..87ffd0e0995 100644 --- a/examples/dgmulti_2d/elixir_navierstokes_convergence_curved.jl +++ b/examples/dgmulti_2d/elixir_navierstokes_convergence_curved.jl @@ -5,12 +5,12 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations2D(1.4) # Note: If you change the Navier-Stokes parameters here, also change them in the initial condition # I really do not like this structure but it should work for now -equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -63,7 +63,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Same settings as in `initial_condition` # Amplitude and shift diff --git a/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl b/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl index 33fcae1c665..a612dd0e0d5 100644 --- a/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl +++ b/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl @@ -5,7 +5,7 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.001 +mu = 0.001 equations = CompressibleEulerEquations2D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, diff --git a/examples/dgmulti_3d/elixir_navierstokes_convergence.jl b/examples/dgmulti_3d/elixir_navierstokes_convergence.jl index 63f689683aa..5fa0ad7ce60 100644 --- a/examples/dgmulti_3d/elixir_navierstokes_convergence.jl +++ b/examples/dgmulti_3d/elixir_navierstokes_convergence.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations3D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -57,7 +57,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Constants. OBS! Must match those in `initial_condition_navier_stokes_convergence_test` c = 2.0 diff --git a/examples/dgmulti_3d/elixir_navierstokes_convergence_curved.jl b/examples/dgmulti_3d/elixir_navierstokes_convergence_curved.jl index 3b530d14a22..c58d78d2581 100644 --- a/examples/dgmulti_3d/elixir_navierstokes_convergence_curved.jl +++ b/examples/dgmulti_3d/elixir_navierstokes_convergence_curved.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations3D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -65,7 +65,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Constants. OBS! Must match those in `initial_condition_navier_stokes_convergence_test` c = 2.0 diff --git a/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl b/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl index 4f0e3c437db..9ae90ac47b6 100644 --- a/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl +++ b/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl @@ -6,7 +6,7 @@ using Trixi # semidiscretization of the compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 6.25e-4 # equivalent to Re = 1600 +mu = 6.25e-4 # equivalent to Re = 1600 equations = CompressibleEulerEquations3D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, diff --git a/examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl b/examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl index ca8c41a1310..54ec09d2be8 100644 --- a/examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl +++ b/examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations2D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -55,7 +55,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Same settings as in `initial_condition` # Amplitude and shift diff --git a/examples/p4est_2d_dgsem/elixir_navierstokes_convergence_nonperiodic.jl b/examples/p4est_2d_dgsem/elixir_navierstokes_convergence_nonperiodic.jl index 5cd8d49157e..b4177fe8538 100644 --- a/examples/p4est_2d_dgsem/elixir_navierstokes_convergence_nonperiodic.jl +++ b/examples/p4est_2d_dgsem/elixir_navierstokes_convergence_nonperiodic.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations2D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -55,7 +55,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Same settings as in `initial_condition` # Amplitude and shift diff --git a/examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity.jl b/examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity.jl index 7480548384c..728736fe49e 100644 --- a/examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity.jl +++ b/examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity.jl @@ -5,7 +5,7 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.001 +mu = 0.001 equations = CompressibleEulerEquations2D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, diff --git a/examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity_amr.jl b/examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity_amr.jl index 19097cc11e6..d9eaf4fdb72 100644 --- a/examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity_amr.jl @@ -5,7 +5,7 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.001 +mu = 0.001 equations = CompressibleEulerEquations2D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, diff --git a/examples/p4est_3d_dgsem/elixir_navierstokes_blast_wave_amr.jl b/examples/p4est_3d_dgsem/elixir_navierstokes_blast_wave_amr.jl index 3db2c4ae8f2..d556d0ab70d 100644 --- a/examples/p4est_3d_dgsem/elixir_navierstokes_blast_wave_amr.jl +++ b/examples/p4est_3d_dgsem/elixir_navierstokes_blast_wave_amr.jl @@ -6,7 +6,7 @@ using Trixi # semidiscretization of the compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 6.25e-4 # equivalent to Re = 1600 +mu = 6.25e-4 # equivalent to Re = 1600 equations = CompressibleEulerEquations3D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, diff --git a/examples/p4est_3d_dgsem/elixir_navierstokes_convergence.jl b/examples/p4est_3d_dgsem/elixir_navierstokes_convergence.jl index 9a4bc304a5a..c640b255b05 100644 --- a/examples/p4est_3d_dgsem/elixir_navierstokes_convergence.jl +++ b/examples/p4est_3d_dgsem/elixir_navierstokes_convergence.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations3D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -58,7 +58,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Constants. OBS! Must match those in `initial_condition_navier_stokes_convergence_test` c = 2.0 diff --git a/examples/p4est_3d_dgsem/elixir_navierstokes_taylor_green_vortex.jl b/examples/p4est_3d_dgsem/elixir_navierstokes_taylor_green_vortex.jl index 27ebfd2d607..9c90e4d3218 100644 --- a/examples/p4est_3d_dgsem/elixir_navierstokes_taylor_green_vortex.jl +++ b/examples/p4est_3d_dgsem/elixir_navierstokes_taylor_green_vortex.jl @@ -6,7 +6,7 @@ using Trixi # semidiscretization of the compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 6.25e-4 # equivalent to Re = 1600 +mu = 6.25e-4 # equivalent to Re = 1600 equations = CompressibleEulerEquations3D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, diff --git a/examples/p4est_3d_dgsem/elixir_navierstokes_taylor_green_vortex_amr.jl b/examples/p4est_3d_dgsem/elixir_navierstokes_taylor_green_vortex_amr.jl index cd1733987dc..2741f0df174 100644 --- a/examples/p4est_3d_dgsem/elixir_navierstokes_taylor_green_vortex_amr.jl +++ b/examples/p4est_3d_dgsem/elixir_navierstokes_taylor_green_vortex_amr.jl @@ -6,7 +6,7 @@ using Trixi # semidiscretization of the compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 6.25e-4 # equivalent to Re = 1600 +mu = 6.25e-4 # equivalent to Re = 1600 equations = CompressibleEulerEquations3D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, diff --git a/examples/tree_1d_dgsem/elixir_navierstokes_convergence_periodic.jl b/examples/tree_1d_dgsem/elixir_navierstokes_convergence_periodic.jl index 959330db40f..eab0840f385 100644 --- a/examples/tree_1d_dgsem/elixir_navierstokes_convergence_periodic.jl +++ b/examples/tree_1d_dgsem/elixir_navierstokes_convergence_periodic.jl @@ -6,10 +6,10 @@ using Trixi # semidiscretization of the compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 6.25e-4 # equivalent to Re = 1600 +mu() = 6.25e-4 # equivalent to Re = 1600 equations = CompressibleEulerEquations1D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion1D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion1D(equations, mu = mu(), Prandtl = prandtl_number()) # This convergence test setup was originally derived by Andrew Winters (@andrewwinters5000) @@ -36,7 +36,7 @@ initial_condition = initial_condition_navier_stokes_convergence_test # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Same settings as in `initial_condition` # Amplitude and shift diff --git a/examples/tree_1d_dgsem/elixir_navierstokes_convergence_walls.jl b/examples/tree_1d_dgsem/elixir_navierstokes_convergence_walls.jl index ded250423b9..40030d53345 100644 --- a/examples/tree_1d_dgsem/elixir_navierstokes_convergence_walls.jl +++ b/examples/tree_1d_dgsem/elixir_navierstokes_convergence_walls.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations1D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion1D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion1D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -53,7 +53,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Same settings as in `initial_condition` # Amplitude and shift diff --git a/examples/tree_1d_dgsem/elixir_navierstokes_convergence_walls_amr.jl b/examples/tree_1d_dgsem/elixir_navierstokes_convergence_walls_amr.jl index 3391cc8a324..e833155a68e 100644 --- a/examples/tree_1d_dgsem/elixir_navierstokes_convergence_walls_amr.jl +++ b/examples/tree_1d_dgsem/elixir_navierstokes_convergence_walls_amr.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations1D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion1D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion1D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesEntropy()) @@ -53,7 +53,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Same settings as in `initial_condition` # Amplitude and shift diff --git a/examples/tree_2d_dgsem/elixir_navierstokes_convergence.jl b/examples/tree_2d_dgsem/elixir_navierstokes_convergence.jl index 45b7eed31d3..b0c8678baad 100644 --- a/examples/tree_2d_dgsem/elixir_navierstokes_convergence.jl +++ b/examples/tree_2d_dgsem/elixir_navierstokes_convergence.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations2D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -55,7 +55,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Same settings as in `initial_condition` # Amplitude and shift diff --git a/examples/tree_2d_dgsem/elixir_navierstokes_lid_driven_cavity.jl b/examples/tree_2d_dgsem/elixir_navierstokes_lid_driven_cavity.jl index 191d8df55b2..b8e20e27f66 100644 --- a/examples/tree_2d_dgsem/elixir_navierstokes_lid_driven_cavity.jl +++ b/examples/tree_2d_dgsem/elixir_navierstokes_lid_driven_cavity.jl @@ -5,7 +5,7 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.001 +mu = 0.001 equations = CompressibleEulerEquations2D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, diff --git a/examples/tree_2d_dgsem/elixir_navierstokes_shearlayer_amr.jl b/examples/tree_2d_dgsem/elixir_navierstokes_shearlayer_amr.jl index b1b86641bd7..a7492bafb47 100644 --- a/examples/tree_2d_dgsem/elixir_navierstokes_shearlayer_amr.jl +++ b/examples/tree_2d_dgsem/elixir_navierstokes_shearlayer_amr.jl @@ -6,7 +6,7 @@ using Trixi # semidiscretization of the compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 1.0 / 3.0 * 10^(-4) # equivalent to Re = 30,000 +mu = 1.0 / 3.0 * 10^(-4) # equivalent to Re = 30,000 equations = CompressibleEulerEquations2D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, diff --git a/examples/tree_2d_dgsem/elixir_navierstokes_taylor_green_vortex.jl b/examples/tree_2d_dgsem/elixir_navierstokes_taylor_green_vortex.jl index d17d0076ecd..c6e5f0bc40a 100644 --- a/examples/tree_2d_dgsem/elixir_navierstokes_taylor_green_vortex.jl +++ b/examples/tree_2d_dgsem/elixir_navierstokes_taylor_green_vortex.jl @@ -6,7 +6,7 @@ using Trixi # semidiscretization of the compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 6.25e-4 # equivalent to Re = 1600 +mu = 6.25e-4 # equivalent to Re = 1600 equations = CompressibleEulerEquations2D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, diff --git a/examples/tree_3d_dgsem/elixir_navierstokes_convergence.jl b/examples/tree_3d_dgsem/elixir_navierstokes_convergence.jl index 69d14d06bf3..3ada9503c6a 100644 --- a/examples/tree_3d_dgsem/elixir_navierstokes_convergence.jl +++ b/examples/tree_3d_dgsem/elixir_navierstokes_convergence.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 0.01 +mu() = 0.01 equations = CompressibleEulerEquations3D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu(), Prandtl = prandtl_number(), gradient_variables = GradientVariablesPrimitive()) @@ -58,7 +58,7 @@ end # see also https://github.com/trixi-framework/Trixi.jl/pull/1160 inv_gamma_minus_one = inv(equations.gamma - 1) Pr = prandtl_number() - mu_ = mu(u, equations) + mu_ = mu() # Constants. OBS! Must match those in `initial_condition_navier_stokes_convergence_test` c = 2.0 diff --git a/examples/tree_3d_dgsem/elixir_navierstokes_taylor_green_vortex.jl b/examples/tree_3d_dgsem/elixir_navierstokes_taylor_green_vortex.jl index 6845a3a47f3..3e54c791ec6 100644 --- a/examples/tree_3d_dgsem/elixir_navierstokes_taylor_green_vortex.jl +++ b/examples/tree_3d_dgsem/elixir_navierstokes_taylor_green_vortex.jl @@ -6,7 +6,7 @@ using Trixi # semidiscretization of the compressible Navier-Stokes equations prandtl_number() = 0.72 -mu(u, equations) = 6.25e-4 # equivalent to Re = 1600 +mu = 6.25e-4 # equivalent to Re = 1600 equations = CompressibleEulerEquations3D(1.4) equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, diff --git a/src/equations/compressible_navier_stokes_1d.jl b/src/equations/compressible_navier_stokes_1d.jl index f8b76d5cc69..94135d346d7 100644 --- a/src/equations/compressible_navier_stokes_1d.jl +++ b/src/equations/compressible_navier_stokes_1d.jl @@ -160,11 +160,15 @@ function flux(u, gradients, orientation::Integer, # in the implementation q1 = equations.kappa * dTdx - # The equations are equipped with a function that computes the dynamic viscosity mu - # from the current state. # In the simplest case, `mu(u, equations)` returns just a constant but # more complex functions like Sutherland's law are possible. - mu = equations.mu(u, equations) + if equations.mu isa Real + mu = equations.mu + # The equations are equipped with a function that computes the dynamic viscosity mu + # from the current state. + else + mu = equations.mu(u, equations) + end # viscous flux components in the x-direction f1 = zero(rho) diff --git a/src/equations/compressible_navier_stokes_2d.jl b/src/equations/compressible_navier_stokes_2d.jl index 8b83524245d..40c681ca9b7 100644 --- a/src/equations/compressible_navier_stokes_2d.jl +++ b/src/equations/compressible_navier_stokes_2d.jl @@ -169,11 +169,15 @@ function flux(u, gradients, orientation::Integer, q1 = equations.kappa * dTdx q2 = equations.kappa * dTdy - # The equations are equipped with a function that computes the dynamic viscosity mu - # from the current state. # In the simplest case, `mu(u, equations)` returns just a constant but # more complex functions like Sutherland's law are possible. - mu = equations.mu(u, equations) + if equations.mu isa Real + mu = equations.mu + # The equations are equipped with a function that computes the dynamic viscosity mu + # from the current state. + else + mu = equations.mu(u, equations) + end if orientation == 1 # viscous flux components in the x-direction diff --git a/src/equations/compressible_navier_stokes_3d.jl b/src/equations/compressible_navier_stokes_3d.jl index 42b66fadb81..6e99fb630e5 100644 --- a/src/equations/compressible_navier_stokes_3d.jl +++ b/src/equations/compressible_navier_stokes_3d.jl @@ -182,11 +182,15 @@ function flux(u, gradients, orientation::Integer, q2 = equations.kappa * dTdy q3 = equations.kappa * dTdz - # The equations are equipped with a function that computes the dynamic viscosity mu - # from the current state. # In the simplest case, `mu(u, equations)` returns just a constant but # more complex functions like Sutherland's law are possible. - mu = equations.mu(u, equations) + if equations.mu isa Real + mu = equations.mu + # The equations are equipped with a function that computes the dynamic viscosity mu + # from the current state. + else + mu = equations.mu(u, equations) + end if orientation == 1 # viscous flux components in the x-direction