Skip to content

Commit

Permalink
Merge branch 'hotfix-erosion' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Blondel committed Dec 6, 2021
2 parents 993434b + d7970ab commit 900bfe3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion xolotl/solver/src/monitor/Monitor1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1640,8 +1640,10 @@ eventFunction1D(TS ts, PetscReal time, Vec solution, PetscScalar* fvalue, void*)
fvalue[0] = 0;
}

// Update the threshold for erosion (the cell size is not the same)
threshold = (62.8 - initialVConc) * (grid[xi + 1] - grid[xi]);
// Moving the surface back
else if (nInterEvent1D < -threshold / 10.0) {
if (nInterEvent1D < -threshold * 0.9) {
// The surface is moving
fvalue[1] = 0;
}
Expand Down
7 changes: 5 additions & 2 deletions xolotl/solver/src/monitor/Monitor2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,14 +1131,17 @@ eventFunction2D(TS ts, PetscReal time, Vec solution, PetscScalar* fvalue, void*)
// the surface

// The density of tungsten is 62.8 atoms/nm3, thus the threshold is
double threshold = (62.8 - initialVConc) * hxLeft * hy;
double threshold =
(62.8 - initialVConc) * (grid[xi] - grid[xi - 1]) * hy;
if (nInterstitial2D[yj] > threshold) {
// The surface is moving
fvalue[0] = 0.0;
}

// Update the threshold for erosion (the cell size is not the same)
threshold = (62.8 - initialVConc) * (grid[xi + 1] - grid[xi]) * hy;
// Moving the surface back
else if (nInterstitial2D[yj] < -threshold / 10.0) {
if (nInterstitial2D[yj] < -threshold * 0.9) {
// The surface is moving
fvalue[0] = 0.0;
}
Expand Down
6 changes: 5 additions & 1 deletion xolotl/solver/src/monitor/Monitor3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,8 +1140,12 @@ eventFunction3D(TS ts, PetscReal time, Vec solution, PetscScalar* fvalue, void*)
fvalue[0] = 0.0;
}

// Update the threshold for erosion (the cell size is not the
// same)
threshold =
(62.8 - initialVConc) * (grid[xi + 1] - grid[xi]) * hy * hz;
// Moving the surface back
else if (nInterstitial3D[yj][zk] < -threshold / 10.0) {
if (nInterstitial3D[yj][zk] < -threshold / 10.0) {
// The surface is moving
fvalue[0] = 0.0;
}
Expand Down

0 comments on commit 900bfe3

Please sign in to comment.