Skip to content

Commit

Permalink
Merge branch 'improvement.DSMC.tempGradient' into 'master.dev'
Browse files Browse the repository at this point in the history
[improvement.DSMC.tempGradient] Bugfix and extension of temperature gradient calculation

See merge request piclas/piclas!814
  • Loading branch information
scopplestone committed Jun 12, 2023
2 parents 20ce793 + a214ff8 commit 713f044
Show file tree
Hide file tree
Showing 15 changed files with 176 additions and 169 deletions.
2 changes: 1 addition & 1 deletion CMakeListsMachine.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ ELSEIF (CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
# Compile flags depend on the generator
IF(NOT "${CMAKE_GENERATOR}" MATCHES "Ninja")
# add flags only for compiling not linking!
SET (PICLAS_COMPILE_FLAGS "-fPIC-fpp -allow nofpp_comments -assume bscc")
SET (PICLAS_COMPILE_FLAGS "-fPIC -fpp -allow nofpp_comments -assume bscc")
ELSE()
SET (PICLAS_COMPILE_FLAGS "${NINJA_COLOR_DIAGNOSTICS} -allow nofpp_comments -assume bscc")
ENDIF()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,20 @@ The wall velocity will then be superimposed onto the particle velocity.
### Linear temperature gradient

A linear temperature gradient across a boundary can be defined by supplying a second wall temperature and the start and end vector

Part-Boundary2-WallTemp2=500.
Part-Boundary2-TemperatureGradientStart=(/0.,0.,0./)
Part-Boundary2-TemperatureGradientEnd=(/0.,0.,1./)

Between these two points the temperature will be interpolated, where the start vector corresponds to the first wall temperature,
whereas the end vector to the second wall temperature. Beyond these position values, the first and second temperature will be used
as the constant wall temperature, respectively.
as well as an optional direction to which the gradient shall be limited (default: 0, x = 1, y = 2, z = 3)

Part-Boundary2-WallTemp2 = 500.
Part-Boundary2-TempGradStart = (/0.,0.,0./)
Part-Boundary2-TempGradEnd = (/1.,0.,1./)
Part-Boundary2-TempGradDir = 0

In the default case of the `TempGradDir = 0`, the temperature will be interpolated between the start and end vector, where the
start vector corresponds to the first wall temperature `WallTemp`, and the end vector to the second wall temperature `WallTemp2`.
Position values (which are projected onto the temperature gradient vector) beyond the gradient vector utilize the first (Start) and second temperature (End) as the constant wall temperature, respectively. In the special case of `TempGradDir = 1/2/3`, the temperature gradient will
only be applied along the chosen the direction. As oppposed to the default case, the positions of the surfaces are not projected
onto the gradient vector before checking wether they are inside the box spanned by `TempGradStart` and `TempGradEnd`. Outside of
the defined box, the temperature corresponds to `WallTemp`. The applied surface temperature is output in the `DSMCSurfState` as
`Wall_Temperature` for verification.

### Radiative equilibrium

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ An option is available to utilize a moving average for the variables used in the

Particles-BGK-MovingAverage = T

The purpose is to increase the sample size and reduce the noise for steady gas flows. For this, a factor
0 < Particles-BGK-MovingAverageFac < 1 must be defined with which the old $$M^n$$ and newly sampled moments $$M$$ are weighted
to define the moments for the next time step $$M^{n+1}$$:

$$ M^{n+1}=Particles-BGK-MovingAverageFac*M+(1-Particles-BGK-MovingAverageFac)*M^n$$
The purpose is to increase the sample size and reduce the noise for steady gas flows. For this, the factor $f$

Particles-BGK-MovingAverageFac = 0.01

between zero and one must be defined with which the old $M^n$ and newly sampled moments $M$ are weighted
to define the moments for the next time step $M^{n+1}$:

$$ M^{n+1}=f M+(1-f) M^n.$$
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ Currently, only merging based on the number of particles within the cell is impl

Furthermore, the spread or aggressiveness of the merge algorithm can be changed, i.e. how deep the merge extends into the mesh starting from each cell. 0 is the least aggressive merge, 3 the most aggressive merge.

Part-CellMergeSpread = 0
Part-CellMergeSpread = 0

There is also the possibility to define a maximum number of cells that can be merged. In this way, a desired "resolution" of the virtual cells can be achieved.

Part-MaxNumbCellsMerge = 5
Part-MaxNumbCellsMerge = 5

Binary file not shown.
103 changes: 0 additions & 103 deletions regressioncheck/CHE_DSMC/BC_DiffuseWall_TempGrad/PartAnalyze_ref.csv

This file was deleted.

11 changes: 6 additions & 5 deletions regressioncheck/CHE_DSMC/BC_DiffuseWall_TempGrad/analyze.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
! compare the PartAnalyze.csv with a reference file
compare_data_file_name = PartAnalyze.csv
compare_data_file_reference = PartAnalyze_ref.csv
compare_data_file_tolerance = 5e-2
compare_data_file_tolerance_type = relative
! absolute comparison of wall temperature gradient due to strong fluctuations in the other variables in DSMCSurfState
h5diff_file = BC_TempGrad_DSMCSurfState_000.00000001000000000.h5
h5diff_reference_file = BC_TempGrad_DSMCSurfState_000.00000001000000000_ref.h5
h5diff_data_set = SurfaceData
h5diff_tolerance_value = 40 ! corresponds to at most 1% deviation (at 4000K)
h5diff_tolerance_type = absolute
Binary file modified regressioncheck/CHE_DSMC/BC_DiffuseWall_TempGrad/cube_mesh.h5
Binary file not shown.
2 changes: 1 addition & 1 deletion regressioncheck/CHE_DSMC/BC_DiffuseWall_TempGrad/hopr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NVisu =1
Mode =1

Corner =(/0.0,0.0,-0.25,, 1.0,0.0,-0.25,,1.0,0.1,-0.25 ,, 0.0,0.1,-0.25 ,, 0.0,0.0,0.25 ,, 1.0,0.0,0.25 ,, 1.0,0.1,0.25 ,, 0.0,0.1,0.25 /)
nElems =(/20,1,1/)
nElems =(/20,1,10/)
elemtype =108

BCIndex =(/6 ,4 ,1 ,3 ,2 ,5/)
Expand Down
Loading

0 comments on commit 713f044

Please sign in to comment.