Open DanielDoehring opened 1 month ago
This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.
NEWS.md
with its PR number.Created with :heart: by the Trixi.jl community.
Attention: Patch coverage is 91.66667%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 96.19%. Comparing base (
58acd35
) to head (6345c6f
).
Files | Patch % | Lines |
---|---|---|
src/equations/maxwell_1d.jl | 90.32% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks a lot! Could you please request a review from another developer in your area (Aachen/Cologne etc.) and ping Michael or me when you're ready for a final review?
Thanks for adding this equation system! It opens opportunities for multi-material wave propagation applications between different dielectric materials. Do not forget to add the new equation capability to the landing page of the README.md
, although we could maybe hold-off until the Maxwell's equations are available in 2D and 3D as well. This opens a broader discussion regarding the strategy of maintaining a divergence-free magnetic field (say a la Dedner et al.) that will live in a different PR.
I always missed a classic wave equation system in Trixi.jl.
The obvious choice would be the standard 1D wave equation utt−c2uxx=0 with first order hyperbolic system
obtained from introducing the variables v:=cux and w=−ut. This system, however, bears two main problems due to the change of variables:
* The initialization is non-trivial * Obtaining u is non-trivial
It is clear that the reconstruction of u from v is difficult. But could expand on the second point?
As an alternative which does not bear this difficulties one can consider the Maxwell equations in 1D which simplify to
where E and B field are orthogonal (which I try to denote with the alternating indices). This system has eigenvalues λ−=−c,λ+=c, identical to the wave equation system.
I added the typical convergence test and an "application" of a standing wave which distributes energy between magnetic and electric.
Do you mean that you distribute between magnetic and electric energy?
Have you considered solving a three-variable first order hyperbolic system that includes the equation $u_t + w = 0$?
Can you provide a reference to your 1d Maxwell equations? Are you in a vacuum? If so, why not set the currents to 0 as well? Why are there second order derivatives in space, like $\partialx E{y,z}$?
It is clear that the reconstruction of u from v is difficult. But could expand on the second point?
So the initialization?
Do you mean that you distribute between magnetic and electric energy?
Yes.
Can you provide a reference to your 1d Maxwell equations? Are you in a vacuum? If so, why not set the currents to 0 as well? Why are there second order derivatives in space, like ∂xEy,z?
These are no second derivatives, but meant to indicate the parity of the components of the electric and magnetic field, i.e., if you have $E_y$ then you have $B_z$ and vice-versa.
Can you provide a reference to your 1d Maxwell equations? Are you in a vacuum? If so, why not set the currents to 0 as well? Why are there second order derivatives in space, like ∂xEy,z?
A possible reference would be https://inria.hal.science/hal-01720293/document equation (1). Yes, at least $c$ is set to vacuum value.
In the docstring of the equations the currents/sources are set to 0. Only here they are mentioned for completeness.
Thanks for adding this equation system! It opens opportunities for multi-material wave propagation applications between different dielectric materials.
This was actually the main motivation to add such a system to Trixi for me.
Do not forget to add the new equation capability to the landing page of the
README.md
, although we could maybe hold-off until the Maxwell's equations are available in 2D and 3D as well.
Yes, this is actually the reason why I have not put them into the Readme yet.
It is clear that the reconstruction of u from v is difficult. But could expand on the second point?
So the initialization?
Yes. You would need to integrate to get u from v. Maybe your could point that out.
Do you mean that you distribute between magnetic and electric energy?
Yes.
Maybe it is good to point out that energy is being distributed.
Can you provide a reference to your 1d Maxwell equations? Are you in a vacuum? If so, why not set the currents to 0 as well? Why are there second order derivatives in space, like ∂xEy,z?
These are no second derivatives, but meant to indicate the parity of the components of the electric and magnetic field, i.e., if you have Ey then you have Bz and vice-versa.
That makes sense. But then the notation is confusing. In the initial wave equation subscripts are derivatives. Now they are components and parities. Maybe you could also mention parities in your description.
Can you provide a reference to your 1d Maxwell equations?
You could maybe use one of the papers from Acosta and Kopriva for the Maxwell's equations on this form. That or the book from Hesthaven "Numerical Methods for Conservation Laws: From Analysis to Algorithms" where he uses the Maxwell's equations as a prototypical example of a linear conservation law.
Looks good to me now.
Looks good to me now.
Can you approve the PR? Then we are ready to go :)
I always missed a classic wave equation system in Trixi.jl.
The obvious choice would be the standard 1D wave equation $$u{tt} - c^2 u{xx} = 0$$ with first order hyperbolic system
obtained from introducing the variables $v := c u_x$ and $w = -u_t$. This system, however, bears two main problems due to the change of variables:
As an alternative which does not bear this difficulties one can consider the Maxwell equations in 1D which simplify to
where $E$ and $B$ field are orthogonal (which I try to denote with the alternating indices). This system has eigenvalues $\lambda- = -c, \lambda+ = c$, identical to the wave equation system.
I added the typical convergence test and an "application" of a standing wave which distributes energy between magnetic and electric.