Skip to content

Commit

Permalink
Merge branch 'feature.virtualCellMerge' into 'master.dev'
Browse files Browse the repository at this point in the history
[feature.virtualCellMerge] Virtual cell merge for DSMC, BGK, FP

See merge request piclas/piclas!737
  • Loading branch information
scopplestone committed Dec 9, 2022
2 parents dfc2d21 + 6029a4a commit 65a9e9f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion regressioncheck/NIG_DSMC/VirtualCellMerge/analyze.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
h5diff_file = VirtualCellMerge_DSMCState_000.00000080000000000.h5
h5diff_reference_file = VirtualCellMerge_DSMCState_000.00000080000000000_ref.h5
h5diff_data_set = ElemData
h5diff_tolerance_value = 2e19
h5diff_tolerance_value = 2.20e19
h5diff_tolerance_type = absolute
h5diff_max_differences = 0
2 changes: 1 addition & 1 deletion regressioncheck/NIG_DSMC/VirtualCellMerge/command_line.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MPI=4
MPI=1,2,4
restart_file = VirtualCellMerge_restart_State_000.00000040000000000.h5
cmd_suffix=DSMC.ini
14 changes: 11 additions & 3 deletions regressioncheck/NIG_DSMC/VirtualCellMerge/parameter.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ tend = 8.0e-7
Analyze_dt = 1E-2

! time output
IterDisplayStep = 1000
IterDisplayStep = 1
! =============================================================================== !
! Load Balance
! =============================================================================== !
DoLoadBalance = F
PartWeightLoadBalance = F
DoInitialAutoRestart = T
InitialAutoRestart-PartWeightLoadBalance = T
LoadBalanceMaxSteps = 2
! =============================================================================== !
! DISCRETIZATION
! =============================================================================== !
Expand Down Expand Up @@ -82,9 +90,9 @@ Part-Species1-Init1-VeloIC = 0
Part-Species1-Init1-VeloVecIC = (/0.,0.,1./)

Particles-NumberForDSMCOutputs = 1
Part-TimeFracForSampling = 1
Part-TimeFracForSampling = 0.99

Part-DoVirtualCellMerge = T
Part-MinPartNumCellMerge = 1000
Part-CellMergeSpread = 3
Part-MaxNumbCellsMerge = 500
Part-MaxNumbCellsMerge = 500
5 changes: 4 additions & 1 deletion src/particles/restart/particle_restart.f90
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ SUBROUTINE ParticleRestart()
! Particles
USE MOD_HDF5_Input_Particles ,ONLY: ReadEmissionVariablesFromHDF5
USE MOD_Part_Operations ,ONLY: RemoveAllElectrons
USE MOD_Part_Tools ,ONLY: UpdateNextFreePosition,StoreLostParticleProperties
USE MOD_Part_Tools ,ONLY: UpdateNextFreePosition,StoreLostParticleProperties, MergeCells
USE MOD_Particle_Boundary_Vars ,ONLY: PartBound
USE MOD_Particle_Vars ,ONLY: PartInt,PartData,PartState,PartSpecies,PEM,PDM,usevMPF,PartMPF,PartPosRef,SpecReset,Species
USE MOD_Particle_Vars ,ONLY: DoVirtualCellMerge
! Restart
USE MOD_Restart_Vars ,ONLY: DoMacroscopicRestart
! HDG
Expand Down Expand Up @@ -808,6 +809,8 @@ SUBROUTINE ParticleRestart()
! ------------------------------------------------
CALL ReadEmissionVariablesFromHDF5()

IF (DoVirtualCellMerge) CALL MergeCells()

#if USE_HDG
! Create electrons from BR fluid properties
IF(BRConvertFluidToElectrons) CALL CreateElectronsFromBRFluid(.TRUE.)
Expand Down
9 changes: 3 additions & 6 deletions src/timedisc/timedisc_TimeStep_BGK.f90
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ SUBROUTINE TimeStep_BGK()
USE MOD_Globals ,ONLY: abort, CROSS
USE MOD_Particle_Vars ,ONLY: PartState, LastPartPos, PDM, PEM, DoSurfaceFlux, WriteMacroVolumeValues
USE MOD_Particle_Vars ,ONLY: UseRotRefFrame, RotRefFrameOmega
USE MOD_Particle_Vars ,ONLY: VarTimeStep, Symmetry, DoVirtualCellMerge
USE MOD_Particle_Vars ,ONLY: VarTimeStep, Symmetry
USE MOD_DSMC_Vars ,ONLY: DSMC, CollisMode
USE MOD_part_tools ,ONLY: UpdateNextFreePosition, MergeCells
USE MOD_part_tools ,ONLY: UpdateNextFreePosition
USE MOD_part_emission ,ONLY: ParticleInserting
USE MOD_Particle_SurfFlux ,ONLY: ParticleSurfaceflux
USE MOD_Particle_Tracking ,ONLY: PerformTracking
USE MOD_Particle_Tracking_vars ,ONLY: tTracking,MeasureTrackTime
USE MOD_Eval_xyz ,ONLY: GetPositionInRefElem
USE MOD_part_RHS ,ONLY: CalcPartRHSRotRefFrame
USE MOD_Part_Tools ,ONLY: InRotRefFrameCheck
USE MOD_Restart_Vars ,ONLY: DoRestart
#if USE_MPI
USE MOD_Particle_MPI ,ONLY: IRecvNbOfParticles, MPIParticleSend,MPIParticleRecv,SendNbOfparticles
USE MOD_Particle_MPI_Vars ,ONLY: DoParticleLatencyHiding
Expand All @@ -71,9 +70,7 @@ SUBROUTINE TimeStep_BGK()
#ifdef EXTRAE
CALL extrae_eventandcounters(int(9000001), int8(5))
#endif /*EXTRAE*/
IF (DoVirtualCellMerge) THEN
IF ((iter.EQ.0).AND.DoRestart) CALL MergeCells()
END IF

IF (DoSurfaceFlux) THEN
CALL ParticleSurfaceflux()
END IF
Expand Down
9 changes: 2 additions & 7 deletions src/timedisc/timedisc_TimeStep_DSMC.f90
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ SUBROUTINE TimeStep_DSMC()
USE MOD_Globals ,ONLY: abort, CROSS
USE MOD_Particle_Vars ,ONLY: PartState, LastPartPos, PDM, PEM, DoSurfaceFlux, WriteMacroVolumeValues
USE MOD_Particle_Vars ,ONLY: UseRotRefFrame, RotRefFrameOmega
USE MOD_Particle_Vars ,ONLY: WriteMacroSurfaceValues, Symmetry, VarTimeStep, Species, PartSpecies, DoVirtualCellMerge
USE MOD_Particle_Vars ,ONLY: WriteMacroSurfaceValues, Symmetry, VarTimeStep, Species, PartSpecies
USE MOD_Particle_Vars ,ONLY: UseSplitAndMerge
USE MOD_DSMC_Vars ,ONLY: DSMC, CollisMode, AmbipolElecVelo
USE MOD_DSMC ,ONLY: DSMC_main
USE MOD_part_tools ,ONLY: UpdateNextFreePosition, MergeCells
USE MOD_part_tools ,ONLY: UpdateNextFreePosition
USE MOD_part_emission ,ONLY: ParticleInserting
USE MOD_Particle_SurfFlux ,ONLY: ParticleSurfaceflux
USE MOD_Particle_Tracking_vars ,ONLY: tTracking,MeasureTrackTime
Expand Down Expand Up @@ -78,11 +78,6 @@ SUBROUTINE TimeStep_DSMC()
CALL LBStartTime(tLBStart)
#endif /*USE_LOADBALANCE*/


IF (DoVirtualCellMerge) THEN
IF ((iter.EQ.0).AND.DoRestart) CALL MergeCells()
END IF

IF (DoSurfaceFlux) THEN
#if USE_LOADBALANCE
CALL LBPauseTime(LB_SURF,tLBStart)
Expand Down
7 changes: 2 additions & 5 deletions src/timedisc/timedisc_TimeStep_FPFlow.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ SUBROUTINE TimeStep_FPFlow()
USE MOD_TimeDisc_Vars ,ONLY: dt, IterDisplayStep, iter, TEnd, Time
USE MOD_Globals ,ONLY: abort
USE MOD_Particle_Vars ,ONLY: PartState, LastPartPos, PDM, PEM, DoSurfaceFlux, WriteMacroVolumeValues
USE MOD_Particle_Vars ,ONLY: VarTimeStep, Symmetry, DoVirtualCellMerge
USE MOD_Particle_Vars ,ONLY: VarTimeStep, Symmetry
USE MOD_DSMC_Vars ,ONLY: DSMC, CollisMode
USE MOD_part_tools ,ONLY: UpdateNextFreePosition, MergeCells
USE MOD_part_tools ,ONLY: UpdateNextFreePosition
USE MOD_part_emission ,ONLY: ParticleInserting
USE MOD_Particle_SurfFlux ,ONLY: ParticleSurfaceflux
USE MOD_Particle_Tracking ,ONLY: PerformTracking
Expand All @@ -62,9 +62,6 @@ SUBROUTINE TimeStep_FPFlow()
INTEGER :: iPart
REAL :: RandVal, dtVar, NewYPart, NewYVelo
!===================================================================================================================================
IF (DoVirtualCellMerge) THEN
IF ((iter.EQ.0).AND.DoRestart) CALL MergeCells()
END IF
IF (DoSurfaceFlux) THEN
CALL ParticleSurfaceflux()
END IF
Expand Down

0 comments on commit 65a9e9f

Please sign in to comment.