Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
349373a
Added steps to compute the gradient for hyperbolic systems.
SimonCan May 22, 2025
9277c5b
Moved potential gradient calculations into integration routine.
SimonCan May 22, 2025
9826f54
Distinguish between call using functions with 2 or 3 parameters.
SimonCan May 27, 2025
5c43164
Reverted function signature.
SimonCan May 30, 2025
c889484
Update src/equations/compressible_euler_multicomponent_2d.jl
SimonCan Jun 2, 2025
2821bf0
Update src/equations/compressible_euler_multicomponent_2d.jl
SimonCan Jun 2, 2025
33ead0d
Update src/equations/compressible_euler_multicomponent_2d.jl
SimonCan Jun 2, 2025
818c698
Added Andrew's Fortran code for derivatives.
SimonCan Jun 2, 2025
103c918
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jun 3, 2025
76adb10
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jun 3, 2025
373c1d6
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jun 3, 2025
4e6245b
Update src/semidiscretization/semidiscretization.jl
SimonCan Jun 3, 2025
a93e340
Sterted conversion of Andrew's derivatives method.
SimonCan Jun 4, 2025
d7f3f55
Fuirther implementations of Andrew's derivative funciton.
SimonCan Jun 11, 2025
5c4e4db
Further translations of Fortran variables to Trixi.jl variables.
SimonCan Jun 12, 2025
00d61c9
Added calculation of fluxes by direciton.
SimonCan Jun 16, 2025
1424930
Corrected calculation of gradients.
SimonCan Jun 17, 2025
0dcc5ee
Corrected the gradient function.
SimonCan Jun 23, 2025
470c96d
Added 'semi' option to function call.
SimonCan Jun 26, 2025
db9b07d
Take care of cases when function is cons2cons.
SimonCan Jun 26, 2025
a2e26c2
Update src/callbacks_step/analysis.jl
SimonCan Jun 30, 2025
71f7e7a
Update src/callbacks_step/analysis.jl
SimonCan Jun 30, 2025
c705cdf
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jun 30, 2025
0c50c08
Removed redundant 'semi' parameter.
SimonCan Jul 2, 2025
9658874
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jul 3, 2025
423dd30
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jul 3, 2025
1081df0
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jul 3, 2025
6e31ee3
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jul 3, 2025
3612f4b
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jul 3, 2025
71ca315
Update src/callbacks_step/analysis_dg2d.jl
SimonCan Jul 3, 2025
b8a2716
Removed redundant code.
SimonCan Jul 3, 2025
52195d8
Merge branch 'sc/analysis_multi_euler_2d' of https://github.com/trixi…
SimonCan Jul 3, 2025
2d65ccc
Remoevd some redundant code.
SimonCan Jul 4, 2025
89cbfc0
Compute now also the y-derivative.
SimonCan Jul 10, 2025
44c3f5f
Use components of derivative vector for computing the vorticity.
SimonCan Jul 14, 2025
d22561b
Merge branch 'main' into sc/analysis_multi_euler_2d
SimonCan Jul 14, 2025
d825c93
Removed factor rho from the enstrophy.
SimonCan Jul 14, 2025
3cdbc82
Replaced DG derivative with polynoial interpolation.
SimonCan Jul 24, 2025
d7cd1b3
Merge branch 'main' into sc/analysis_multi_euler_2d
SimonCan Oct 2, 2025
df58d7f
Merge remote-tracking branch 'origin/main' into sc/analysis_multi_eul…
SimonCan Oct 2, 2025
52b267b
Added max_abs_speed_naive for CompressibleEulerMulticomponentEquations2D
SimonCan Oct 10, 2025
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
28 changes: 23 additions & 5 deletions src/callbacks_step/analysis_dg2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,29 @@ function integrate(func::Func, u,
UnstructuredMesh2D, P4estMesh{2}, P4estMeshView{2},
T8codeMesh{2}},
equations, dg::DG, cache; normalize = true) where {Func}
integrate_via_indices(u, mesh, equations, dg, cache;
normalize = normalize) do u, i, j, element, equations, dg
u_local = get_node_vars(u, equations, dg, i, j, element)
return func(u_local, equations)
end
@autoinfiltrate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does that do/why is this needed?

if length(m.sig.parameters) == 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this if-clause?

integrate_via_indices(u, mesh, equations, dg, cache;
normalize = normalize) do u, i, j, element, equations, dg
u_local = get_node_vars(u, equations, dg, i, j, element)
return func(u_local, equations)
end
if length(m.sig.parameters) == 3
integrate_via_indices(u, mesh, equations, dg, cache;
normalize = normalize) do u, i, j, element, equations, dg
u_local = get_node_vars(u, equations, dg, i, j, element)
# Since gradients are calculated for parabolic equations we need to use
# some of their infrastructure.
viscous_container = init_viscous_container_2d(nvariables(equations),
nnodes(cache.elements), nelements(cache.elements),
eltype(cache.elements))
@unpack u_transformed, gradients, flux_viscous = viscous_container
calc_gradient!(gradients, u_transformed, 0.0,
mesh::TreeMesh{2}, equations,
boundary_conditions, dg::DG, parabolic_scheme,
cache, cache)
return func(u_local, gradients, equations)
end
end

function integrate(func::Func, u,
Expand Down
17 changes: 17 additions & 0 deletions src/equations/compressible_euler_multicomponent_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -865,4 +865,21 @@ end
v = u[orientation] / rho
return v
end

@inline function enstrophy(u, gradients, equations::CompressibleEulerMulticomponentEquations2D)
# Enstrophy is 0.5 rho ω⋅ω where ω = ∇ × v

omega = vorticity(u, gradients, equations)

return 0.5f0 * u[1] * omega^2
end

@inline function vorticity(u, gradients, equations::CompressibleEulerMulticomponentEquations2D)
# Ensure that we have velocity `gradients` by way of the `convert_gradient_variables` function.
_, dv1dx, dv2dx, _ = convert_derivative_to_primitive(u, gradients[1], equations)
_, dv1dy, dv2dy, _ = convert_derivative_to_primitive(u, gradients[2], equations)

return dv2dx - dv1dy
end

end # @muladd
4 changes: 2 additions & 2 deletions src/equations/compressible_navier_stokes_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,14 @@ end
return SVector(v1, v2)
end

@inline function enstrophy(u, gradients, equations::CompressibleNavierStokesDiffusion2D)
@inline function enstrophy(u, equations::CompressibleNavierStokesDiffusion2D; gradients)
# Enstrophy is 0.5 rho ω⋅ω where ω = ∇ × v

omega = vorticity(u, gradients, equations)
return 0.5f0 * u[1] * omega^2
end

@inline function vorticity(u, gradients, equations::CompressibleNavierStokesDiffusion2D)
@inline function vorticity(u, equations::CompressibleNavierStokesDiffusion2D; gradients)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why different signature compared to old and added functions?

# Ensure that we have velocity `gradients` by way of the `convert_gradient_variables` function.
_, dv1dx, dv2dx, _ = convert_derivative_to_primitive(u, gradients[1], equations)
_, dv1dy, dv2dy, _ = convert_derivative_to_primitive(u, gradients[2], equations)
Expand Down
Loading