From b7fcfb3ca52f4b673b34afb1c1152f5ec33920b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20L=C3=BCbke?= Date: Thu, 6 Feb 2025 12:04:32 +0100 Subject: [PATCH] refactor(advection): rename alpha to permK for permeability --- include/tug/Advection/Velocities.hpp | 42 ++++++++++++++-------------- test/testVelocities.cpp | 4 +-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/tug/Advection/Velocities.hpp b/include/tug/Advection/Velocities.hpp index 2fbd774..8cf2fc3 100644 --- a/include/tug/Advection/Velocities.hpp +++ b/include/tug/Advection/Velocities.hpp @@ -47,24 +47,24 @@ private: RowMajMat velocitiesX; RowMajMat velocitiesY; - RowMajMat alphaX; - RowMajMat alphaY; + RowMajMat permKX; + RowMajMat permKY; public: Velocities(RowMajMat &origin) : BaseSimulationGrid(origin), velocitiesX(origin.rows(), origin.cols() + 1), velocitiesY(origin.rows() + 1, origin.cols()), - alphaX(origin.rows(), origin.cols()), - alphaY(origin.rows(), origin.cols()) {}; + permKX(origin.rows(), origin.cols()), + permKY(origin.rows(), origin.cols()) {}; Velocities(T *data, std::size_t rows, std::size_t cols) : BaseSimulationGrid(data, rows, cols), velocitiesX(rows, cols + 1), - velocitiesY(rows + 1, cols), alphaX(rows, cols), alphaY(rows, cols) {}; + velocitiesY(rows + 1, cols), permKX(rows, cols), permKY(rows, cols) {}; - Velocities(T *data, std::size_t length) - : BaseSimulationGrid(data, 1, length), velocitiesX(1, length + 1), - alphaX(1, length) {}; + // Velocities(T *data, std::size_t length) + // : BaseSimulationGrid(data, 1, length), velocitiesX(1, length + 1), + // alphaX(1, length) {}; /** * @brief Set the epsilon value, the relativ error allowed for convergence @@ -83,19 +83,19 @@ public: * * @return RowMajMat& Reference to the alphaX matrix. */ - RowMajMat &getAlphaX() { return alphaX; } + RowMajMat &getPermKX() { return permKX; } /** * @brief Get the alphaY matrix. * * @return RowMajMat& Reference to the alphaY matrix. */ - RowMajMat &getAlphaY() { + RowMajMat &getPermKY() { tug_assert( this->getDim(), "Grid is not two dimensional, there is no domain in y-direction!"); - return alphaY; + return permKY; } /** @@ -103,19 +103,19 @@ public: * * @param alphaX The new alphaX matrix. */ - void setAlphaX(const RowMajMat &alphaX) { this->alphaX = alphaX; } + void setPermKX(const RowMajMat &alphaX) { this->permKX = alphaX; } /** * @brief Set the alphaY matrix. * * @param alphaY The new alphaY matrix. */ - void setAlphaY(const RowMajMat &alphaY) { + void setPermKY(const RowMajMat &alphaY) { tug_assert( this->getDim(), "Grid is not two dimensional, there is no domain in y-direction!"); - this->alphaY = alphaY; + this->permKY = alphaY; } /** @@ -132,7 +132,7 @@ public: const T deltaRowSquare = this->deltaRow() * this->deltaRow(); const T minDeltaSquare = std::min(deltaColSquare, deltaRowSquare); - const T maxK = std::max(this->alphaX.maxCoeff(), this->alphaY.maxCoeff()); + const T maxK = std::max(this->permKX.maxCoeff(), this->permKY.maxCoeff()); T cfl = minDeltaSquare / (4 * maxK); if (timestep > cfl) { @@ -192,8 +192,8 @@ public: SimulationInput input = {.concentrations = this->getConcentrationMatrix(), - .alphaX = this->getAlphaX(), - .alphaY = this->getAlphaY(), + .alphaX = this->getPermKX(), + .alphaY = this->getPermKY(), .boundaries = this->getBoundaryConditions(), .dim = this->getDim(), .timestep = this->timestep, @@ -207,7 +207,7 @@ public: const T deltaRowSquare = this->deltaRow() * this->deltaRow(); const T minDeltaSquare = std::min(deltaColSquare, deltaRowSquare); - const T maxK = std::max(this->alphaX.maxCoeff(), this->alphaY.maxCoeff()); + const T maxK = std::max(this->permKX.maxCoeff(), this->permKY.maxCoeff()); // Calculate largest possible timestep, depending on K and gridsize setTimestep(minDeltaSquare / (4 * maxK)); @@ -268,8 +268,8 @@ private: const T dy = this->deltaRow(); const RowMajMat &hydraulicCharges = this->getConcentrationMatrix(); - const RowMajMat &permKX = this->alphaX; - const RowMajMat &permKY = this->alphaY; + const RowMajMat &permKX = this->permKX; + const RowMajMat &permKY = this->permKY; const Boundary &bc = this->getBoundaryConditions(); @@ -283,7 +283,7 @@ private: } case BC_TYPE_CONSTANT: { velocitiesX(i_rows, 0) = - -this->alphaX(i_rows, 0) * + -this->permKX(i_rows, 0) * (hydraulicCharges(i_rows, 0) - bc_left.getValue()) / (dx / 2); break; } diff --git a/test/testVelocities.cpp b/test/testVelocities.cpp index 9e4ecac..0c8af66 100644 --- a/test/testVelocities.cpp +++ b/test/testVelocities.cpp @@ -30,8 +30,8 @@ VELOCITIES_TEST(SteadyStateCenter) { velo(hydHeads); velo.setDomain(100, 100); - velo.setAlphaX(permKX); - velo.setAlphaY(permKY); + velo.setPermKX(permKX); + velo.setPermKY(permKY); tug::Boundary &bcH = velo.getBoundaryConditions(); bcH.setBoundarySideConstant(tug::BC_SIDE_LEFT, 1);