Skip to content

Commit

Permalink
improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmontoya committed Dec 3, 2024
1 parent d0ea384 commit 8483424
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/equations/covariant_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ struct CovariantLinearAdvectionEquation2D{GlobalCoordinateSystem} <:
end
end

# The conservative variables are the scalar conserved quantity and three contravariant
# velocity components. Note that vcon3 is zero, since the velocity is always tangent to the
# surface, but we keep it because there may be 3 global velocity components (if global
# Cartesian coordinates are used), and the number of variables needs to match.
function Trixi.varnames(::typeof(cons2cons), ::CovariantLinearAdvectionEquation2D)
return ("scalar", "vcon1", "vcon2", "vcon3")
end
Expand All @@ -71,8 +75,9 @@ end
# Convert contravariant velocity/momentum components to the global coordinate system
@inline function contravariant2global(u, aux_vars,
equations::CovariantLinearAdvectionEquation2D)
v_global = basis_covariant(aux_vars, equations) * velocity_horizontal(u, equations)
return SVector(u[1], v_global[1], v_global[2], v_global[3])
vglo1, vglo2, vglo3 = basis_covariant(aux_vars, equations) *
velocity_horizontal(u, equations)
return SVector(u[1], vglo1, vglo2, vglo3)
end

# Convert velocity/momentum components in the global coordinate system to contravariant
Expand All @@ -83,7 +88,7 @@ end
return SVector(u[1], vcon1, vcon2, zero(eltype(u)))
end

# The notation (u, v, w) is used here to denote generic global vector components
# Scalar conserved quantity and three global velocity components
function Trixi.varnames(::typeof(contravariant2global),
::CovariantLinearAdvectionEquation2D)
return ("scalar", "vglo1", "vglo2", "vglo3")
Expand Down

0 comments on commit 8483424

Please sign in to comment.