Skip to content

Commit 749e3d2

Browse files
committed
Update units to generalized interface (#471)
* all GRM LRMP LRM 1D and 2D units * rename fields to `PORE_DIFFUSION` and `SURFACE_DIFFUSION` * 2D units: rename `COL_DISPERSION` to `COL_DISPERSION_AXIAL` * replace `PARTICLE_TYPE` by transport model bools
1 parent 9820d6f commit 749e3d2

File tree

101 files changed

+3408
-17227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+3408
-17227
lines changed

doc/developer_guide/examples/breakthrough.py

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,43 +26,39 @@
2626
model.root.input.model.unit_001.col_porosity = 0.37 # -
2727
model.root.input.model.unit_001.par_porosity = 0.33 # -
2828
model.root.input.model.unit_001.par_radius = 1e-6 # m
29-
30-
## Transport
29+
30+
## Bulk transport
3131
model.root.input.model.unit_001.col_dispersion = 1e-8 # m^2 / s (interstitial volume)
32-
model.root.input.model.unit_001.film_diffusion = [1e-5] # m / s
33-
model.root.input.model.unit_001.par_diffusion = [1e-10,] # m^2 / s (mobile phase)
34-
model.root.input.model.unit_001.par_surfdiffusion = [0.0,] # m^2 / s (solid phase)
32+
33+
## Particle transport
34+
model.root.input.model.unit_001.particle_type_000.film_diffusion = [1e-5] # m / s
35+
model.root.input.model.unit_001.particle_type_000.pore_diffusion = [1e-10,] # m^2 / s (mobile phase)
36+
model.root.input.model.unit_001.particle_type_000.surface_diffusion = [0.0,] # m^2 / s (solid phase)
3537

3638
## Adsorption
37-
model.root.input.model.unit_001.adsorption_model = 'MULTI_COMPONENT_LANGMUIR'
38-
model.root.input.model.unit_001.nbound = [1]
39-
model.root.input.model.unit_001.adsorption.is_kinetic = True # Kinetic binding
40-
model.root.input.model.unit_001.adsorption.mcl_ka = [1.0,] # m^3 / (mol * s) (mobile phase)
41-
model.root.input.model.unit_001.adsorption.mcl_kd = [1.0,] # 1 / s (desorption)
42-
model.root.input.model.unit_001.adsorption.mcl_qmax = [100.0,] # mol / m^3 (solid phase)
39+
model.root.input.model.unit_001.particle_type_000.adsorption_model = 'MULTI_COMPONENT_LANGMUIR'
40+
model.root.input.model.unit_001.particle_type_000.nbound = [1]
41+
model.root.input.model.unit_001.particle_type_000.adsorption.is_kinetic = True # Kinetic binding
42+
model.root.input.model.unit_001.particle_type_000.adsorption.mcl_ka = [1.0,] # m^3 / (mol * s) (mobile phase)
43+
model.root.input.model.unit_001.particle_type_000.adsorption.mcl_kd = [1.0,] # 1 / s (desorption)
44+
model.root.input.model.unit_001.particle_type_000.adsorption.mcl_qmax = [100.0,] # mol / m^3 (solid phase)
4345

4446
## Initial conditions
4547
model.root.input.model.unit_001.init_c = [0.0,]
46-
model.root.input.model.unit_001.init_q = [0.0,]
48+
model.root.input.model.unit_001.particle_type_000.init_cp = [0.0,]
49+
model.root.input.model.unit_001.particle_type_000.init_cs = [0.0,]
4750

4851
## Discretization
4952
### Grid cells
50-
model.root.input.model.unit_001.discretization.spatial_method = "FV"
51-
model.root.input.model.unit_001.discretization.ncol = 20
52-
model.root.input.model.unit_001.discretization.npar = 5
53-
53+
model.root.input.model.unit_001.discretization.spatial_method = "DG" # "FV" recommended for strong gradients, where DG might oscillate
54+
model.root.input.model.unit_001.discretization.polydeg = 3 # recommended to be increased up to 5 if higher resolution is desired for smooth solutions
55+
model.root.input.model.unit_001.discretization.nelem = 3 # recommended to be increased if higher resolution is desired
56+
model.root.input.model.unit_001.particle_type_000.discretization.spatial_method = "DG"
57+
model.root.input.model.unit_001.particle_type_000.discretization.par_polydeg = 3 # recommended to be increased if higher resolution is desired
58+
model.root.input.model.unit_001.particle_type_000.discretization.par_nelem = 1 # recommended to stay fixed at 1 except for targeted resolution of particle (ie user defined par_disc_type)
5459
### Other options
55-
model.root.input.model.unit_001.discretization.par_disc_type = 'EQUIDISTANT_PAR'
60+
model.root.input.model.unit_001.discretization.particle_type_000.par_disc_type = 'EQUIDISTANT'
5661
model.root.input.model.unit_001.discretization.use_analytic_jacobian = 1
57-
model.root.input.model.unit_001.discretization.reconstruction = 'WENO'
58-
model.root.input.model.unit_001.discretization.gs_type = 1
59-
model.root.input.model.unit_001.discretization.max_krylov = 0
60-
model.root.input.model.unit_001.discretization.max_restarts = 10
61-
model.root.input.model.unit_001.discretization.schur_safety = 1.0e-8
62-
63-
model.root.input.model.unit_001.discretization.weno.boundary_model = 0
64-
model.root.input.model.unit_001.discretization.weno.weno_eps = 1e-10
65-
model.root.input.model.unit_001.discretization.weno.weno_order = 3
6662

6763
## Outlet
6864
model.root.input.model.unit_002.unit_type = 'OUTLET'

doc/interface/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Note that all components of component dependent datasets have to be section depe
131131
* - FILM_DIFFUSION
132132
- ✓
133133
- ✓
134-
* - PAR_DIFFUSION
134+
* - PORE_DIFFUSION
135135
- ✓
136136
- ✓
137137
* - PAR_SURDIFFUSION

doc/interface/parameter_dependencies.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ Currently, the dependence of surface diffusion on the particle liquid salt compo
7878
Group /input/model/unit_XXX
7979
---------------------------
8080

81-
``PAR_SURFDIFFUSION_DEP``
81+
``SURFACE_DIFFUSION_DEP``
8282

83-
Parameter dependence of :math:`\texttt{PAR_SURFDIFFUSION}` on the particle liquid salt component (i.e. component with index 0). Valid dependencies are:
83+
Parameter dependence of :math:`\texttt{SURFACE_DIFFUSION}` on the particle liquid salt component (i.e. component with index 0). Valid dependencies are:
8484

8585
- :math:`\texttt{NONE}` Original parameter is used unmodified.
8686
- :math:`\texttt{LIQUID_SALT_EXPONENTIAL}` Original parameter is modified by exponential law of liquid phase salt concentration.
@@ -93,87 +93,87 @@ Group /input/model/unit_XXX
9393
**Type:** string **Length:** :math:`1 / \texttt{NPARTYPE}`
9494
================ =========================================
9595

96-
``PAR_SURFDIFFUSION_EXPFACTOR``
96+
``SURFACE_DIFFUSION_EXPFACTOR``
9797

9898
Factor :math:`\texttt{p1}` in exponential law particle surface diffusion relation
9999
:math:`D_{s, i, m} = \tilde{D}_{s, i, m} p_{1, i, m} exp \left(p_{2, i, m} c_{0}^{p} \right)`, where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient.
100-
Only required if :math:`\texttt{PAR_SURFDIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_EXPONENTIAL}`.
100+
Only required if :math:`\texttt{SURFACE_DIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_EXPONENTIAL}`.
101101

102102
================ ========================= ===================================
103103
**Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NBOUND}`
104104
================ ========================= ===================================
105105

106-
``PAR_SURFDIFFUSION_EXPFACTOR``
106+
``SURFACE_DIFFUSION_EXPFACTOR``
107107
:math:`D_{s, i, m} = \tilde{D}_{s, i, m} \left[ p_{4, i, m} \left( k_{i, m} \left( c_{0}^{p} \right) \right)^{p_{5, i, m}} p_{6, i, m} exp \left( p_{7, i, m} k_{i, m} \left( c_{0}^{p} \right) \right) \right]`
108108
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient and
109109
:math:`k_{i, m} \left( c_{0}^{p} \right) = p_{1, i, m}\left( c_{0}^{p} \right)^{p_{2, i, m}} + p_{3, i, m}`.
110-
Only required if :math:`\texttt{PAR_SURFDIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_COLLOIDAL_AFFINITY}`.
110+
Only required if :math:`\texttt{SURFACE_DIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_COLLOIDAL_AFFINITY}`.
111111

112112
================ ============================= ===================================
113113
**Type:** double **Range:** :math:`\mathbb{R}` **Length:** :math:`\texttt{NBOUND}`
114114
================ ============================= ===================================
115115

116-
``PAR_SURFDIFFUSION_EXPARGMULT``
116+
``SURFACE_DIFFUSION_EXPARGMULT``
117117

118118
Factor :math:`\texttt{p2}` in exponential law particle surface diffusion relation
119119
:math:`D_{s, i, m} = \tilde{D}_{s, i, m} p_{1, i, m} exp \left(p_{2, i, m} c_{0}^{p} \right)`
120-
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient. Only required if :math:`\texttt{PAR_SURFDIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_EXPONENTIAL}`.
120+
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient. Only required if :math:`\texttt{SURFACE_DIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_EXPONENTIAL}`.
121121

122122
================ ============================= ===================================
123123
**Type:** double **Range:** :math:`\mathbb{R}` **Length:** :math:`\texttt{NBOUND}`
124124
================ ============================= ===================================
125125

126-
``PAR_SURFDIFFUSION_POWFACTOR``
126+
``SURFACE_DIFFUSION_POWFACTOR``
127127

128128
Factor :math:`\texttt{p1}` in power law particle surface diffusion relation
129129
:math:`D_{s, i, m} = \tilde{D}_{s, i, m} p_{1, i, m} \left( c_{0}^{p} \right)^{p_{2, i, m}}`
130-
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient. Only required if :math:`\texttt{PAR_SURFDIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_POWER}`.
130+
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient. Only required if :math:`\texttt{SURFACE_DIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_POWER}`.
131131

132132
================ ========================= ===================================
133133
**Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NBOUND}`
134134
================ ========================= ===================================
135135

136-
``PAR_SURFDIFFUSION_POWEXP``
136+
``SURFACE_DIFFUSION_POWEXP``
137137

138138
Fjactor :math:`\texttt{p2}` in power law particle surface diffusion relation
139139
:math:`D_{s, i, m} = \tilde{D}_{s, i, m} p_{1, i, m} \left( c_{0}^{p} \right)^{p_{2, i, m}}`
140-
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient. Only required if :math:`\texttt{PAR_SURFDIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_POWER}`.
140+
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient. Only required if :math:`\texttt{SURFACE_DIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_POWER}`.
141141

142142
================ ============================= ===================================
143143
**Type:** double **Range:** :math:`\mathbb{R}` **Length:** :math:`\texttt{NBOUND}`
144144
================ ============================= ===================================
145145

146-
``PAR_SURFDIFFUSION_LOGKEQFACTOR``
146+
``SURFACE_DIFFUSION_LOGKEQFACTOR``
147147

148148
Factor :math:`\texttt{p1}` in colloidal affinity law particle surface diffusion relation
149149
:math:`D_{s, i, m} = \tilde{D}_{s, i, m} \left[ p_{4, i, m} \left( k_{i, m} \left( c_{0}^{p} \right) \right)^{p_{5, i, m}} p_{6, i, m} exp \left( p_{7, i, m} k_{i, m} \left( c_{0}^{p} \right) \right) \right]`
150150
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient and
151151
:math:`k_{i, m} \left( c_{0}^{p} \right) = p_{1, i, m}\left( c_{0}^{p} \right)^{p_{2, i, m}} + p_{3, i, m}`.
152-
Only required if :math:`\texttt{PAR_SURFDIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_COLLOIDAL_AFFINITY}`.
152+
Only required if :math:`\texttt{SURFACE_DIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_COLLOIDAL_AFFINITY}`.
153153

154154
================ ============================= ===================================
155155
**Type:** double **Range:** :math:`\mathbb{R}` **Length:** :math:`\texttt{NBOUND}`
156156
================ ============================= ===================================
157157

158-
``PAR_SURFDIFFUSION_LOGKEQEXP``
158+
``SURFACE_DIFFUSION_LOGKEQEXP``
159159

160160
Factor :math:`\texttt{p2}` in colloidal affinity law particle surface diffusion relation
161161
:math:`D_{s, i, m} = \tilde{D}_{s, i, m} \left[ p_{4, i, m} \left( k_{i, m} \left( c_{0}^{p} \right) \right)^{p_{5, i, m}} p_{6, i, m} exp \left( p_{7, i, m} k_{i, m} \left( c_{0}^{p} \right) \right) \right]`
162162
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient and
163163
:math:`k_{i, m} \left( c_{0}^{p} \right) = p_{1, i, m}\left( c_{0}^{p} \right)^{p_{2, i, m}} + p_{3, i, m}`.
164-
Only required if :math:`\texttt{PAR_SURFDIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_COLLOIDAL_AFFINITY}`.
164+
Only required if :math:`\texttt{SURFACE_DIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_COLLOIDAL_AFFINITY}`.
165165

166166
================ ============================= ===================================
167167
**Type:** double **Range:** :math:`\mathbb{R}` **Length:** :math:`\texttt{NBOUND}`
168168
================ ============================= ===================================
169169

170-
``PAR_SURFDIFFUSION_LOGKEQCONST``
170+
``SURFACE_DIFFUSION_LOGKEQCONST``
171171

172172
Factor :math:`\texttt{p3}` in colloidal affinity law particle surface diffusion relation
173173
:math:`D_{s, i, m} = \tilde{D}_{s, i, m} \left[ p_{4, i, m} \left( k_{i, m} \left( c_{0}^{p} \right) \right)^{p_{5, i, m}} p_{6, i, m} exp \left( p_{7, i, m} k_{i, m} \left( c_{0}^{p} \right) \right) \right]`
174174
where :math:`\tilde{D}_{s, i, m}` is the original surface diffusion coefficient and
175175
:math:`k_{i, m} \left( c_{0}^{p} \right) = p_{1, i, m}\left( c_{0}^{p} \right)^{p_{2, i, m}} + p_{3, i, m}`.
176-
Only required if :math:`\texttt{PAR_SURFDIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_COLLOIDAL_AFFINITY}`.
176+
Only required if :math:`\texttt{SURFACE_DIFFUSION_DEP}` is :math:`\texttt{LIQUID_SALT_COLLOIDAL_AFFINITY}`.
177177

178178
================ ============================= ===================================
179179
**Type:** double **Range:** :math:`\mathbb{R}` **Length:** :math:`\texttt{NBOUND}`

doc/interface/sensitivities.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Group /input/sensitivity/param_XXX
5555

5656
``SENS_PARTYPE``
5757

58-
Particle type index (:math:`-1` if parameter is independent of particle types, see the multiplexing of the corresponding parameter, e.g. `PAR_DIFFUSION_MULTIPLEX`)
58+
Particle type index (:math:`-1` if parameter is independent of particle types, see the multiplexing of the corresponding parameter, e.g. `PORE_DIFFUSION_MULTIPLEX`)
5959

6060
============= ========================== ===========================
6161
**Type:** int **Range:** :math:`\geq -1` **Length:** :math:`\geq 1`

0 commit comments

Comments
 (0)