Skip to content

Commit

Permalink
Merge branch 'fix.dielectric.maxwell.master.side' into 'master.dev'
Browse files Browse the repository at this point in the history
Fixed determination of Dielectric_Master array. Copy slave information to...

See merge request piclas/piclas!943
  • Loading branch information
scopplestone committed May 16, 2024
2 parents 6ed23f9 + 6bc8f1f commit 9b1aa67
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MPI=1,4
MPI=1,2,4,6,8
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ tend = 5E-9 ! End time
Analyze_dt = 1E-9 ! Timestep of analyze outputs ! encounter BC at 6.67e-9
CFLscale = 0.9 ! Scaling of theoretical CFL number

DielectricFluxNonConserving = F,T

c_corr = 1
! =============================================================================== !
Expand Down
19 changes: 16 additions & 3 deletions src/dielectric/dielectric.f90
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,10 @@ SUBROUTINE SetDielectricFaceProfile()
#if USE_MPI
REAL,DIMENSION(1,0:PP_N,0:PP_N,1:nSides) :: Dielectric_dummy_Master2
REAL,DIMENSION(1,0:PP_N,0:PP_N,1:nSides) :: Dielectric_dummy_Slave2
INTEGER :: I,J,iSide
INTEGER :: I,J
#endif /*USE_MPI*/
INTEGER :: iElem
INTEGER :: iElem,iSide
REAL :: MinSlave,MinMaster
!===================================================================================================================================
! General workflow:
! 1. Initialize dummy arrays for Elem/Face
Expand Down Expand Up @@ -407,7 +408,7 @@ SUBROUTINE SetDielectricFaceProfile()
! set only the first dimension to 1./SQRT(EpsR*MuR) (the rest are dummies)
Dielectric_dummy_elem(1,0:PP_N,0:PP_N,0:PP_N,(iElem))=SQRT(DielectricConstant_inv(0:PP_N,0:PP_N,0:PP_N,ElemToDielectric(iElem)))
ELSE
Dielectric_dummy_elem(1,0:PP_N,0:PP_N,0:PP_N,(iElem))=1.0
Dielectric_dummy_elem(1,0:PP_N,0:PP_N,0:PP_N,(iElem))=-2.0
END IF
END DO

Expand Down Expand Up @@ -461,6 +462,18 @@ SUBROUTINE SetDielectricFaceProfile()
Dielectric_Slave =Dielectric_dummy_Slave( 1,0:PP_N,0:PP_N,1:nSides)
#endif /*USE_MPI*/

! Copy slave side to master side if the dielectric region is on the slave side as the master will calculate the flux for the
! master and the slave side and it requires the factor 1./SQRT(EpsR*MuR) for the wave travelling into the dielectric region
DO iSide = 1, nSides
MinSlave = MINVAL(Dielectric_Slave(:,:,iSide))
MinMaster = MINVAL(Dielectric_Master(:,:,iSide))
IF((MinMaster.LT.0.0).AND.(MinSlave.LT.0.0))THEN
Dielectric_Master(:,:,iSide) = 1.0
ELSEIF(MinMaster.LT.0.0)THEN
Dielectric_Master(:,:,iSide) = Dielectric_Slave(:,:,iSide)
END IF ! (MinMaster.LT.0.0).AND.(MinSlave.LT.0.0)
END DO ! iSide = 1, nSides

! 8. Check if the default value remains unchanged (negative material constants are not allowed until now)
IF(MINVAL(Dielectric_Master).LT.0.0)THEN
CALL abort(&
Expand Down

0 comments on commit 9b1aa67

Please sign in to comment.