module that holds all routines to calculate the flux for hyperbolic Maxwell equations.
Interface for fluxes of pure Maxwell equations.
Subroutine to calculate the flux for pure Maxwell equations without any divergence cleaning on the reference cubic face.
This subroutine calculates the flux of the Maxwell equation on the reference cubic face. This implementation is based on the this article: A three-dimensional finite-volume solver for Maxwell equations with divergence cleaning on unstructured meshes, C.D. Munz, P. Ommes, R. Schneider, Computer Physiscs communications 130, 83-117, 1999. Additionally we splitted the correction technique from the Maxwell fluxes themself to be able to use the fluxes for Maxwell in combination with an arbitrary divergence correction technique. Please notice that this flux function assumes constant material parameters in both cells.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | left(6) |
Left state vector (as conservative variables). The order of this vector has to be \f$ (D_x, D_y, D_z, B_1, B_2, B_3) \f$ where E and B denoted electric field vetor and magnetic field (also called magnetic induction) vector. |
||
real(kind=rk), | intent(in) | :: | right(6) |
Right state vector (as conservative variables). The order of this vector has to be (D_x, D_y, D_z, B_1, B_2, B_3) where E and B denoted the electric field vetor and magnetic field (also called magnetic induction) vector. |
||
real(kind=rk), | intent(in) | :: | left_mu |
The magnetic permeability of the left element. |
||
real(kind=rk), | intent(in) | :: | left_epsi |
The electric permitivity of the left element. |
||
real(kind=rk), | intent(in) | :: | right_mu |
The magnetic permeability of the right element. |
||
real(kind=rk), | intent(in) | :: | right_epsi |
The electric permitivity of the right element. |
||
real(kind=rk), | intent(out) | :: | flux(6) |
The flux between left and right cell. The order of this vector is the same as the input arguments. |
face-vector
This subroutine assumes the Maxwell equations with D and B as input variables. Furthermore, it is able to handle jumping material parameters.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nTotalFaces | |||
integer, | intent(in) | :: | nSides | |||
integer, | intent(in) | :: | nFaceDofs | |||
real(kind=rk), | intent(in) | :: | faceRep(nTotalFaces,nFaceDofs,6,2) | |||
real(kind=rk), | intent(inout) | :: | faceFlux(nTotalFaces,nFaceDofs,6,2) | |||
integer, | intent(in) | :: | leftPos(nSides) | |||
integer, | intent(in) | :: | rightPos(nsides) | |||
integer, | intent(in) | :: | var(6) | |||
real(kind=rk), | intent(in) | :: | material_left(nSides,1,2) | |||
real(kind=rk), | intent(in) | :: | material_right(nSides,1,2) |
face-vector
This subroutine assumes the Maxwell equations with D and B as input variables. Furthermore, it is able to handle arbitray material parameters by a pseudo-spectral technique.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nTotalFaces | |||
integer, | intent(in) | :: | nSides | |||
integer, | intent(in) | :: | nFaceDofs | |||
real(kind=rk), | intent(in) | :: | faceRep(nTotalFaces,nFaceDofs,6,2) |
The modal representation on the faces, left and right trace. |
||
real(kind=rk), | intent(inout) | :: | faceFlux(nTotalFaces,nFaceDofs,6,2) |
The fluxes for all faces, for left and right elements. |
||
integer, | intent(in) | :: | leftPos(nSides) |
Positions for the left and right elements of all faces |
||
integer, | intent(in) | :: | rightPos(nsides) |
Positions for the left and right elements of all faces |
||
integer, | intent(in) | :: | var(6) |
Variable rotation indices |
||
real(kind=rk), | intent(in) | :: | material_left(nSides,nFaceDofs,2) |
Material parameters for the left faces. |
||
real(kind=rk), | intent(in) | :: | material_right(nSides,nFaceDofs,2) |
Material parameters for the right faces. |
||
type(ply_poly_project_type) | :: | poly_proj |
Data for projection method |
|||
real(kind=rk), | intent(inout) | :: | modalCoeffs(:,:,:) |
Working array for the left and right modal coefficients |
||
real(kind=rk), | intent(inout) | :: | pntVal(:,:,:) |
Working array for the left and right point values |
||
real(kind=rk), | intent(inout) | :: | nodalNumFlux(:,:) |
Working array for the nodal flux |
||
real(kind=rk), | intent(inout) | :: | numFluxBuffer(:,:) |
Working array for the modal numerical flux |
Interface for fluxes of Maxwell equations with hyperbolic divergence cleaning.
hyperbolic divergence cleaning on the reference cubic face.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | left(8) |
Left state vector (as conservative variables). The order of this vector has to be \f$ (D_x, D_y, D_z, B_1, B_2, B_3, phi, psi) \f$ where E and B denoted electric field vetor and magnetic field (also called magnetic induction) vector. |
||
real(kind=rk), | intent(in) | :: | right(8) |
Right state vector (as conservative variables). The order of this vector has to be (D_x, D_y, D_z, B_1, B_2, B_3, phi, psi) where E and B denoted the electric field vetor and magnetic field (also called magnetic induction) vector. |
||
real(kind=rk), | intent(in) | :: | mat_left(4) |
Material for the left face |
||
real(kind=rk), | intent(in) | :: | mat_right(4) |
Material for the right face !> The magnetic permeability of the left element. real(kind=rk), intent(in) :: left_mu !> The electric permitivity of the left element. real(kind=rk), intent(in) :: left_epsi !> Parameter for the magnetic correction on the left element. real(kind=rk), intent(in) :: left_gam !> Parameter for the electric correction on the left element. real(kind=rk), intent(in) :: left_chi !> The magnetic permeability of the right element. real(kind=rk), intent(in) :: right_mu !> The electric permitivity of the right element. real(kind=rk), intent(in) :: right_epsi !> Parameter for the magnetic correction on the right element. real(kind=rk), intent(in) :: right_gam !> Parameter for the electric correction on the right element. real(kind=rk), intent(in) :: right_chi |
||
real(kind=rk), | intent(out) | :: | flux(8) |
The flux between left and right cell. The order of this vector is the same as the input arguments. |
cleaning directly on the face-vector
This subroutine assumes the Maxwell equations with D and B as input variables. Furthermore, it is able to handle jumping material parameters.
Assign the same flux for left and right element
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nTotalFaces | |||
integer, | intent(in) | :: | nSides | |||
integer, | intent(in) | :: | nFaceDofs | |||
real(kind=rk), | intent(in) | :: | faceRep(nTotalFaces,nFaceDofs,8,2) | |||
real(kind=rk), | intent(inout) | :: | faceFlux(nTotalFaces,nFaceDofs,8,2) | |||
integer, | intent(in) | :: | leftPos(nSides) | |||
integer, | intent(in) | :: | rightPos(nsides) | |||
integer, | intent(in) | :: | var(8) | |||
real(kind=rk), | intent(in) | :: | material_left(nSides,1,4) | |||
real(kind=rk), | intent(in) | :: | material_right(nSides,1,4) |
integer :: iSide, left, right, iDof real(kind=rk) :: left_mu, right_mu real(kind=rk) :: left_epsi, right_epsi real(kind=rk) :: left_gam, right_gam real(kind=rk) :: left_chi, right_chi real(kind=rk) :: left_speedOfLight, right_speedOfLight real(kind=rk) :: inv_denom_mu, inv_denom_epsi ! -------------------------------------------------------------------------- |
cleaning directly on the face-vector
This subroutine assumes the Maxwell equations with D and B as input variables. Furthermore, it is able to handle arbitray material parameters by a pseudo-spectral technique.
! Get the material of the left and right element at the current ! face. ! ... left material left_mu = material_left(iSide,iPoint,1) left_epsi = material_left(iSide,iPoint,2) left_gam = material_left(iSide,iPoint,3) left_chi = material_left(iSide,iPoint,4) ! ... right material right_mu = material_right(iSide,iPoint,1) right_epsi = material_right(iSide,iPoint,2) right_gam = material_right(iSide,iPoint,3) right_chi = material_right(iSide,iPoint,4)
& left_mu = left_mu, & & left_epsi = left_epsi, & & left_gam = left_gam, & & left_chi = left_chi, & & right_mu = right_mu, & & right_epsi = right_epsi, & & right_gam = right_gam, & & right_chi = right_chi, &
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nTotalFaces | |||
integer, | intent(in) | :: | nSides | |||
integer, | intent(in) | :: | nFaceDofs | |||
real(kind=rk), | intent(in) | :: | faceRep(nTotalFaces,nFaceDofs,8,2) |
The modal representation on the faces, left and right trace. |
||
real(kind=rk), | intent(inout) | :: | faceFlux(nTotalFaces,nFaceDofs,8,2) |
The fluxes for all faces, for left and right elements. |
||
integer, | intent(in) | :: | leftPos(nSides) |
Positions for the left and right elements of all faces |
||
integer, | intent(in) | :: | rightPos(nsides) |
Positions for the left and right elements of all faces |
||
integer, | intent(in) | :: | var(8) |
Variable rotation indices |
||
real(kind=rk), | intent(in) | :: | material_left(nSides,nFaceDofs,4) |
Material parameters for the left faces. |
||
real(kind=rk), | intent(in) | :: | material_right(nSides,nFaceDofs,4) |
Material parameters for the right faces. |
||
type(ply_poly_project_type) | :: | poly_proj |
Data for projection method !> Working array for the left and right modal coefficients real(kind=rk), intent(inout) :: left_modalCoeffs((fpt%nQuadPoints)2,8) real(kind=rk), intent(inout) :: right_modalCoeffs((fpt%nQuadPoints)2,8) !> Working array for the left and right point values real(kind=rk), intent(inout) :: left_pntVal((fpt%nQuadPoints)2,8) real(kind=rk), intent(inout) :: right_pntVal((fpt%nQuadPoints)2,8) !> Working array for the nodal flux real(kind=rk), intent(inout) :: nodalNumFlux((fpt%nQuadPoints)2,8) !> Working array for the modal numerical flux real(kind=rk), intent(inout) :: numFluxBuffer((fpt%nQuadPoints)2,8) |
|||
real(kind=rk), | intent(inout), | allocatable | :: | left_modalCoeffs(:,:) |
Working array for the left and right modal coefficients |
|
real(kind=rk), | intent(inout), | allocatable | :: | right_modalCoeffs(:,:) | ||
real(kind=rk), | intent(inout), | allocatable | :: | left_pntVal(:,:) |
Working array for the left and right point values |
|
real(kind=rk), | intent(inout), | allocatable | :: | right_pntVal(:,:) | ||
real(kind=rk), | intent(inout), | allocatable | :: | nodalNumFlux(:,:) |
Working array for the nodal flux |
|
real(kind=rk), | intent(inout), | allocatable | :: | numFluxBuffer(:,:) |
Working array for the modal numerical flux |
Function for physical flux of the Maxwell equations in terms of D and B.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | state(8) |
State to compute the fluxes from (D,B). |
||
real(kind=rk), | intent(in) | :: | material(4) |
Material parameters (mu, epsilon) the flux calculation |
The resulting flux in x direction
Subroutine to calculate the flux for pure Maxwell equations without any divergence cleaning on the reference cubic face.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | left(6) |
Left state vector (as conservative variables). The order of this vector has to be \f$ (D_x, D_y, D_z, B_1, B_2, B_3) \f$ where E and B denoted electric field vetor and magnetic field (also called magnetic induction) vector. |
||
real(kind=rk), | intent(in) | :: | right(6) |
Right state vector (as conservative variables). The order of this vector has to be (D_x, D_y, D_z, B_1, B_2, B_3) where E and B denoted the electric field vetor and magnetic field (also called magnetic induction) vector. |
||
real(kind=rk), | intent(in) | :: | left_mu |
The magnetic permeability of the left element. |
||
real(kind=rk), | intent(in) | :: | left_epsi |
The electric permitivity of the left element. |
||
real(kind=rk), | intent(in) | :: | right_mu |
The magnetic permeability of the right element. |
||
real(kind=rk), | intent(in) | :: | right_epsi |
The electric permitivity of the right element. |
||
real(kind=rk), | intent(out) | :: | flux(6) |
The flux between left and right cell. The order of this vector is the same as the input arguments. |
c a l c u l a t e
f l u x
o f
p u r e
m a x w e l l
e q u a t i o n
d i r e c t l y
o n
t h e
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nTotalFaces | |||
integer, | intent(in) | :: | nSides | |||
integer, | intent(in) | :: | nFaceDofs | |||
real(kind=rk), | intent(in) | :: | faceRep(nTotalFaces,nFaceDofs,6,2) |
The modal representation on the faces, left and right trace. |
||
real(kind=rk), | intent(inout) | :: | faceFlux(nTotalFaces,nFaceDofs,6,2) |
The fluxes for all faces, for left and right elements. |
||
integer, | intent(in) | :: | leftPos(nSides) |
Positions for the left and right elements of all faces |
||
integer, | intent(in) | :: | rightPos(nsides) |
Positions for the left and right elements of all faces |
||
integer, | intent(in) | :: | var(6) |
Variable rotation indices |
||
real(kind=rk), | intent(in) | :: | material_left(nSides,nFaceDofs,2) |
Material parameters for the left faces. |
||
real(kind=rk), | intent(in) | :: | material_right(nSides,nFaceDofs,2) |
Material parameters for the right faces. |
||
type(ply_poly_project_type) | :: | poly_proj |
Data for projection method |
|||
real(kind=rk), | intent(inout) | :: | modalCoeffs(:,:,:) |
Working array for the left and right modal coefficients |
||
real(kind=rk), | intent(inout) | :: | pntVal(:,:,:) |
Working array for the left and right point values |
||
real(kind=rk), | intent(inout) | :: | nodalNumFlux(:,:) |
Working array for the nodal flux |
||
real(kind=rk), | intent(inout) | :: | numFluxBuffer(:,:) |
Working array for the modal numerical flux |
c a l c u l a t e
f l u x
o f
p u r e
m a x w e l l
e q u a t i o n
d i r e c t l y
o n
t h e
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nTotalFaces | |||
integer, | intent(in) | :: | nSides | |||
integer, | intent(in) | :: | nFaceDofs | |||
real(kind=rk), | intent(in) | :: | faceRep(nTotalFaces,nFaceDofs,6,2) | |||
real(kind=rk), | intent(inout) | :: | faceFlux(nTotalFaces,nFaceDofs,6,2) | |||
integer, | intent(in) | :: | leftPos(nSides) | |||
integer, | intent(in) | :: | rightPos(nsides) | |||
integer, | intent(in) | :: | var(6) | |||
real(kind=rk), | intent(in) | :: | material_left(nSides,1,2) | |||
real(kind=rk), | intent(in) | :: | material_right(nSides,1,2) |
S u b r o u t i n e
t o
c a l c u l a t e
t h e
f l u x
f o r
p u r e
M a x w e l l
e q u a t i o n s
w i t h
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | left(8) |
Left state vector (as conservative variables). The order of this vector has to be \f$ (D_x, D_y, D_z, B_1, B_2, B_3, phi, psi) \f$ where E and B denoted electric field vetor and magnetic field (also called magnetic induction) vector. |
||
real(kind=rk), | intent(in) | :: | right(8) |
Right state vector (as conservative variables). The order of this vector has to be (D_x, D_y, D_z, B_1, B_2, B_3, phi, psi) where E and B denoted the electric field vetor and magnetic field (also called magnetic induction) vector. |
||
real(kind=rk), | intent(in) | :: | mat_left(4) |
Material for the left face |
||
real(kind=rk), | intent(in) | :: | mat_right(4) |
Material for the right face !> The magnetic permeability of the left element. real(kind=rk), intent(in) :: left_mu !> The electric permitivity of the left element. real(kind=rk), intent(in) :: left_epsi !> Parameter for the magnetic correction on the left element. real(kind=rk), intent(in) :: left_gam !> Parameter for the electric correction on the left element. real(kind=rk), intent(in) :: left_chi !> The magnetic permeability of the right element. real(kind=rk), intent(in) :: right_mu !> The electric permitivity of the right element. real(kind=rk), intent(in) :: right_epsi !> Parameter for the magnetic correction on the right element. real(kind=rk), intent(in) :: right_gam !> Parameter for the electric correction on the right element. real(kind=rk), intent(in) :: right_chi |
||
real(kind=rk), | intent(out) | :: | flux(8) |
The flux between left and right cell. The order of this vector is the same as the input arguments. |
c a l c u l a t e
f l u x
o f
m a x w e l l
e q u a t i o n
w i t h
h y p e r b o l i c
d i v e r g e n c e
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nTotalFaces | |||
integer, | intent(in) | :: | nSides | |||
integer, | intent(in) | :: | nFaceDofs | |||
real(kind=rk), | intent(in) | :: | faceRep(nTotalFaces,nFaceDofs,8,2) | |||
real(kind=rk), | intent(inout) | :: | faceFlux(nTotalFaces,nFaceDofs,8,2) | |||
integer, | intent(in) | :: | leftPos(nSides) | |||
integer, | intent(in) | :: | rightPos(nsides) | |||
integer, | intent(in) | :: | var(8) | |||
real(kind=rk), | intent(in) | :: | material_left(nSides,1,4) | |||
real(kind=rk), | intent(in) | :: | material_right(nSides,1,4) |
integer :: iSide, left, right, iDof real(kind=rk) :: left_mu, right_mu real(kind=rk) :: left_epsi, right_epsi real(kind=rk) :: left_gam, right_gam real(kind=rk) :: left_chi, right_chi real(kind=rk) :: left_speedOfLight, right_speedOfLight real(kind=rk) :: inv_denom_mu, inv_denom_epsi ! -------------------------------------------------------------------------- |
c a l c u l a t e
f l u x
o f
m a x w e l l
e q u a t i o n
w i t h
h y p e r b o l i c
d i v e r g e n c e
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nTotalFaces | |||
integer, | intent(in) | :: | nSides | |||
integer, | intent(in) | :: | nFaceDofs | |||
real(kind=rk), | intent(in) | :: | faceRep(nTotalFaces,nFaceDofs,8,2) |
The modal representation on the faces, left and right trace. |
||
real(kind=rk), | intent(inout) | :: | faceFlux(nTotalFaces,nFaceDofs,8,2) |
The fluxes for all faces, for left and right elements. |
||
integer, | intent(in) | :: | leftPos(nSides) |
Positions for the left and right elements of all faces |
||
integer, | intent(in) | :: | rightPos(nsides) |
Positions for the left and right elements of all faces |
||
integer, | intent(in) | :: | var(8) |
Variable rotation indices |
||
real(kind=rk), | intent(in) | :: | material_left(nSides,nFaceDofs,4) |
Material parameters for the left faces. |
||
real(kind=rk), | intent(in) | :: | material_right(nSides,nFaceDofs,4) |
Material parameters for the right faces. |
||
type(ply_poly_project_type) | :: | poly_proj |
Data for projection method !> Working array for the left and right modal coefficients real(kind=rk), intent(inout) :: left_modalCoeffs((fpt%nQuadPoints)2,8) real(kind=rk), intent(inout) :: right_modalCoeffs((fpt%nQuadPoints)2,8) !> Working array for the left and right point values real(kind=rk), intent(inout) :: left_pntVal((fpt%nQuadPoints)2,8) real(kind=rk), intent(inout) :: right_pntVal((fpt%nQuadPoints)2,8) !> Working array for the nodal flux real(kind=rk), intent(inout) :: nodalNumFlux((fpt%nQuadPoints)2,8) !> Working array for the modal numerical flux real(kind=rk), intent(inout) :: numFluxBuffer((fpt%nQuadPoints)2,8) |
|||
real(kind=rk), | intent(inout), | allocatable | :: | left_modalCoeffs(:,:) |
Working array for the left and right modal coefficients |
|
real(kind=rk), | intent(inout), | allocatable | :: | right_modalCoeffs(:,:) | ||
real(kind=rk), | intent(inout), | allocatable | :: | left_pntVal(:,:) |
Working array for the left and right point values |
|
real(kind=rk), | intent(inout), | allocatable | :: | right_pntVal(:,:) | ||
real(kind=rk), | intent(inout), | allocatable | :: | nodalNumFlux(:,:) |
Working array for the nodal flux |
|
real(kind=rk), | intent(inout), | allocatable | :: | numFluxBuffer(:,:) |
Working array for the modal numerical flux |