mirror of
https://git.gfz-potsdam.de/naaice/tug.git
synced 2025-12-13 09:28:23 +01:00
fix: Typos in FTCS
In the calculation of alpha intercell values, the concentration of alpha and its neighboring concentrations were utilized, as opposed to employing neighboring alpha concentrations. For evaluating the left/right boundary conditions, there was an error in indexing - specifically, column indexing was erroneously employed instead of the intended row indexing.
This commit is contained in:
parent
e2bf3a7662
commit
cdfc42ac9c
@ -88,9 +88,9 @@ static inline T calcHorizontalChangeLeftBoundaryClosed(Grid<T> &grid, int &row,
|
|||||||
template <class T>
|
template <class T>
|
||||||
static inline T calcHorizontalChangeLeftBoundary(Grid<T> &grid, Boundary<T> &bc,
|
static inline T calcHorizontalChangeLeftBoundary(Grid<T> &grid, Boundary<T> &bc,
|
||||||
int &row, int &col) {
|
int &row, int &col) {
|
||||||
if (bc.getBoundaryElementType(BC_SIDE_LEFT, col) == BC_TYPE_CONSTANT) {
|
if (bc.getBoundaryElementType(BC_SIDE_LEFT, row) == BC_TYPE_CONSTANT) {
|
||||||
return calcHorizontalChangeLeftBoundaryConstant(grid, bc, row, col);
|
return calcHorizontalChangeLeftBoundaryConstant(grid, bc, row, col);
|
||||||
} else if (bc.getBoundaryElementType(BC_SIDE_LEFT, col) == BC_TYPE_CLOSED) {
|
} else if (bc.getBoundaryElementType(BC_SIDE_LEFT, row) == BC_TYPE_CLOSED) {
|
||||||
return calcHorizontalChangeLeftBoundaryClosed(grid, row, col);
|
return calcHorizontalChangeLeftBoundaryClosed(grid, row, col);
|
||||||
} else {
|
} else {
|
||||||
throw_invalid_argument("Undefined Boundary Condition Type!");
|
throw_invalid_argument("Undefined Boundary Condition Type!");
|
||||||
@ -130,9 +130,9 @@ template <class T>
|
|||||||
static inline T calcHorizontalChangeRightBoundary(Grid<T> &grid,
|
static inline T calcHorizontalChangeRightBoundary(Grid<T> &grid,
|
||||||
Boundary<T> &bc, int &row,
|
Boundary<T> &bc, int &row,
|
||||||
int &col) {
|
int &col) {
|
||||||
if (bc.getBoundaryElementType(BC_SIDE_RIGHT, col) == BC_TYPE_CONSTANT) {
|
if (bc.getBoundaryElementType(BC_SIDE_RIGHT, row) == BC_TYPE_CONSTANT) {
|
||||||
return calcHorizontalChangeRightBoundaryConstant(grid, bc, row, col);
|
return calcHorizontalChangeRightBoundaryConstant(grid, bc, row, col);
|
||||||
} else if (bc.getBoundaryElementType(BC_SIDE_RIGHT, col) == BC_TYPE_CLOSED) {
|
} else if (bc.getBoundaryElementType(BC_SIDE_RIGHT, row) == BC_TYPE_CLOSED) {
|
||||||
return calcHorizontalChangeRightBoundaryClosed(grid, row, col);
|
return calcHorizontalChangeRightBoundaryClosed(grid, row, col);
|
||||||
} else {
|
} else {
|
||||||
throw_invalid_argument("Undefined Boundary Condition Type!");
|
throw_invalid_argument("Undefined Boundary Condition Type!");
|
||||||
@ -162,7 +162,7 @@ static inline T calcVerticalChangeTopBoundaryClosed(Grid<T> &grid, int &row,
|
|||||||
int &col) {
|
int &col) {
|
||||||
|
|
||||||
return calcAlphaIntercell(grid.getAlphaY()(row + 1, col),
|
return calcAlphaIntercell(grid.getAlphaY()(row + 1, col),
|
||||||
grid.getConcentrations()(row, col)) *
|
grid.getAlphaY()(row, col)) *
|
||||||
(grid.getConcentrations()(row + 1, col) -
|
(grid.getConcentrations()(row + 1, col) -
|
||||||
grid.getConcentrations()(row, col));
|
grid.getConcentrations()(row, col));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user