Skip to content

Commit

Permalink
Merge branch 'feature.hdg.floating.bc' into 'master.dev'
Browse files Browse the repository at this point in the history
[feature.hdg.floating.bc] Floating Boundary Condition for the HDG solver

See merge request piclas/piclas!782
  • Loading branch information
scopplestone committed Apr 1, 2023
2 parents 9948397 + efb0476 commit 0b1e3ba
Show file tree
Hide file tree
Showing 43 changed files with 1,838 additions and 110 deletions.
16 changes: 9 additions & 7 deletions REGGIE.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,15 @@ Pure Poisson solver without particles: [Link to build](regressioncheck/NIG_poiss

Pure Poisson solver without particles: [Link to build](regressioncheck/NIG_poisson_PETSC/builds.ini).

| **No.** | **Case** | **CMAKE-CONFIG** | **Feature** | **Execution** | **Comparing** | **Readme** |
| :-----: | :-------------------: | :--------------: | :--------------------------------------------------------------------------------------------------: | :------------: | :--------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------: |
| 1 | CHE_poisson/poisson | Poisson,RK3 | HDG-Operator, secondary electron emission (SEE-I model, does not happen because ions are too slow), | nProcs=1,2,5,8 | L2,Linf | [Link](/regressioncheck/NIG_poisson_PETSC/poisson/readme.md) |
| | | | hard compiled N=1, CalcBoundaryParticleOutput=T,CalcElectricTimeDerivative=T (electric displacement current), | | | |
| | | | UseH5IOLoadBalance=T,F, PETSC with PrecondType=1,2,3,10 (4 and 11 currently fail) | | | |
| | | | | | | |
| 2 | poisson_box_Dirichlet | | restart of lambda solution | nProcs=1-13 | number of HDG iterations, which should be 0 on restart as the already correct solution is used | [Link](regressioncheck/NIG_poisson_PETSC/poisson_box_Dirichlet/readme.md) |
| **No.** | **Case** | **CMAKE-CONFIG** | **Feature** | **Execution** | **Comparing** | **Readme** |
| :-----: | :---------------------------------------: | :--------------: | :--------------------------------------------------------------------------------------------------: | :------------: | :--------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------: |
| 1 | floating_boundary_condition_multi_FPC | Poisson,RK3 | HDG-Operator in PETSc with floating boundary condition (FPC) + feature of using multiple FPCs | nProcs=1,2,3,4,5,7,10,12 | FieldAnalyze.csv | [Link](/regressioncheck/NIG_poisson_PETSC/floating_boundary_condition_multi_FPC/readme.md) |
| 2 | ifloating_boundary_condition_p-convergence | - | HDG-Operator in PETSc with floating boundary condition (FPC) + analytical solution coaxial cable | nProcs=1,2,5,16 | FieldAnalyze.csv + p-convergence test (L2 error converges to zero for increasing polynomial degree N) | [Link](/regressioncheck/NIG_poisson_PETSC/ifloating_boundary_condition_p-convergence/readme.md) |
| 3 | poisson | - | HDG-Operator, secondary electron emission (SEE-I model, does not happen because ions are too slow), | nProcs=1,2,5,8 | L2,Linf | [Link](/regressioncheck/NIG_poisson_PETSC/poisson/readme.md) |
| | | | hard compiled N=1, CalcBoundaryParticleOutput=T,CalcElectricTimeDerivative=T (electric displacement current), | | | |
| | | | UseH5IOLoadBalance=T,F, PETSC with PrecondType=1,2,3,10 (4 and 11 currently fail) | | | |
| | | | | | | |
| 4 | poisson_box_Dirichlet | - | restart of lambda solution | nProcs=1-13 | number of HDG iterations, which should be 0 on restart as the already correct solution is used | [Link](regressioncheck/NIG_poisson_PETSC/poisson_box_Dirichlet/readme.md) |

### NIG_Photoionization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ as detailed in the following table.
| | | |
| (/10,0/) | Neumann | zero-gradient (dPhi/dn=0) |
| (/11,0/) | Neumann | q*n=1 |
| (/20,1/) | FPC | 1: Assign BC to FPC group nbr. 1 (different BCs can be assigned the same FPC), see {ref}`sec:floating-boundary-condition` |

### RefState boundaries {-}

Expand Down Expand Up @@ -154,6 +155,23 @@ following example
LinPhiHeight = 1.0 ! 2nd LinState
LinPhi = 0.0 ! 2nd LinState

(sec:floating-boundary-condition)=
### Floating boundary condition (FPC)
A floating boundary condition (FPC) can be used to model a perfect electric conducting surface. The surface can carry a charge $Q$,
which might change over time. however, the requirement is that the surface yields a closed surface integral in 3D (or 2D with
periodic/symmetric boundaries in the 3rd dimension). One or more FPCs can be set via

BoundaryName = BC_FPC_1 ! BC name in the mesh.h5 file
BoundaryType = (/20,1/) ! 20: activate FPC, 1: Index of the FPC group to which this BC belongs (1st group)

BoundaryName = BC_FPC_2 ! BC name in the mesh.h5 file
BoundaryType = (/20,2/) ! 20: activate FPC, 2: Index of the FPC group to which this BC belongs (2nd group)

For this boundary condition, the charge assigned to each FPC and the resulting potential are written to *FieldAnalyze.csv*
automatically, e.g., "007-FPC-Charge-BCState-001","008-FPC-Voltage-BCState-001", where *BCState* corresponds to the ID of the FPC.
If the particle boundary condition is set to *open* (or *species-swap*), then each impacting charged particle that is removed there,
will be added to the accumulated charge on that FPC.

(sec:fixed-coupled-power)=
### Fixed coupled power (const. input power)

Expand Down
2 changes: 1 addition & 1 deletion regressioncheck/NIG_poisson_PETSC/builds.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
binary=./bin/piclas

! fixed compiler flags
CMAKE_BUILD_TYPE = DEBUG
CMAKE_BUILD_TYPE = Release,Debug
LIBS_BUILD_HDF5 = OFF
PICLAS_EQNSYSNAME = poisson
PICLAS_TIMEDISCMETHOD = RK3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"001-time","002-E-El","003-HDG-#iterations","004-HDG-RunTime","005-HDG-RunTimePerIteration","006-HDG-Norm","007-FPC-Charge-BCState-001","008-FPC-Voltage-BCState-001","009-FPC-Charge-BCState-002","010-FPC-Voltage-BCState-002"
0.1000000000000000E-009,0.3127506087087529E+012,0.2000000000000000E+001,0.1911449000000065E-002,0.9557245000000325E-003,0.3987716128529526E-006,0.5000000000000000E+001,0.2547103581523394E+011,0.1000000000000000E+002,0.4986308056035036E+011
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
! integrate columns x:y in a data file as integral(y(x), x, x(1), x(end))
integrate_line_file = FieldAnalyze.csv ! data file name
integrate_line_columns = 0:6 ! columns x:y [time:nPart_in]
integrate_line_integral_value = 5.0 ! Integrated accumulated charge of FPC
integrate_line_tolerance_value = 1e-10 ! tolerance
integrate_line_tolerance_type = relative ! special option
integrate_line_option = DivideByTimeStep ! the first column in Database.csv is used for this option
integrate_line_multiplier = 2.0 ! this yiels the charge 5.0 on the 1st FPC

! Compare last line in .csv file
compare_data_file_name = FieldAnalyze.csv
compare_data_file_reference = FieldAnalyze_ref.csv
compare_data_file_tolerance = 1e3 ! Ignore small values, the acutally tested values are > 1e10
compare_data_file_tolerance_type = absolute ! Ignore HDG solver info: "003-HDG-#iterations", "004-HDG-RunTime", "005-HDG-RunTimePerIteration", "006-HDG-Norm"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MPI=1,2,3,4,5,7,10,12
!restart_file = plasma_wave_State_000.00000000000000000.h5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
! poisson
PICLAS_PARTICLES=OFF!ON is currently not possible due to load balance restart that requires ElemInfo_Shared, which is not available for PARTICLES=OFF at the moment
PICLAS_POLYNOMIAL_DEGREE=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
! --- Externals Tool Reggie
MPI = 1 , 5
externalbinary = ./hopr/build/bin/hopr , ./bin/piclas
externaldirectory = pre-hopr , post-piclas-restart/
externalruntime = pre , post
cmd_suffix = , ../FPC_State_000.00000000010000000.h5

nocrosscombination:MPI,externalbinary,externaldirectory,externalruntime,cmd_suffix
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
NVisu = 7
N = 6!,2,3,4 ! 7
! =============================================================================== !
! HDG
! =============================================================================== !
epsCG = 1e-6!1e-66
maxIterCG = 12000
! =============================================================================== !
! Mesh
! =============================================================================== !
MeshFile = ./pre-hopr/Box_mesh.h5
useCurveds = F
ExactLambda = T
IniExactFunc = 600
! =============================================================================== !
! OUTPUT / VISUALIZATION
! =============================================================================== !
ProjectName = FPC
Logging = F
WriteErrorFiles = F
printRandomSeeds = F
DoCalcErrorNorms = F
OutputErrorNormsToH5 = F
! =============================================================================== !
! ANALYZE
! =============================================================================== !
CalcPotentialEnergy = T
! =============================================================================== !
! CALCULATION
! =============================================================================== !
Field-AnalyzeStep = 2
ManualTimestep = 5e-11
tend = 10e-11 ! 100e-11
Analyze_dt = 10e-11 ! 100e-11
doPrintStatusLine = T
! =============================================================================== !
! Field Boundaries
! =============================================================================== !
BoundaryName = BC_Cube_left
BoundaryType = (/20,1/) ! 20: activate FPC, 2: Group #1

BoundaryName = BC_Cube_right
BoundaryType = (/20,2/) ! 20: activate FPC, 2: Group #2

! =============================================================================== !
! Load Balance
! =============================================================================== !
DoLoadBalance = T
DoInitialAutoRestart = T
Load-DeviationThreshold = 1e-7
LoadBalanceMaxSteps = 1

! =============================================================================== !
! Particles
! =============================================================================== !
PIC-DoDeposition = F
PIC-DoInterpolation = F
VisuParticles = T
TrackingMethod = 3
Particles-HaloEpsVelo = 300E6
Part-maxParticleNumber = 20000
Part-nSpecies = 1
Part-Species$-MacroParticleFactor = 1

!Part-FIBGMdeltas = (/ 0.04 , 0.04 , 1e-6 /)
Part-FIBGMdeltas = (/ 16.0 , 8.0 , 8.0 /)
Part-FactorFIBGM = (/ 2.0 , 1.0 , 1.0 /)

CalcNumSpec = T
CalcMeshInfo = T
! =============================================================================== !
! Particle Boundaries
! =============================================================================== !
Part-nBounds = 8

Part-Boundary1-SourceName = BC_z-
Part-Boundary1-Condition = reflective

Part-Boundary2-SourceName = BC_z+
Part-Boundary2-Condition = reflective

!Part-nPeriodicVectors = 1

Part-Boundary3-SourceName = BC_y-
Part-Boundary3-Condition = reflective

Part-Boundary4-SourceName = BC_y+
Part-Boundary4-Condition = reflective


Part-Boundary5-SourceName = BC_x-
Part-Boundary5-Condition = reflective

Part-Boundary6-SourceName = BC_x+
Part-Boundary6-Condition = reflective


Part-Boundary7-SourceName = BC_Cube_left
Part-Boundary7-Condition = open

Part-Boundary8-SourceName = BC_Cube_right
Part-Boundary8-Condition = open


! =============================================================================== !
! Species1 | e
! =============================================================================== !
Part-Species1-MassIC = 9.1E-31
Part-Species1-ChargeIC = -4.806529902E-13
!Part-Species1-ChargeIC = 0
!nocrosscombination:N,Part-Species1-ChargeIC

Part-Species1-nInits=1
Part-Species1-Init1-velocityDistribution = maxwell_lpn
Part-Species1-Init1-PartDensity = 1.01e-6 ! 1.01e12
Part-Species1-Init1-SpaceIC = cell_local
Part-Species1-Init1-VeloIC = 2.2e8
Part-Species1-Init1-VeloVecIC = (/0.,1.,0./)
Part-Species1-Init1-MWTemperatureIC = 1e3
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
NVisu = 7
N = 6!,2,3,4 ! 7
! =============================================================================== !
! HDG
! =============================================================================== !
epsCG = 1e-6!1e-66
maxIterCG = 12000
! =============================================================================== !
! Mesh
! =============================================================================== !
MeshFile = ../pre-hopr/Box_mesh.h5
useCurveds = F
ExactLambda = T
IniExactFunc = 600
! =============================================================================== !
! OUTPUT / VISUALIZATION
! =============================================================================== !
ProjectName = FPC
Logging = F
WriteErrorFiles = F
printRandomSeeds = F
DoCalcErrorNorms = F
OutputErrorNormsToH5 = F
! =============================================================================== !
! ANALYZE
! =============================================================================== !
CalcPotentialEnergy = T
! =============================================================================== !
! CALCULATION
! =============================================================================== !
Field-AnalyzeStep = 2
ManualTimestep = 5e-11
tend = 20e-11 ! 100e-11
Analyze_dt = 10e-11 ! 100e-11
doPrintStatusLine = T
! =============================================================================== !
! Field Boundaries
! =============================================================================== !
BoundaryName = BC_Cube_left
BoundaryType = (/20,1/) ! 20: activate FPC, 2: Group #1

BoundaryName = BC_Cube_right
BoundaryType = (/20,2/) ! 20: activate FPC, 2: Group #2

! =============================================================================== !
! Load Balance
! =============================================================================== !
DoLoadBalance = T
DoInitialAutoRestart = T
Load-DeviationThreshold = 1e-7
LoadBalanceMaxSteps = 1

! =============================================================================== !
! Particles
! =============================================================================== !
PIC-DoDeposition = F
PIC-DoInterpolation = F
VisuParticles = T
TrackingMethod = 3
Particles-HaloEpsVelo = 300E6
Part-maxParticleNumber = 20000
Part-nSpecies = 1
Part-Species$-MacroParticleFactor = 1

!Part-FIBGMdeltas = (/ 0.04 , 0.04 , 1e-6 /)
Part-FIBGMdeltas = (/ 16.0 , 8.0 , 8.0 /)
Part-FactorFIBGM = (/ 2.0 , 1.0 , 1.0 /)

CalcNumSpec = T
CalcMeshInfo = T
! =============================================================================== !
! Particle Boundaries
! =============================================================================== !
Part-nBounds = 8

Part-Boundary1-SourceName = BC_z-
Part-Boundary1-Condition = reflective

Part-Boundary2-SourceName = BC_z+
Part-Boundary2-Condition = reflective

!Part-nPeriodicVectors = 1

Part-Boundary3-SourceName = BC_y-
Part-Boundary3-Condition = reflective

Part-Boundary4-SourceName = BC_y+
Part-Boundary4-Condition = reflective


Part-Boundary5-SourceName = BC_x-
Part-Boundary5-Condition = reflective

Part-Boundary6-SourceName = BC_x+
Part-Boundary6-Condition = reflective


Part-Boundary7-SourceName = BC_Cube_left
Part-Boundary7-Condition = open

Part-Boundary8-SourceName = BC_Cube_right
Part-Boundary8-Condition = open


! =============================================================================== !
! Species1 | e
! =============================================================================== !
Part-Species1-MassIC = 9.1E-31
Part-Species1-ChargeIC = -4.806529902E-13
!Part-Species1-ChargeIC = 0
!nocrosscombination:N,Part-Species1-ChargeIC

Part-Species1-nInits=1
Part-Species1-Init1-velocityDistribution = maxwell_lpn
Part-Species1-Init1-PartDensity = 1.01e-6 ! 1.01e12
Part-Species1-Init1-SpaceIC = cell_local
Part-Species1-Init1-VeloIC = 2.2e8
Part-Species1-Init1-VeloVecIC = (/0.,1.,0./)
Part-Species1-Init1-MWTemperatureIC = 1e3
Loading

0 comments on commit 0b1e3ba

Please sign in to comment.