Skip to content

Commit

Permalink
comments & dosctrings
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Mar 19, 2024
1 parent 040eca8 commit 1b55228
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/equations/compressible_navier_stokes_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions src/equations/compressible_navier_stokes_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions src/equations/compressible_navier_stokes_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 1b55228

Please sign in to comment.