diff --git a/docs/make.jl b/docs/make.jl index 9cdbb129..5623d8c4 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -10,9 +10,10 @@ makedocs( authors = "Tristan Montoya", pages = [ "Home" => "index.md", - "Reference" => [ + "Modules" => [ "`ConservationLaws`" => "ConservationLaws.md", "`SpatialDiscretizations`" => "SpatialDiscretizations.md", + "`Solvers`" => "Solvers.md", ], ], format = Documenter.HTML( diff --git a/docs/src/ConservationLaws.md b/docs/src/ConservationLaws.md index 2a91f545..1597fb41 100644 --- a/docs/src/ConservationLaws.md +++ b/docs/src/ConservationLaws.md @@ -15,8 +15,7 @@ second-order problems are treated by StableSpectralElements.jl as first-order sy ``` Currently, the linear advection and advection-diffusion equations, the inviscid and viscous Burgers' equations, and the compressible Euler equations are supported by StableSpectralElements.jl, but any system of the above form can in principle be implemented, provided that appropriate physical and numerical fluxes are defined. -## Equations -Listed below are partial differential equations supported by StableSpectralElements.jl. +## Reference ```@meta CurrentModule = ConservationLaws diff --git a/docs/src/Solvers.md b/docs/src/Solvers.md new file mode 100644 index 00000000..05e91783 --- /dev/null +++ b/docs/src/Solvers.md @@ -0,0 +1,19 @@ +# Module `Solvers` + +## Overview + +StableSpectralElements.jl is based on a semi-discrete approach to the numerical solution of partial differential equations, in which the spatial discretization is performed first in order to obtain a system of ordinary differential equations of the form +```math +\frac{\mathrm{d} }{\mathrm{d}t}\underline{u}(t) = \underline{R}(\underline{u}(t),t), +``` +where $\underline{u}(t) \in \mathbb{R}^{N_p \cdot N_c \cdot N_e}$ is the global solution array containing the $N_p$ coefficients for each of the $N_c$ solution variables and each of the $N_e$ mesh elements. Such systems can be solved using standard time-marching methods from [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl) by computing the semi-discrete residual $\underline{R}(\underline{u}(t),t)$ using a Julia function with the following signature: +```julia +semi_discrete_residual(dudt::AbstractArray{Float64,3}, + u::AbstractArray{Float64, 3}, + solver::Solver, + t::Float64) +``` +The first parameter contains the time derivative to be computed in place, the second parameter is the current solution state, and the fourth parameter is the time $t$. The third parameter, which is of type `Solver`, contains the all the information defining the spatial discretization as well as preallocated arrays used for temporary storage. The particular algorithm used for computing the semi-discrete residual is then dispatched based on the particular parametric subtype of `Solver` which is passed into the `semi_discrete_residual!` function. + +## Reference + diff --git a/docs/src/SpatialDiscretizations.md b/docs/src/SpatialDiscretizations.md index df8e23ba..63081040 100644 --- a/docs/src/SpatialDiscretizations.md +++ b/docs/src/SpatialDiscretizations.md @@ -15,38 +15,19 @@ In order to define the different geometric reference elements, the subtypes `Lin \hat{\Omega}_{\mathrm{tet}} &= \big\{ \bm{\xi} \in [-1,1]^3 : \xi_1 + \xi_2 + \xi_3 \leq -1 \big\}. \end{aligned} ``` -These element types are used in the constructor for StableSpectralElements.jl's [`ReferenceApproximation`](@ref) type, along with a subtype of `AbstractApproximationType` specifying the nature of the local approximation (and, optionally, the associated volume and facet quadrature rules). All the information used to define the spatial discretization on the physical domain $\Omega$ is contained within a `SpatialDiscretization` structure, which is constructed using a [`ReferenceApproximation`](@ref) and a `MeshData` from StartUpDG.jl, which are stored as the fields `reference_approximation` and `mesh`. When the constructor for a `SpatialDiscretization` is called, the grid metrics are computed and stored in a `GeometricFactors` structure, with the corresponding field being `geometric_factors`. +These element types are used in the constructor for StableSpectralElements.jl's [`ReferenceApproximation`](@ref) type, along with a subtype of `AbstractApproximationType` ([`NodalTensor`](@ref), [`ModalTensor`](@ref), [`NodalMulti`] (@ref), [`ModalMulti`](@ref), [`NodalMultiDiagE`](@ref), or [`ModalMultiDiagE`](@ref)) specifying the nature of the local approximation. -## Data types +All the information used to define the spatial discretization on the physical domain $\Omega$ is contained within a `SpatialDiscretization` structure, which is constructed using a [`ReferenceApproximation`](@ref) and a `MeshData` from StartUpDG.jl, which are stored as the fields `reference_approximation` and `mesh`. When the constructor for a `SpatialDiscretization` is called, the grid metrics are computed and stored in the field `geometric_factors` of type `GeometricFactors`. -```@meta -CurrentModule = SpatialDiscretizations -``` -```@docs - ReferenceApproximation -``` - -## Approximation types -Listed below are approximation types (i.e. subtypes of `AbstractApproximationType`) supported by StableSpectralElements.jl. - -### Tensor-product operators -The following subtypes of `AbstractTensorProduct <: AbstractApproximationType` employ tensor-product operators. +## Reference ```@meta CurrentModule = SpatialDiscretizations ``` ```@docs + ReferenceApproximation NodalTensor ModalTensor -``` - -### Multidimensional operators -The following subtypes of `AbstractMultidimensional <: AbstractApproximationType` employ multidimensional operators. - -```@meta -CurrentModule = SpatialDiscretizations -``` -```@docs NodalMulti ModalMulti NodalMultiDiagE diff --git a/src/ConservationLaws/euler_navierstokes.jl b/src/ConservationLaws/euler_navierstokes.jl index 81aed068..8e49103d 100644 --- a/src/ConservationLaws/euler_navierstokes.jl +++ b/src/ConservationLaws/euler_navierstokes.jl @@ -21,7 +21,7 @@ where $\rho(\bm{x},t) \in \mathbb{R}$ is the fluid density, $\bm{V}(\bm{x},t) \i ```math P(\bm{x},t) = (\gamma - 1)\Big(E(\bm{x},t) - \frac{1}{2}\rho(\bm{x},t) \lVert \bm{V}(\bm{x},t)\rVert^2\Big). ``` -The specific heat ratio is specified as a parameter `γ::Float64`, which must be greater than unity. +The specific heat ratio is specified as a parameter $\gamma$, which must be greater than unity. """ struct EulerEquations{d, N_c} <: AbstractConservationLaw{d, FirstOrder, N_c} γ::Float64 diff --git a/src/SpatialDiscretizations/SpatialDiscretizations.jl b/src/SpatialDiscretizations/SpatialDiscretizations.jl index 541deaad..b5e89ddf 100644 --- a/src/SpatialDiscretizations/SpatialDiscretizations.jl +++ b/src/SpatialDiscretizations/SpatialDiscretizations.jl @@ -153,7 +153,8 @@ const ChanWilcoxMetrics = ConservativeCurlMetrics element_type::StartUpDG.AbstractElemShape, kwargs...) Data structure defining the discretization on the reference element, containing the -following fields: +following fields, which are defined according to the approximation type, element type, and +other parameters passed into the outer constructor: - `approx_type::AbstractApproximationType`: Type of operators used for the discretization on the reference element ([`NodalTensor`](@ref), [`ModalTensor`](@ref), [`NodalMulti`] (@ref), [`ModalMulti`](@ref), [`NodalMultiDiagE`](@ref), or [`ModalMultiDiagE`](@ref))