Skip to content

Commit 973c747

Browse files
committed
2D units: rename COL_DISPERSION to COL_DISPERSION_AXIAL
1 parent 567e4fa commit 973c747

21 files changed

+265
-243
lines changed

doc/interface/unit_operations/2d_general_rate_model.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,28 @@ For information on model equations, refer to :ref:`2d_general_rate_model_model`.
113113
**Type:** double **Range:** :math:`\mathbb{R}` **Length:** :math:`\texttt{NDOF} / 2\texttt{NDOF}`
114114
================ ============================= ==================================================
115115

116-
``COL_DISPERSION``
116+
``COL_DISPERSION_AXIAL``
117117

118118
Axial dispersion coefficient. In case of a spatially inhomogeneous setting, the :math:`\texttt{SENS_PARTYPE}` field is used for indexing the radial zone when specifying parameter sensitivities.
119119

120120
**Unit:** :math:`\mathrm{m}_{\mathrm{IV}}^{2}\,\mathrm{s}^{-1}`
121121

122-
================ ========================= =========================================================
123-
**Type:** double **Range:** :math:`\geq 0` **Length:** see :math:`\texttt{COL_DISPERSION_MULTIPLEX}`
124-
================ ========================= =========================================================
122+
================ ========================= ===============================================================
123+
**Type:** double **Range:** :math:`\geq 0` **Length:** see :math:`\texttt{COL_DISPERSION_AXIAL_MULTIPLEX}`
124+
================ ========================= ===============================================================
125125

126-
``COL_DISPERSION_MULTIPLEX``
126+
``COL_DISPERSION_AXIAL_MULTIPLEX``
127127

128-
Multiplexing mode of :math:`\texttt{COL_DISPERSION}`. Determines whether :math:`\texttt{COL_DISPERSION}` is treated as component-, radial-, and/or section-independent. This field is optional. When left out, multiplexing behavior is inferred from the length of :math:`\texttt{COL_DISPERSION}`. Valid modes are:
128+
Multiplexing mode of :math:`\texttt{COL_DISPERSION_AXIAL}`. Determines whether :math:`\texttt{COL_DISPERSION_AXIAL}` is treated as component-, radial-, and/or section-independent. This field is optional. When left out, multiplexing behavior is inferred from the length of :math:`\texttt{COL_DISPERSION_AXIAL}`. Valid modes are:
129129

130-
0. Component-independent, radial-independent, section-independent; length of :math:`\texttt{COL_DISPERSION}` is 1
131-
1. Component-independent, radial-dependent, section-independent; length of :math:`\texttt{COL_DISPERSION}` is :math:`\texttt{NRAD}`
132-
2. Component-dependent, radial-independent, section-independent; length of :math:`\texttt{COL_DISPERSION}` is :math:`\texttt{NCOMP}`
133-
3. Component-dependent, radial-dependent, section-independent; length of :math:`\texttt{COL_DISPERSION}` is :math:`\texttt{NCOMP} \cdot \texttt{NRAD}`; ordering is radial-major
134-
4. Component-independent, radial-independent, section-dependent; length of :math:`\texttt{COL_DISPERSION}` is :math:`\texttt{NSEC}`
135-
5. Component-independent, radial-dependent, section-dependent; length of :math:`\texttt{COL_DISPERSION}` is :math:`\texttt{NRAD} \cdot \texttt{NSEC}`; ordering is section-major
136-
6. Component-dependent, radial-independent, section-independent; length of :math:`\texttt{COL_DISPERSION}` is :math:`\texttt{NCOMP} \cdot \texttt{NSEC}`; ordering is section-major
137-
7. Component-dependent, radial-dependent, section-dependent; length of :math:`\texttt{COL_DISPERSION}` is :math:`\texttt{NCOMP} \cdot \texttt{NRAD} \cdot \texttt{NSEC}`; ordering is section-radial-major
130+
0. Component-independent, radial-independent, section-independent; length of :math:`\texttt{COL_DISPERSION_AXIAL}` is 1
131+
1. Component-independent, radial-dependent, section-independent; length of :math:`\texttt{COL_DISPERSION_AXIAL}` is :math:`\texttt{NRAD}`
132+
2. Component-dependent, radial-independent, section-independent; length of :math:`\texttt{COL_DISPERSION_AXIAL}` is :math:`\texttt{NCOMP}`
133+
3. Component-dependent, radial-dependent, section-independent; length of :math:`\texttt{COL_DISPERSION_AXIAL}` is :math:`\texttt{NCOMP} \cdot \texttt{NRAD}`; ordering is radial-major
134+
4. Component-independent, radial-independent, section-dependent; length of :math:`\texttt{COL_DISPERSION_AXIAL}` is :math:`\texttt{NSEC}`
135+
5. Component-independent, radial-dependent, section-dependent; length of :math:`\texttt{COL_DISPERSION_AXIAL}` is :math:`\texttt{NRAD} \cdot \texttt{NSEC}`; ordering is section-major
136+
6. Component-dependent, radial-independent, section-independent; length of :math:`\texttt{COL_DISPERSION_AXIAL}` is :math:`\texttt{NCOMP} \cdot \texttt{NSEC}`; ordering is section-major
137+
7. Component-dependent, radial-dependent, section-dependent; length of :math:`\texttt{COL_DISPERSION_AXIAL}` is :math:`\texttt{NCOMP} \cdot \texttt{NRAD} \cdot \texttt{NSEC}`; ordering is section-radial-major
138138

139139
============= =================================== =============
140140
**Type:** int **Range:** :math:`\{0, \dots, 7 \}` **Length:** 1

src/libcadet/model/parts/TwoDimensionalConvectionDispersionOperator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ bool TwoDimensionalConvectionDispersionOperator::configure(UnitOpIdx unitOpIdx,
871871

872872
_dir = std::vector<int>(_nRad, 1);
873873

874-
_axialDispersionMode = readAndRegisterMultiplexParam(paramProvider, parameters, _axialDispersion, "COL_DISPERSION", _nComp, _nRad, unitOpIdx);
874+
_axialDispersionMode = readAndRegisterMultiplexParam(paramProvider, parameters, _axialDispersion, "COL_DISPERSION_AXIAL", _nComp, _nRad, unitOpIdx);
875875
_radialDispersionMode = readAndRegisterMultiplexParam(paramProvider, parameters, _radialDispersion, "COL_DISPERSION_RADIAL", _nComp, _nRad, unitOpIdx);
876876

877877
// Add parameters to map
@@ -1362,7 +1362,7 @@ bool TwoDimensionalConvectionDispersionOperator::setParameter(const ParameterId&
13621362
}
13631363
}
13641364

1365-
const bool ad = multiplexParameterValue(pId, hashString("COL_DISPERSION"), _axialDispersionMode, _axialDispersion, _nComp, _nRad, value, nullptr);
1365+
const bool ad = multiplexParameterValue(pId, hashString("COL_DISPERSION_AXIAL"), _axialDispersionMode, _axialDispersion, _nComp, _nRad, value, nullptr);
13661366
if (ad)
13671367
return true;
13681368

@@ -1408,7 +1408,7 @@ bool TwoDimensionalConvectionDispersionOperator::setSensitiveParameterValue(cons
14081408
}
14091409
}
14101410

1411-
const bool ad = multiplexParameterValue(pId, hashString("COL_DISPERSION"), _axialDispersionMode, _axialDispersion, _nComp, _nRad, value, &sensParams);
1411+
const bool ad = multiplexParameterValue(pId, hashString("COL_DISPERSION_AXIAL"), _axialDispersionMode, _axialDispersion, _nComp, _nRad, value, &sensParams);
14121412
if (ad)
14131413
return true;
14141414

@@ -1455,7 +1455,7 @@ bool TwoDimensionalConvectionDispersionOperator::setSensitiveParameter(std::unor
14551455
}
14561456
}
14571457

1458-
const bool ad = multiplexParameterAD(pId, hashString("COL_DISPERSION"), _axialDispersionMode, _axialDispersion, _nComp, _nRad, adDirection, adValue, sensParams);
1458+
const bool ad = multiplexParameterAD(pId, hashString("COL_DISPERSION_AXIAL"), _axialDispersionMode, _axialDispersion, _nComp, _nRad, adDirection, adValue, sensParams);
14591459
if (ad)
14601460
return true;
14611461

src/libcadet/model/parts/TwoDimensionalConvectionDispersionOperatorDG.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ bool TwoDimensionalConvectionDispersionOperatorDG::configure(UnitOpIdx unitOpIdx
744744

745745
_dir = std::vector<int>(_radNElem, 1);
746746

747-
_axialDispersionMode = readAndRegisterMultiplexParam(paramProvider, parameters, _axialDispersion, "COL_DISPERSION", _nComp, _radNElem, unitOpIdx);
747+
_axialDispersionMode = readAndRegisterMultiplexParam(paramProvider, parameters, _axialDispersion, "COL_DISPERSION_AXIAL", _nComp, _radNElem, unitOpIdx);
748748
_radialDispersionMode = readAndRegisterMultiplexParam(paramProvider, parameters, _radialDispersion, "COL_DISPERSION_RADIAL", _nComp, _radNElem, unitOpIdx);
749749

750750
// Add parameters to map
@@ -1857,7 +1857,7 @@ bool TwoDimensionalConvectionDispersionOperatorDG::setParameter(const ParameterI
18571857
}
18581858
}
18591859

1860-
const bool ad = multiplexParameterValue(pId, hashString("COL_DISPERSION"), _axialDispersionMode, _axialDispersion, _nComp, _radNElem, value, nullptr);
1860+
const bool ad = multiplexParameterValue(pId, hashString("COL_DISPERSION_AXIAL"), _axialDispersionMode, _axialDispersion, _nComp, _radNElem, value, nullptr);
18611861
if (ad)
18621862
return true;
18631863

@@ -1903,7 +1903,7 @@ bool TwoDimensionalConvectionDispersionOperatorDG::setSensitiveParameterValue(co
19031903
}
19041904
}
19051905

1906-
const bool ad = multiplexParameterValue(pId, hashString("COL_DISPERSION"), _axialDispersionMode, _axialDispersion, _nComp, _radNElem, value, &sensParams);
1906+
const bool ad = multiplexParameterValue(pId, hashString("COL_DISPERSION_AXIAL"), _axialDispersionMode, _axialDispersion, _nComp, _radNElem, value, &sensParams);
19071907
if (ad)
19081908
return true;
19091909

@@ -1950,7 +1950,7 @@ bool TwoDimensionalConvectionDispersionOperatorDG::setSensitiveParameter(std::un
19501950
}
19511951
}
19521952

1953-
const bool ad = multiplexParameterAD(pId, hashString("COL_DISPERSION"), _axialDispersionMode, _axialDispersion, _nComp, _radNElem, adDirection, adValue, sensParams);
1953+
const bool ad = multiplexParameterAD(pId, hashString("COL_DISPERSION_AXIAL"), _axialDispersionMode, _axialDispersion, _nComp, _radNElem, adDirection, adValue, sensParams);
19541954
if (ad)
19551955
return true;
19561956

test/JsonTestModels.cpp

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,13 @@ json createColumnWithSMAJson(const std::string& uoType, const std::string& spati
6060
uoType;
6161
config["NCOMP"] = 4;
6262
config["NPARTYPE"] = 1;
63-
config["COL_DISPERSION"] = 5.75e-8;
64-
config["COL_DISPERSION_RADIAL"] = 1e-6;
65-
63+
if (uoType.find("_2D") != std::string::npos || uoType.find("2D_") != std::string::npos)
64+
{
65+
config["COL_DISPERSION_RADIAL"] = 1e-6;
66+
config["COL_DISPERSION_AXIAL"] = 5.75e-8;
67+
}
68+
else
69+
config["COL_DISPERSION"] = 5.75e-8;
6670
particle["FILM_DIFFUSION"] = { 6.9e-6, 6.9e-6, 6.9e-6, 6.9e-6 };
6771
particle["PORE_DIFFUSION"] = { 7e-10, 6.07e-11, 6.07e-11, 6.07e-11 };
6872
particle["SURFACE_DIFFUSION"] = { 0.0, 0.0, 0.0, 0.0 };
@@ -270,8 +274,13 @@ json createColumn2ParType1GeneralRate1HomoParticleBothWithTwoCompLinearJson(cons
270274
config["NCOMP"] = 2;
271275
config["NPARTYPE"] = 2;
272276
config["PAR_TYPE_VOLFRAC"] = { 0.6, 0.4 };
273-
config["COL_DISPERSION"] = 5.75e-8;
274-
config["COL_DISPERSION_RADIAL"] = 1e-6;
277+
if (uoType.find("_2D") != std::string::npos || uoType.find("2D_") != std::string::npos)
278+
{
279+
config["COL_DISPERSION_RADIAL"] = 1e-6;
280+
config["COL_DISPERSION_AXIAL"] = 5.75e-8;
281+
}
282+
else
283+
config["COL_DISPERSION"] = 5.75e-8;
275284

276285
if (uoType == "MULTI_CHANNEL_TRANSPORT")
277286
config["NCHANNEL"] = 3;
@@ -405,8 +414,13 @@ json createColumnWithTwoCompLinearJson(const std::string& uoType, const std::str
405414
uoType;
406415
config["NCOMP"] = 2;
407416
config["NPARTYPE"] = 1;
408-
config["COL_DISPERSION"] = 5.75e-8;
409-
config["COL_DISPERSION_RADIAL"] = 1e-6;
417+
if (uoType.find("_2D") != std::string::npos || uoType.find("2D_") != std::string::npos)
418+
{
419+
config["COL_DISPERSION_RADIAL"] = 1e-6;
420+
config["COL_DISPERSION_AXIAL"] = 5.75e-8;
421+
}
422+
else
423+
config["COL_DISPERSION"] = 5.75e-8;
410424
particle["FILM_DIFFUSION"] = { 6.9e-6, 6.9e-6 };
411425
particle["PORE_DIFFUSION"] = { 7e-10, 6.07e-11 };
412426
particle["SURFACE_DIFFUSION"] = { 1e-10, 5e-11 };
@@ -782,9 +796,13 @@ cadet::JsonParameterProvider createPulseInjectionColumn(const std::string& uoTyp
782796
uoType;
783797
grm["NCOMP"] = 1;
784798
grm["NPARTYPE"] = 1;
785-
grm["COL_DISPERSION"] = 5.75e-8;
786-
grm["COL_DISPERSION_MULTIPLEX"] = 0;
787-
grm["COL_DISPERSION_RADIAL"] = 1e-6;
799+
if (uoType.find("_2D") != std::string::npos || uoType.find("2D_") != std::string::npos)
800+
{
801+
grm["COL_DISPERSION_RADIAL"] = 1e-6;
802+
grm["COL_DISPERSION_AXIAL"] = 5.75e-8;
803+
}
804+
else
805+
grm["COL_DISPERSION"] = 5.75e-8;
788806
particle["FILM_DIFFUSION"] = { 6.9e-6 };
789807
particle["PORE_DIFFUSION"] = { 7e-10 };
790808
particle["SURFACE_DIFFUSION"] = { 0.0 };
@@ -1088,9 +1106,13 @@ json createLinearBenchmarkColumnJson(bool dynamicBinding, bool nonBinding, const
10881106
uoType;
10891107
grm["NCOMP"] = 1;
10901108
grm["NPARTYPE"] = 1;
1091-
grm["COL_DISPERSION"] = 0.002 / (100.0 * 100.0 * 60.0);
1092-
grm["COL_DISPERSION_MULTIPLEX"] = 0;
1093-
grm["COL_DISPERSION_RADIAL"] = 1e-6;
1109+
if (uoType.find("_2D") != std::string::npos || uoType.find("2D_") != std::string::npos)
1110+
{
1111+
grm["COL_DISPERSION_RADIAL"] = 1e-6;
1112+
grm["COL_DISPERSION_AXIAL"] = 0.002 / (100.0 * 100.0 * 60.0);
1113+
}
1114+
else
1115+
grm["COL_DISPERSION"] = 0.002 / (100.0 * 100.0 * 60.0);
10941116
particle["FILM_DIFFUSION"] = { 0.01 / (100.0 * 60.0) };
10951117
particle["PORE_DIFFUSION"] = { 3.003e-6 };
10961118
particle["SURFACE_DIFFUSION"] = { 0.0 };

test/data/model_COL2D_DPF3Zone_noFilmDiff_1Comp_benchmark1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
"SCHUR_SAFETY": 1e-08
353353
},
354354
"unit_000": {
355-
"COL_DISPERSION": 5.75e-08,
355+
"COL_DISPERSION_AXIAL": 5.75e-08,
356356
"COL_DISPERSION_RADIAL": 5e-08,
357357
"COL_LENGTH": 0.014,
358358
"COL_POROSITY": 0.37,

test/data/model_COL2D_DPF_1comp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"SCHUR_SAFETY": 1e-08
102102
},
103103
"unit_000": {
104-
"COL_DISPERSION": [ 1e-08, 2e-08, 3e-08, 4e-08, 5e-08, 6e-08 ],
104+
"COL_DISPERSION_AXIAL": [ 1e-08, 2e-08, 3e-08, 4e-08, 5e-08, 6e-08 ],
105105
"COL_DISPERSION_RADIAL": [ 1e-08, 2e-08, 3e-08, 4e-08, 5e-08, 6e-08 ],
106106
"COL_LENGTH": 0.014,
107107
"COL_POROSITY": [ 0.31, 0.33, 0.35, 0.37, 0.38, 0.39 ],

0 commit comments

Comments
 (0)