Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ jobs:
${BUILD_DIR}/test/testRunner [CI_sens22]
${BUILD_DIR}/test/testRunner [CI_sens23]
${BUILD_DIR}/test/testRunner [CI_sens24]
${BUILD_DIR}/test/testRunner [CI_sens25]
- name: Run CI test set III - crystallization
run: |
set -e
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
${BUILD_DIR}/test/testRunner [CI_sens22]
${BUILD_DIR}/test/testRunner [CI_sens23]
${BUILD_DIR}/test/testRunner [CI_sens24]
${BUILD_DIR}/test/testRunner [CI_sens25]
- name: Run CI test set III - crystallization
run: |
${BUILD_DIR}/test/testRunner [CI_cry1]
Expand Down
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,7 @@ endif()

set(EIGEN_TARGET "")
find_package(Eigen3 3.4 REQUIRED NO_MODULE)

# Disable DG if Eigen is not present
if (NOT TARGET Eigen3::Eigen)
message(STATUS "Disabling DG support because Eigen3 could not be found")
set(ENABLE_DG OFF)
else()
set(EIGEN_TARGET "Eigen3::Eigen")
endif()
set(EIGEN_TARGET "Eigen3::Eigen")

set(IPO_AVAILABLE OFF)
if (ENABLE_IPO)
Expand Down
1 change: 1 addition & 0 deletions src/libcadet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ list (APPEND LIBCADET_SOURCES
${CMAKE_SOURCE_DIR}/src/libcadet/model/particle/HomogeneousParticle.cpp
${CMAKE_SOURCE_DIR}/src/libcadet/model/parts/ParticleDiffusionOperatorBase.cpp
${CMAKE_SOURCE_DIR}/src/libcadet/model/parts/ParticleDiffusionOperatorDG.cpp
${CMAKE_SOURCE_DIR}/src/libcadet/model/parts/ParticleDiffusionOperatorFV.cpp
${CMAKE_SOURCE_DIR}/src/libcadet/model/LumpedRateModelWithoutPoresDG.cpp
${CMAKE_SOURCE_DIR}/src/libcadet/model/ColumnModel1D.cpp
)
Expand Down
14 changes: 6 additions & 8 deletions src/libcadet/model/particle/GeneralRateParticle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "model/particle/GeneralRateParticle.hpp"
#include "model/parts/ParticleDiffusionOperatorDG.hpp"
#include "model/parts/ParticleDiffusionOperatorFV.hpp"

#include "cadet/Exceptions.hpp"
#include "BindingModelFactory.hpp"
Expand Down Expand Up @@ -92,16 +93,13 @@ namespace model

paramProvider.pushScope("discretization");

if (paramProvider.exists("SPATIAL_METHOD"))
{
const std::string parSpatialMethod = paramProvider.getString("SPATIAL_METHOD");
if (parSpatialMethod != "DG")
throw InvalidParameterException("Unsupported SPATIAL_METHOD '" + parSpatialMethod + "' for GeneralRateParticle. Only 'DG' is supported for now.");

const std::string parSpatialMethod = paramProvider.getString("SPATIAL_METHOD");
if (parSpatialMethod == "DG")
_parDiffOp = new parts::ParticleDiffusionOperatorDG();
}
else if (parSpatialMethod == "FV")
_parDiffOp = new parts::ParticleDiffusionOperatorFV();
else
_parDiffOp = new parts::ParticleDiffusionOperatorDG();
throw InvalidParameterException("Unsupported SPATIAL_METHOD '" + parSpatialMethod + "' for GeneralRateParticle. Only 'DG' and 'FV' are supported.");

paramProvider.popScope();

Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/model/parts/ParticleDiffusionOperatorDG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ namespace parts
jacCl[0] += static_cast<double>(filmDiff[comp]) * (1.0 - colPorosity) / colPorosity
* _parGeomSurfToVol / static_cast<double>(_parRadius)
* static_cast<double>(parTypeVolFrac[_parTypeIdx + blk * nParType]);
// add Cl on Cp entries (added since these entries are also touched by bulk jacobian)
// add Cl on Cp entries
// row: already at bulk phase. already at current node and component.
// col: go to current particle phase entry.
jacCl[jacCp.row() - jacCl.row()] = -static_cast<double>(filmDiff[comp]) * (1.0 - colPorosity) / colPorosity
Expand All @@ -1615,7 +1615,7 @@ namespace parts
for (int node = _parPolyDeg; node >= 0; node--, jacCp -= strideParNode()) {
// row: already at particle. Already at current node and liquid state.
// col: original entry at outer node.
if (!outliersOnly) // Cp on Cb
if (!outliersOnly) // Cp on Cp
jacCp[entry - jacCp.row()]
+= static_cast<double>(filmDiff[comp]) * 2.0 / static_cast<double>(_deltaR[0]) * _parInvMM[_nParElem - 1](node, _nParNode - 1) * exIntLiftContribution / static_cast<double>(_parPorosity) / static_cast<double>(_poreAccessFactor[comp]);
// row: already at particle. Already at current node and liquid state.
Expand Down
2 changes: 1 addition & 1 deletion src/libcadet/model/parts/ParticleDiffusionOperatorDG.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ namespace parts

/* DG specific operators */

active* _deltaR; //!< equidistant particle element spacing
active* _deltaR; //!< particle element spacing
Eigen::VectorXd _parNodes; //!< Array with positions of nodes in radial reference element for each particle
Eigen::MatrixXd _parPolyDerM; //!< Array with polynomial derivative Matrix for each particle
Eigen::MatrixXd* _minus_InvMM_ST; //!< equals minus inverse mass matrix times transposed stiffness matrix.
Expand Down
Loading
Loading