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

Add 2D covariant form using P4estMesh #31

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
7ff4a57
linear advection on the sphere
tristanmontoya Jul 13, 2024
8236b78
formatter
tristanmontoya Jul 13, 2024
fcf6c75
very preliminary implementation of covariant form with p4est
tristanmontoya Jul 16, 2024
2fc2f67
removed untracked
tristanmontoya Jul 16, 2024
2e1c54c
removed allocations, now 100x faster
tristanmontoya Jul 16, 2024
c64a293
add DS_Store to gitignore
tristanmontoya Jul 16, 2024
5374da9
add DS_Store to gitignore
tristanmontoya Jul 16, 2024
f9a4163
made equations actually 2D
tristanmontoya Jul 17, 2024
3abdaa6
integrated upstream changes
tristanmontoya Jul 17, 2024
e6e08aa
analysis callback for covariant form
tristanmontoya Jul 18, 2024
e153f11
cleanup
tristanmontoya Jul 19, 2024
f45378e
separate Andres's spherical shell containers from main Trixi
tristanmontoya Jul 25, 2024
24a3793
Added containers and 2D p4est mesh from my spherical shell implementa…
amrueda Jul 26, 2024
eb768d9
Added element container with PtrArray for performance and modified th…
amrueda Jul 26, 2024
ca44965
format
amrueda Jul 26, 2024
8ec3e9c
Fixed bug in the definition of init_elements and added nelements(). e…
amrueda Jul 26, 2024
7caca96
Merge remote-tracking branch 'origin/arr/spherical_shell' into tm/p4e…
tristanmontoya Jul 29, 2024
f32afdf
integrated Andres's new container type with covariant solver
tristanmontoya Jul 29, 2024
b5df5c1
Merge remote-tracking branch 'origin/main' into tm/p4est_new_container
tristanmontoya Aug 6, 2024
c5483f3
added flux-differencing kernel for covariant form
tristanmontoya Aug 8, 2024
bab3363
Merge remote-tracking branch 'origin/main' into tm/covariant_flux_dif…
tristanmontoya Aug 15, 2024
bc1da0a
integrated Andrés' PR with covariant solver
tristanmontoya Aug 15, 2024
3d4f809
Merge remote-tracking branch 'origin/main' into tm/covariant_form
tristanmontoya Aug 17, 2024
ae53831
add tests for spherical advection in Cartesian coords
tristanmontoya Aug 17, 2024
eb81ca5
revert change to moist bubble case
tristanmontoya Aug 17, 2024
e9ec616
revert change to moist bubble case
tristanmontoya Aug 17, 2024
e0c6303
Merge branch 'tm/test_spherical_advection' into tm/covariant_form
tristanmontoya Aug 17, 2024
98b0f0e
covariant weak form with tests
tristanmontoya Aug 17, 2024
9799f81
removed shallow water from this branch
tristanmontoya Aug 17, 2024
73dda27
reorganize a bit
tristanmontoya Aug 18, 2024
7de998a
hard-code dimension of node coordinates to avoid type instability
tristanmontoya Aug 20, 2024
317033a
metric terms for shell of radius != 1
tristanmontoya Aug 20, 2024
2fd7610
Merge remote-tracking branch 'origin/tm/test_spherical_advection' int…
tristanmontoya Aug 20, 2024
351eb7a
test for covariant form is now on earth scale
tristanmontoya Aug 21, 2024
add6cc7
fix name of cartesian test
tristanmontoya Aug 22, 2024
e1eb237
moved i,j,element,cache into flux signatures for covariant form
tristanmontoya Sep 1, 2024
c4211d3
added test for flux differencing covariant form
tristanmontoya Sep 1, 2024
2fa4e01
Merge branch 'main' into tm/covariant_form
tristanmontoya Sep 1, 2024
44ac576
transformation between local coordinate systems now uses latitude-lon…
tristanmontoya Sep 4, 2024
73e858a
Merge remote-tracking branch 'origin/main' into tm/covariant_form
tristanmontoya Sep 4, 2024
fc52dfe
format
tristanmontoya Sep 4, 2024
2067837
make compatible with my PR trixi-framework/Trixi.jl#2068
tristanmontoya Sep 7, 2024
808e74c
Merge remote-tracking branch 'origin/tm/p4est_mesh_compat' into tm/co…
tristanmontoya Sep 7, 2024
2d5e6c5
separate containers to store geometric information specific to covari…
tristanmontoya Sep 9, 2024
6d4ae0d
add element-local mapping from Guba et al.
tristanmontoya Sep 10, 2024
bcb9fda
add reference to Guba et al. to docstring
tristanmontoya Sep 10, 2024
f4f94fb
Merge branch 'tm/element_local_mapping' into tm/covariant_form
tristanmontoya Sep 10, 2024
a69b558
new mapping works with cartesian solver solver in covariant_form branch
tristanmontoya Sep 10, 2024
d2cd693
exact metrics for element-local mapping
tristanmontoya Sep 10, 2024
4324e62
streamline tests and improve readability
tristanmontoya Sep 10, 2024
c46d20b
rename default DGSEM mapping
tristanmontoya Sep 10, 2024
937c069
Merge branch 'tm/element_local_mapping' into tm/covariant_form
tristanmontoya Sep 10, 2024
7ff3331
didn't need new analysis cache
tristanmontoya Sep 11, 2024
1248f88
improve comments
tristanmontoya Sep 11, 2024
9504e9c
Merge remote-tracking branch 'origin/main' into tm/covariant_form
tristanmontoya Sep 12, 2024
936dc49
refactor
tristanmontoya Sep 13, 2024
c4adf7c
remove DiffEqCallbacks for now
tristanmontoya Sep 13, 2024
ad0a60e
add better comments
tristanmontoya Sep 14, 2024
4b3642c
improve comments
tristanmontoya Sep 14, 2024
d3bc8f7
better documentation
tristanmontoya Sep 14, 2024
7d7ec99
add NDIMS_AMBIENT parameter to equations
tristanmontoya Sep 15, 2024
e5b3602
Merge remote-tracking branch 'origin/main' into tm/element_local_mapping
tristanmontoya Oct 5, 2024
4de0ca3
fix docstring format
tristanmontoya Oct 5, 2024
4412add
Merge branch 'tm/element_local_mapping' into tm/covariant_form
tristanmontoya Oct 5, 2024
731fa69
make link in docs work
tristanmontoya Oct 5, 2024
ca7118c
fix link in docs
tristanmontoya Oct 5, 2024
7db2950
Merge branch 'tm/element_local_mapping' into tm/covariant_form
tristanmontoya Oct 5, 2024
13fe226
documentation for the covariant solver
tristanmontoya Oct 5, 2024
f8b76ee
added surface central flux and test
tristanmontoya Oct 12, 2024
be033ab
fix trixi_compat
tristanmontoya Oct 12, 2024
87143be
specialize compute_coefficients! to dimension 2
tristanmontoya Oct 12, 2024
b8dc13a
format
tristanmontoya Oct 12, 2024
2b475d5
fix spelling
tristanmontoya Oct 12, 2024
eab59ff
Merge remote-tracking branch 'origin/main' into tm/covariant_form
tristanmontoya Oct 12, 2024
4cc1ec9
remove initial_condition parameter from rhs
tristanmontoya Oct 17, 2024
58ed6a9
Merge remote-tracking branch 'origin/main' into tm/covariant_form
tristanmontoya Nov 4, 2024
fb379e0
no need to use Float32 for physical constant defaults
tristanmontoya Nov 4, 2024
a4d7e4f
incorporate downstream changes
tristanmontoya Nov 4, 2024
9137903
format
tristanmontoya Nov 4, 2024
9333aa6
Merge remote-tracking branch 'origin/main' into tm/covariant_form
tristanmontoya Nov 6, 2024
9e9b3d7
merge changes from PR #36 (work in progress)
tristanmontoya Nov 10, 2024
78f8593
standardize test cases
tristanmontoya Nov 11, 2024
5d71c5a
move covariant form max_dt method to callbacks_step
tristanmontoya Nov 11, 2024
4f1b3dc
Fix comments
tristanmontoya Nov 11, 2024
0f0a8e7
generalize interface between equations and cache
tristanmontoya Nov 11, 2024
6d11443
relax relative tolerance on cartesian advection test)
tristanmontoya Nov 11, 2024
d515349
improve docs
tristanmontoya Nov 12, 2024
90fa2a6
streamline initial condition definition and improve docs
tristanmontoya Nov 13, 2024
b7a7f5a
tests for cartesian form now use standard and element-local mapping a…
tristanmontoya Nov 13, 2024
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ run
run/*
out
out/*
docs/build
docs/build/*
.DS_Store
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ Static = "0.8, 1"
StaticArrayInterface = "1.5.1"
StaticArrays = "1"
StrideArrays = "0.1.28"
Trixi = "0.7, 0.8, 0.9"
Trixi = "0.9"
julia = "1.9"
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ end

initial_condition = initial_condition_advection_sphere

element_local_mapping = false

mesh = TrixiAtmo.P4estMeshCubedSphere2D(5, 1.0, polydeg = polydeg,
initial_refinement_level = 0)
initial_refinement_level = 0,
element_local_mapping = element_local_mapping)

# A semidiscretization collects data structures and functions for the spatial discretization
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
Expand Down
98 changes: 98 additions & 0 deletions examples/elixir_spherical_advection_covariant.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
###############################################################################
# DGSEM for the linear advection equation on the cubed sphere
###############################################################################
tristanmontoya marked this conversation as resolved.
Show resolved Hide resolved

using OrdinaryDiffEq, Trixi, TrixiAtmo

###############################################################################
# Problem definition

function initial_condition_advection_earth(x, t, ::CovariantLinearAdvectionEquation2D)
RealT = eltype(x)

# set parameters
a = EARTH_RADIUS # radius of the sphere in metres
V = convert(RealT, 2π) * a / (12 * SECONDS_PER_DAY) # speed of rotation
alpha = convert(RealT, π / 4) # angle of rotation
h_0 = 1000.0f0 # bump height in metres
b_0 = 5.0f0 / (a^2) # bump width
lon_0, lat_0 = convert(RealT, 3π / 2), 0.0f0 # initial bump location

# convert initial position to Cartesian coordinates
x_0 = SVector(a * cos(lat_0) * cos(lon_0), a * cos(lat_0) * sin(lon_0), a * sin(lat_0))

# compute Gaussian bump profile
h = h_0 * exp(-b_0 * ((x[1] - x_0[1])^2 + (x[2] - x_0[2])^2 + (x[3] - x_0[3])^2))

# get zonal and meridional components of the velocity
lon, lat = atan(x[2], x[1]), asin(x[3] / a)
v_lon = V * (cos(lat) * cos(alpha) + sin(lat) * cos(lon) * sin(alpha))
v_lat = -V * sin(lon) * sin(alpha)

return SVector(h, v_lon, v_lat)
end

###############################################################################
# Spatial discretization

polydeg = 3
cells_per_dimension = 2

element_local_mapping = true

mesh = P4estMeshCubedSphere2D(5, EARTH_RADIUS, polydeg = polydeg,
initial_refinement_level = 0,
element_local_mapping = element_local_mapping)

equations = CovariantLinearAdvectionEquation2D()

initial_condition = initial_condition_advection_earth

# Local Lax-Friedrichs surface flux
surface_flux = flux_lax_friedrichs

# Standard weak-form volume integral
volume_integral = VolumeIntegralWeakForm()

# Create DG solver with polynomial degree = p and a local Lax-Friedrichs flux
solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux,
volume_integral = volume_integral)

# A semidiscretization collects data structures and functions for the spatial discretization
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)

###############################################################################
# ODE solvers, callbacks etc.

# Create ODE problem with time span from 0 to T
ode = semidiscretize(semi, (0.0, 12 * SECONDS_PER_DAY))

# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation setup
# and resets the timers
summary_callback = SummaryCallback()

# The AnalysisCallback allows to analyse the solution in regular intervals and prints the results
analysis_callback = AnalysisCallback(semi, interval = 10,
save_analysis = true,
extra_analysis_errors = (:conservation_error,))

# The SaveSolutionCallback allows to save the solution to a file in regular intervals
save_solution = SaveSolutionCallback(interval = 10,
solution_variables = cons2cons)

# The StepsizeCallback handles the re-calculation of the maximum Δt after each time step
stepsize_callback = StepsizeCallback(cfl = 0.4)

# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver
callbacks = CallbackSet(summary_callback, analysis_callback, save_solution,
stepsize_callback)

###############################################################################
# run the simulation

# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
dt = 1.0, save_everystep = false, callback = callbacks);

# Print the timer summary
summary_callback()
16 changes: 10 additions & 6 deletions src/TrixiAtmo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,29 @@ See also: [trixi-framework/TrixiAtmo.jl](https://github.com/trixi-framework/Trix
"""
module TrixiAtmo

using Reexport: @reexport
using Trixi
using MuladdMacro: @muladd
using Static: True, False
using StrideArrays: PtrArray
using StaticArrayInterface: static_size
using LinearAlgebra: norm
using Reexport: @reexport
@reexport using StaticArrays: SVector
using StrideArrays: StrideArray, StaticInt, PtrArray
using LinearAlgebra: norm, dot

@reexport using StaticArrays: SVector, SMatrix

include("auxiliary/auxiliary.jl")
include("equations/equations.jl")
include("meshes/meshes.jl")
include("solvers/solvers.jl")
include("semidiscretization/semidiscretization_hyperbolic_2d_manifold_in_3d.jl")
include("callbacks_step/callbacks_step.jl")

export CompressibleMoistEulerEquations2D
export CompressibleMoistEulerEquations2D, CovariantLinearAdvectionEquation2D

export flux_chandrashekar, flux_LMARS

export examples_dir
export EARTH_RADIUS, EARTH_GRAVITATIONAL_ACCELERATION,
EARTH_ROTATION_RATE, SECONDS_PER_DAY

export examples_dir
end # module TrixiAtmo
1 change: 1 addition & 0 deletions src/auxiliary/auxiliary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ read-only and should *not* be modified.
To find out which files are available, use, e.g., `readdir`:

# Examples

```@example
readdir(examples_dir())
```
Expand Down
51 changes: 51 additions & 0 deletions src/callbacks_step/analysis_covariant.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

function Trixi.analyze(::typeof(Trixi.entropy_timederivative), du, u, t,
mesh::P4estMesh{2},
equations::AbstractCovariantEquations{2}, dg::DG, cache)
# Calculate ∫(∂S/∂u ⋅ ∂u/∂t)dΩ
Trixi.integrate_via_indices(u, mesh, equations, dg, cache,
du) do u, i, j, element, equations, dg, du
u_node = Trixi.get_node_vars(u, equations, dg, i, j, element)
du_node = Trixi.get_node_vars(du, equations, dg, i, j, element)
dot(cons2entropy(u_node, equations, cache.elements, i, j, element), du_node)
end
end

function Trixi.calc_error_norms(func, u, t, analyzer, mesh::P4estMesh{2},
equations::AbstractCovariantEquations{2},
initial_condition, dg::DGSEM, cache, cache_analysis)
(; weights) = dg.basis
(; node_coordinates) = cache.elements

# Set up data structures
l2_error = zero(func(Trixi.get_node_vars(u, equations, dg, 1, 1, 1), equations))
linf_error = copy(l2_error)
total_volume = zero(real(mesh))

# Iterate over all elements for error calculations
for element in eachelement(dg, cache)

# Calculate errors at each volume quadrature node
for j in eachnode(dg), i in eachnode(dg)
x = Trixi.get_node_coords(node_coordinates, equations, dg, i, j, element)

u_exact = spherical2contravariant(initial_condition(x, t, equations),
equations, cache.elements, i, j, element)

u_numerical = Trixi.get_node_vars(u, equations, dg, i, j, element)

diff = func(u_exact, equations) - func(u_numerical, equations)

J = volume_element(cache.elements, i, j, element)

l2_error += diff .^ 2 * (weights[i] * weights[j] * J)
linf_error = @. max(linf_error, abs(diff))
total_volume += weights[i] * weights[j] * J
end
end

# For L2 error, divide by total volume
l2_error = @. sqrt(l2_error / total_volume)

return l2_error, linf_error
end
1 change: 1 addition & 0 deletions src/callbacks_step/callbacks_step.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("analysis_covariant.jl")
99 changes: 99 additions & 0 deletions src/equations/covariant_advection.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
@muladd begin
#! format: noindent

@doc raw"""
CovariantLinearAdvectionEquation2D <: AbstractCovariantEquations{2, 3, 3}
amrueda marked this conversation as resolved.
Show resolved Hide resolved

A variable-coefficient linear advection equation can be defined on a two-dimensional
manifold $S \subset \mathbb{R}^3$ as
```math
\partial_t h + \nabla_S \cdot (h \vec{v}) = 0.
```
We treat this problem as a system of equations in which the first variable is the scalar
conserved quantity $h$, and the second two are the contravariant components $v^1$ and $v^2$
used in the expansion
```math
\vec{v} = v^1 \vec{a}_1 + v^2 \vec{a}_2,
```
which are spatially varying but remain constant in time (i.e. no flux or dissipation is
applied to such variables). The resulting system is then given on the reference element as
```math
J \frac{\partial}{\partial t}\left[\begin{array}{c} h \\ v^1 \\ v^2 \end{array}\right] +
\frac{\partial}{\partial \xi^1} \left[\begin{array}{c} J h v^1 \\ 0 \\ 0 \end{array}\right]
+
\frac{\partial}{\partial \xi^2} \left[\begin{array}{c} J h v^2 \\ 0 \\ 0 \end{array}\right]
= \left[\begin{array}{c} 0 \\ 0 \\ 0 \end{array}\right],
```
where $J$ is the area element (see the documentation for [`P4estElementContainerCovariant`](@ref)).
!!! note
The initial condition should be prescribed as $[h, u, v]^{\mathrm{T}}$ in terms of the
global velocity components $u$ and $v$ (i.e. zonal and meridional components in the
case of a spherical shell). The transformation to local contravariant components $v^1$
and $v^2$ is handled internally within `Trixi.compute_coefficients!`.
"""
struct CovariantLinearAdvectionEquation2D <: AbstractCovariantEquations{2, 3, 3} end

function Trixi.varnames(::typeof(cons2cons), ::CovariantLinearAdvectionEquation2D)
return ("scalar", "v_con_1", "v_con_2")
end

# Compute the entropy variables (requires element container and indices)
@inline function Trixi.cons2entropy(u, equations::CovariantLinearAdvectionEquation2D,
elements, i, j, element)
z = zero(eltype(u))
return SVector{3}(u[1], z, z)
end

# The flux for the covariant form takes in the element container and node/element indices
# in order to give the flux access to the geometric information
@inline function Trixi.flux(u, orientation::Integer,
::CovariantLinearAdvectionEquation2D,
elements, i, j, element)
z = zero(eltype(u))
J = volume_element(elements, i, j, element)
return SVector(J * u[1] * u[orientation + 1], z, z)
end

# Local Lax-Friedrichs dissipation which is not applied to the contravariant velocity
# components, as they should remain unchanged in time
@inline function (dissipation::DissipationLocalLaxFriedrichs)(u_ll, u_rr,
orientation_or_normal_direction,
equations::CovariantLinearAdvectionEquation2D,
elements, i_ll, j_ll,
i_rr, j_rr, element)
z = zero(eltype(u_ll))
J = volume_element(elements, i_ll, j_ll, element)
λ = dissipation.max_abs_speed(u_ll, u_rr, orientation_or_normal_direction,
equations, elements, i_ll, j_ll, i_rr, j_rr, element)
return -0.5f0 * J * λ * SVector(u_rr[1] - u_ll[1], z, z)
end

# Maximum wave speed with respect to the a specific orientation
@inline function Trixi.max_abs_speed_naive(u_ll, u_rr, orientation::Integer,
::CovariantLinearAdvectionEquation2D,
elements, i_ll, j_ll, i_rr, j_rr, element)
return max(abs(u_ll[orientation + 1]), abs(u_rr[orientation + 1]))
end

# Maximum wave speeds in each direction for CFL calculation
@inline function Trixi.max_abs_speeds(u, ::CovariantLinearAdvectionEquation2D,
elements, i, j, element)
return abs(u[2]), abs(u[3])
end

# Convert contravariant velocity/momentum components to zonal and meridional components
@inline function contravariant2spherical(u::SVector{3},
::CovariantLinearAdvectionEquation2D,
elements, i, j, element)
v_lon, v_lat = contravariant2spherical(u[2], u[3], elements, i, j, element)
return SVector(u[1], v_lon, v_lat)
end

# Convert zonal and meridional velocity/momentum components to contravariant components
@inline function spherical2contravariant(u::SVector{3},
::CovariantLinearAdvectionEquation2D,
elements, i, j, element)
v_con_1, v_con_2 = spherical2contravariant(u[2], u[3], elements, i, j, element)
return SVector(u[1], v_con_1, v_con_2)
end
end # @muladd
65 changes: 65 additions & 0 deletions src/equations/equations.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
@muladd begin
#! format: noindent

using Trixi: AbstractEquations

# Physical constants
const EARTH_RADIUS = 6.37122 # m
const EARTH_GRAVITATIONAL_ACCELERATION = 9.80616 # m/s²
const EARTH_ROTATION_RATE = 7.292e-5 # rad/s
const SECONDS_PER_DAY = 8.64e4

@doc raw"""
AbstractCovariantEquations{NDIMS,
NDIMS_AMBIENT,
NVARS} <: AbstractEquations{NDIMS, NVARS}

Abstract type used to dispatch on systems of equations in covariant form, in which fluxes
and prognostic variables are stored and computed in terms of their contravariant components
defining their expansions in terms of the local covariant tangent basis. The type parameter
`NDIMS` denotes the dimension of the manifold on which the equations are solved, while
`NDIMS_AMBIENT` is the dimension of the ambient space in which such a manifold is embedded.

!!! note
Components of vector-valued fields should be prescibed within the global coordinate
system (i.e. zonal and meridional components in the case of a spherical shell).
When dispatched on this type, the function `Trixi.compute_coefficients!` will
internally use the `covariant_basis` field of the container type
[`P4estElementContainerCovariant`](@ref) to obtain the local contravariant components
used in the solver.
"""
abstract type AbstractCovariantEquations{NDIMS,
NDIMS_AMBIENT,
NVARS} <: AbstractEquations{NDIMS, NVARS} end

# Numerical flux plus dissipation which passes node/element indices and cache.
# We assume that u_ll and u_rr have been transformed into the same local coordinate system.
@inline function (numflux::Trixi.FluxPlusDissipation)(u_ll, u_rr,
orientation_or_normal_direction,
equations::AbstractCovariantEquations{2},
elements, i_ll, j_ll, i_rr, j_rr,
amrueda marked this conversation as resolved.
Show resolved Hide resolved
element)

# The flux and dissipation need to be defined for the specific equation set
flux = numflux.numerical_flux(u_ll, u_rr, orientation_or_normal_direction,
equations,
elements, i_ll, j_ll, i_rr, j_rr, element)
diss = numflux.dissipation(u_ll, u_rr, orientation_or_normal_direction, equations,
elements, i_ll, j_ll, i_rr, j_rr, element)
return flux + diss
end

# Central flux which passes node/element indices and cache.
# We assume that u_ll and u_rr have been transformed into the same local coordinate system.
@inline function Trixi.flux_central(u_ll, u_rr,
orientation_or_normal_direction,
equations::AbstractCovariantEquations{2},
elements, i_ll, j_ll, i_rr, j_rr, element)
flux_ll = Trixi.flux(u_ll, orientation_or_normal_direction, equations,
elements, i_ll, j_ll, element)
flux_rr = Trixi.flux(u_rr, orientation_or_normal_direction, equations,
elements, i_rr, j_rr, element)

return 0.5f0 * (flux_ll + flux_rr)
end

include("covariant_advection.jl")
abstract type AbstractCompressibleMoistEulerEquations{NDIMS, NVARS} <:
AbstractEquations{NDIMS, NVARS} end
include("compressible_moist_euler_2d_lucas.jl")
end # @muladd
Loading
Loading