From 1b552283a1b75d023c4b57f84df4f5c6904d805e Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Tue, 19 Mar 2024 14:20:31 +0100 Subject: [PATCH] comments & dosctrings --- src/equations/compressible_navier_stokes_1d.jl | 7 +++++-- src/equations/compressible_navier_stokes_2d.jl | 7 +++++-- src/equations/compressible_navier_stokes_3d.jl | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/equations/compressible_navier_stokes_1d.jl b/src/equations/compressible_navier_stokes_1d.jl index 94135d346d7..5d09bc1f587 100644 --- a/src/equations/compressible_navier_stokes_1d.jl +++ b/src/equations/compressible_navier_stokes_1d.jl @@ -21,6 +21,8 @@ the [`CompressibleEulerEquations1D`](@ref). Fluid properties such as the dynamic viscosity ``\mu`` can be provided in any consistent unit system, e.g., [``\mu``] = kg m⁻¹ s⁻¹. +The viscosity ``\mu`` may be a constant or a function of the current state, e.g., +depending on temperature (Sutherland's law): ``\mu = \mu(T)``. The particular form of the compressible Navier-Stokes implemented is ```math @@ -160,13 +162,14 @@ function flux(u, gradients, orientation::Integer, # in the implementation q1 = equations.kappa * dTdx - # In the simplest case, `mu(u, equations)` returns just a constant but + # 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. - else mu = equations.mu(u, equations) end diff --git a/src/equations/compressible_navier_stokes_2d.jl b/src/equations/compressible_navier_stokes_2d.jl index 40c681ca9b7..48b68223a60 100644 --- a/src/equations/compressible_navier_stokes_2d.jl +++ b/src/equations/compressible_navier_stokes_2d.jl @@ -21,6 +21,8 @@ the [`CompressibleEulerEquations2D`](@ref). Fluid properties such as the dynamic viscosity ``\mu`` can be provided in any consistent unit system, e.g., [``\mu``] = kg m⁻¹ s⁻¹. +The viscosity ``\mu`` may be a constant or a function of the current state, e.g., +depending on temperature (Sutherland's law): ``\mu = \mu(T)``. The particular form of the compressible Navier-Stokes implemented is ```math @@ -169,13 +171,14 @@ function flux(u, gradients, orientation::Integer, q1 = equations.kappa * dTdx q2 = equations.kappa * dTdy - # In the simplest case, `mu(u, equations)` returns just a constant but + # 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. - else mu = equations.mu(u, equations) end diff --git a/src/equations/compressible_navier_stokes_3d.jl b/src/equations/compressible_navier_stokes_3d.jl index 6e99fb630e5..be80360288e 100644 --- a/src/equations/compressible_navier_stokes_3d.jl +++ b/src/equations/compressible_navier_stokes_3d.jl @@ -21,6 +21,8 @@ the [`CompressibleEulerEquations3D`](@ref). Fluid properties such as the dynamic viscosity ``\mu`` can be provided in any consistent unit system, e.g., [``\mu``] = kg m⁻¹ s⁻¹. +The viscosity ``\mu`` may be a constant or a function of the current state, e.g., +depending on temperature (Sutherland's law): ``\mu = \mu(T)``. The particular form of the compressible Navier-Stokes implemented is ```math @@ -182,13 +184,14 @@ function flux(u, gradients, orientation::Integer, q2 = equations.kappa * dTdy q3 = equations.kappa * dTdz - # In the simplest case, `mu(u, equations)` returns just a constant but + # 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. - else mu = equations.mu(u, equations) end