Skip to content

Commit

Permalink
Merge branch 'bugFix.BGK.monoatomic.species' into 'master.dev'
Browse files Browse the repository at this point in the history
[bugFix.BGK.monoatomic.species] Bugfix for a pure monoatomic species BGK-simulation

See merge request piclas/piclas!971
  • Loading branch information
pnizenkov committed Aug 26, 2024
2 parents 68b6074 + 066af17 commit 347042e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,13 @@ simulation is then determined by
$$\dot{m} = \frac{QM}{1000RT},$$

where $R=8.314$ J mol$^{-1}$K$^{-1}$ is the gas constant, $M$ the molar mass in [g mol$^{-1}$] and $T$ is the gas temperature [K].

In some cases it might be useful to utilize averaged values across the complete BC by enabling

AdaptiveBC-AverageValuesOverBC = T

Here, the cell-local values are averaged and the resulting macroscopic values are utilized for the particle emission.

It should be noted that while multiple adaptive boundaries are possible, adjacent boundaries that share a mesh element should be avoided or treated carefully.
Examples are given as part of the regression tests in `regressioncheck/CHE_DSMC/SurfFlux_Tria_Adaptive_ConstMassflow` and `SurfFlux_Tria_Adaptive_ConstPressure`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ CFLscale = 0.2 ! Scaling of theoretical CFL number
DoParticleLatencyHiding=T
DoLoadBalance=T
DoInitialAutoRestart=T
UseH5IOLoadBalance = T
! =============================================================================== !
! PARTICLES
! =============================================================================== !
Expand Down
3 changes: 1 addition & 2 deletions regressioncheck/CHE_BGK/builds.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
binary=./bin/piclas

! fixed compiler flags
CMAKE_BUILD_TYPE = RELEASE
CMAKE_BUILD_TYPE = Debug
LIBS_BUILD_HDF5 = OFF
PICLAS_POLYNOMIAL_DEGREE = N
PICLAS_EQNSYSNAME = maxwell
PICLAS_TIMEDISCMETHOD = BGK-Flow
LIBS_USE_MPI = ON
PICLAS_NODETYPE = GAUSS
PICLAS_LOADBALANCE = OFF
16 changes: 12 additions & 4 deletions src/particles/bgk/bgk_colloperator.f90
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ SUBROUTINE BGK_CollisionOperator(iPartIndx_Node, nPart, NodeVolume, AveragingVal
IF(DSMC%CalcQualityFactors) THEN
BGK_MaxRotRelaxFactor = MAX(BGK_MaxRotRelaxFactor,MAXVAL(rotrelaxfreqSpec(:))*dtCell)
END IF
ELSE
rotrelaxfreqSpec(:) = 0.0
vibrelaxfreqSpec(:) = 0.0
IF(DSMC%CalcQualityFactors) THEN
BGK_MaxRotRelaxFactor = 0.0
END IF
END IF

! 4.) Determine the relaxation temperatures and the number of particles undergoing a relaxation (including vibration + rotation)
Expand Down Expand Up @@ -299,10 +305,12 @@ SUBROUTINE BGK_CollisionOperator(iPartIndx_Node, nPart, NodeVolume, AveragingVal
DO iSpec = 1, nSpecies
! Calculate scaling factor alpha per species, see F. Hild, M. Pfeiffer, "Multi-species modeling in the particle-based ellipsoidal
! statistical Bhatnagar-Gross-Krook method including internal degrees of freedom", subitted to Phys. Fluids, August 2023
IF (NewEnRot(iSpec).GT.0.0) THEN
alphaRot(iSpec) = OldEn/NewEnRot(iSpec)*(Xi_RotSpec(iSpec)*RotRelaxWeightSpec(iSpec)/(Xi_RotTotal+3.*(totalWeight-1.)))
ELSE
alphaRot(iSpec) = 0.0
IF((Species(iSpec)%InterID.EQ.2).OR.(Species(iSpec)%InterID.EQ.20)) THEN
IF (NewEnRot(iSpec).GT.0.0) THEN
alphaRot(iSpec) = OldEn/NewEnRot(iSpec)*(Xi_RotSpec(iSpec)*RotRelaxWeightSpec(iSpec)/(Xi_RotTotal+3.*(totalWeight-1.)))
ELSE
alphaRot(iSpec) = 0.0
END IF
END IF
END DO
DO iLoop = 1, nRotRelax
Expand Down
2 changes: 1 addition & 1 deletion src/particles/sampling/particle_sampling_vars.f90
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MODULE MOD_Particle_Sampling_Vars
!-----------------------------------------------------------------------------------------------------------------------------------
! Sampling of elements with a boundary for adaptive surface flux and porous BC
LOGICAL :: UseAdaptiveBC ! Flag is set if an adaptive boundary is present
LOGICAL :: AdaptBCAverageValBC ! Flag to enable/disable averaging accross the whole BC
LOGICAL :: AdaptBCAverageValBC ! Flag to enable/disable averaging across the whole BC
REAL, ALLOCATABLE :: AdaptBCAverageMacroVal(:,:,:) ! Macroscopic values averaged over BC
! (1:3, 1:nSpecies, 1:nSurfaceFluxBCs)
! 1: Number density
Expand Down

0 comments on commit 347042e

Please sign in to comment.