Skip to content

Commit

Permalink
Move PAR_GEOM from discretization to unit_XXX
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreue16 committed Mar 22, 2024
1 parent cbaa269 commit 2ba7fa7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 26 deletions.
16 changes: 8 additions & 8 deletions doc/interface/unit_operations/2d_general_rate_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ For information on model equations, refer to :ref:`2d_general_rate_model_model`.
**Type:** int **Range:** :math:`\geq 1` **Length:** 1
============= ========================= =============

``PAR_GEOM``

Specifies the particle geometry for all or each particle type. Valid values are :math:`\texttt{SPHERE}`, :math:`\texttt{CYLINDER}`, :math:`\texttt{SLAB}`. Optional, defaults to :math:`\texttt{SPHERE}`.

================ =================================================
**Type:** string **Length:** :math:`1` / :math:`\texttt{NPARTYPE}`
================ =================================================

``PAR_TYPE_VOLFRAC``

Volume fractions of the particle types. The volume fractions can be set homogeneous or individually along both axes. For each cell, the volume fractions have to sum to 1. In case of a spatially inhomogeneous setting, the :math:`\texttt{SENS_SECTION}` field is used for indexing the axial cell and the :math:`\texttt{SENS_REACTION}` field is used for indexing the radial cell when specifying parameter sensitivities. This field is optional in case of only one particle type.
Expand Down Expand Up @@ -392,14 +400,6 @@ Group /input/model/unit_XXX/discretization - UNIT_TYPE - GENERAL_RATE_MODEL_2D
**Type:** int **Range:** :math:`\geq 1` **Length:** :math:`1 / \texttt{NPARTYPE}`
============= ========================= =========================================

``PAR_GEOM``

Specifies the particle geometry for all or each particle type. Valid values are :math:`\texttt{SPHERE}`, :math:`\texttt{CYLINDER}`, :math:`\texttt{SLAB}`. Optional, defaults to :math:`\texttt{SPHERE}`.

================ =================================================
**Type:** string **Length:** :math:`1` / :math:`\texttt{NPARTYPE}`
================ =================================================

``RADIAL_DISC_TYPE``

Specifies the radial discretization scheme. Valid values are :math:`\texttt{EQUIDISTANT}`, :math:`\texttt{EQUIVOLUME}`, and :math:`\texttt{USER_DEFINED}`.
Expand Down
16 changes: 8 additions & 8 deletions doc/interface/unit_operations/general_rate_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,14 @@ For information on model equations, refer to :ref:`general_rate_model_model`.
**Type:** int **Range:** :math:`\geq 1` **Length:** 1
============= ========================= =============

``PAR_GEOM``

Specifies the particle geometry for all or each particle type. Valid values are :math:`\texttt{SPHERE}`, :math:`\texttt{CYLINDER}`, :math:`\texttt{SLAB}`. Optional, defaults to :math:`\texttt{SPHERE}`.

================ =================================================
**Type:** string **Length:** :math:`1` / :math:`\texttt{NPARTYPE}`
================ =================================================

``PAR_TYPE_VOLFRAC``

Volume fractions of the particle types. The volume fractions can be set for all axial cells together or for each individual axial cell. For each cell, the volume fractions have to sum to :math:`1`. In case of a spatially inhomogeneous setting, the data is expected in cell-major ordering and the :math:`\texttt{SENS_SECTION}` field is used for indexing the axial cell when specifying parameter sensitivities. This field is optional in case of only one particle type.
Expand Down Expand Up @@ -466,14 +474,6 @@ Group /input/model/unit_XXX/discretization - UNIT_TYPE - GENERAL_RATE_MODEL
**Type:** int **Range:** :math:`\geq 1` **Length:** :math:`1` / :math:`\texttt{NPARTYPE}`
============= ========================= =================================================

``PAR_GEOM``

Specifies the particle geometry for all or each particle type. Valid values are :math:`\texttt{SPHERE}`, :math:`\texttt{CYLINDER}`, :math:`\texttt{SLAB}`. Optional, defaults to :math:`\texttt{SPHERE}`.

================ =================================================
**Type:** string **Length:** :math:`1` / :math:`\texttt{NPARTYPE}`
================ =================================================

``PAR_DISC_TYPE``

Specifies the discretization scheme inside the particles for all or each particle type. Valid values are :math:`\texttt{EQUIDISTANT_PAR}`, :math:`\texttt{EQUIVOLUME_PAR}`, and :math:`\texttt{USER_DEFINED_PAR}`.
Expand Down
16 changes: 8 additions & 8 deletions doc/interface/unit_operations/lumped_rate_model_with_pores.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ For information on model equations, refer to :ref:`lumped_rate_model_with_pores_
**Type:** int **Range:** :math:`\geq 1` **Length:** 1
============= ========================= =============

``PAR_GEOM``

Specifies the particle geometry for all or each particle type. Valid values are :math:`\texttt{SPHERE}`, :math:`\texttt{CYLINDER}`, :math:`\texttt{SLAB}`. Optional, defaults to :math:`\texttt{SPHERE}`.

================ =================================================
**Type:** string **Length:** :math:`1` / :math:`\texttt{NPARTYPE}`
================ =================================================

``PAR_TYPE_VOLFRAC``

Volume fractions of the particle types. The volume fractions can be set for all axial cells together or for each individual axial cell. For each cell, the volume fractions have to sum to :math:`1`. In case of a spatially inhomogeneous setting, the data is expected in cell-major ordering and the :math:`\texttt{SENS_SECTION}` field is used for indexing the axial cell when specifying parameter sensitivities. This field is optional in case of only one particle type.
Expand All @@ -251,14 +259,6 @@ Group /input/model/unit_XXX/discretization - UNIT_TYPE = LUMPED_RATE_MODEL_WITH_
**Type:** int **Range:** :math:`\geq 1` **Length:** 1
============= ========================= =============

``PAR_GEOM``

Specifies the particle geometry for all or each particle type. Valid values are :math:`\texttt{SPHERE}`, :math:`\texttt{CYLINDER}`, :math:`\texttt{SLAB}`. Optional, defaults to :math:`\texttt{SPHERE}`.

================ =================================================
**Type:** string **Length:** :math:`1` / :math:`\texttt{NPARTYPE}`
================ =================================================

``USE_ANALYTIC_JACOBIAN``

Determines whether analytically computed Jacobian matrix (faster) is used (value is :math:`1`) instead of Jacobians generated by algorithmic differentiation (slower, value is :math:`0`)
Expand Down
2 changes: 2 additions & 0 deletions src/libcadet/model/GeneralRateModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ bool GeneralRateModel::configureModelDiscretization(IParameterProvider& paramPro

// Read particle geometry and default to "SPHERICAL"
_parGeomSurfToVol = std::vector<double>(_disc.nParType, SurfVolRatioSphere);
paramProvider.popScope();
if (paramProvider.exists("PAR_GEOM"))
{
std::vector<std::string> pg = paramProvider.getStringArray("PAR_GEOM");
Expand All @@ -296,6 +297,7 @@ bool GeneralRateModel::configureModelDiscretization(IParameterProvider& paramPro
throw InvalidParameterException("Unknown particle geometry type \"" + pg[i] + "\" at index " + std::to_string(i) + " of field PAR_GEOM");
}
}
paramProvider.pushScope("discretization");

if (paramProvider.exists("PAR_DISC_VECTOR"))
{
Expand Down
2 changes: 2 additions & 0 deletions src/libcadet/model/GeneralRateModel2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ bool GeneralRateModel2D::configureModelDiscretization(IParameterProvider& paramP

// Read particle geometry and default to "SPHERICAL"
_parGeomSurfToVol = std::vector<double>(_disc.nParType, SurfVolRatioSphere);
paramProvider.popScope();
if (paramProvider.exists("PAR_GEOM"))
{
std::vector<std::string> pg = paramProvider.getStringArray("PAR_GEOM");
Expand All @@ -546,6 +547,7 @@ bool GeneralRateModel2D::configureModelDiscretization(IParameterProvider& paramP
throw InvalidParameterException("Unknown particle geometry type \"" + pg[i] + "\" at index " + std::to_string(i) + " of field PAR_GEOM");
}
}
paramProvider.pushScope("discretization");

if (paramProvider.exists("PAR_DISC_VECTOR"))
{
Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/model/LumpedRateModelWithPores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ bool LumpedRateModelWithPores::configureModelDiscretization(IParameterProvider&
// Create nonlinear solver for consistent initialization
configureNonlinearSolver(paramProvider);

paramProvider.popScope();

// Read particle geometry and default to "SPHERICAL"
_parGeomSurfToVol = std::vector<double>(_disc.nParType, SurfVolRatioSphere);
if (paramProvider.exists("PAR_GEOM"))
Expand All @@ -251,8 +253,6 @@ bool LumpedRateModelWithPores::configureModelDiscretization(IParameterProvider&
}
}

paramProvider.popScope();

const bool transportSuccess = _convDispOp.configureModelDiscretization(paramProvider, _disc.nComp, _disc.nCol);

// Allocate memory
Expand Down

0 comments on commit 2ba7fa7

Please sign in to comment.