Skip to content

Commit 20bbb07

Browse files
refactor katz2003 code, modify docs
1 parent 0f45daf commit 20bbb07

File tree

4 files changed

+38
-23
lines changed

4 files changed

+38
-23
lines changed

doc/sphinx/parameters/Boundary_20composition_20model.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This parameter only describes which boundaries have a fixed composition, but not
3535
:name: parameters:Boundary_20composition_20model/List_20of_20model_20names
3636
**Default value:**
3737

38-
**Pattern:** [MultipleSelection ascii data|box|box with lithosphere boundary indicators|function|initial composition|spherical constant ]
38+
**Pattern:** [MultipleSelection ascii data|box|box with lithosphere boundary indicators|function|initial composition|landlab|spherical constant ]
3939

4040
**Documentation:** A comma-separated list of boundary composition models that will be used to initialize the composition. These plugins are loaded in the order given, and modify the existing composition field via the operators listed in ’List of model operators’.
4141

@@ -57,6 +57,8 @@ The format of these functions follows the syntax understood by the muparser libr
5757

5858
Because this class simply takes what the initial composition had described, this class can not know certain pieces of information such as the minimal and maximal composition on the boundary. For operations that require this, for example in post-processing, this boundary composition model must therefore be told what the minimal and maximal values on the boundary are. This is done using parameters set in section “Boundary composition model/Initial composition”.
5959

60+
‘landlab’: A model in which the composition is chosen constant on the sides of a box which are selected by the parameters Left/Right/Top/Bottom/Front/Back composition
61+
6062
‘spherical constant’: A model in which the composition is chosen constant on the inner and outer boundaries of a sphere, spherical shell, chunk or ellipsoidal chunk. Parameters are read from subsection ’Spherical constant’.
6163
::::
6264

@@ -73,7 +75,7 @@ Because this class simply takes what the initial composition had described, this
7375
:name: parameters:Boundary_20composition_20model/Model_20name
7476
**Default value:** unspecified
7577

76-
**Pattern:** [Selection ascii data|box|box with lithosphere boundary indicators|function|initial composition|spherical constant|unspecified ]
78+
**Pattern:** [Selection ascii data|box|box with lithosphere boundary indicators|function|initial composition|landlab|spherical constant|unspecified ]
7779

7880
**Documentation:** Select one of the following models:
7981

@@ -93,6 +95,8 @@ The format of these functions follows the syntax understood by the muparser libr
9395

9496
Because this class simply takes what the initial composition had described, this class can not know certain pieces of information such as the minimal and maximal composition on the boundary. For operations that require this, for example in post-processing, this boundary composition model must therefore be told what the minimal and maximal values on the boundary are. This is done using parameters set in section “Boundary composition model/Initial composition”.
9597

98+
‘landlab’: A model in which the composition is chosen constant on the sides of a box which are selected by the parameters Left/Right/Top/Bottom/Front/Back composition
99+
96100
‘spherical constant’: A model in which the composition is chosen constant on the inner and outer boundaries of a sphere, spherical shell, chunk or ellipsoidal chunk. Parameters are read from subsection ’Spherical constant’.
97101

98102
**Warning**: This parameter provides an old and deprecated way of specifying boundary composition models and shouldn’t be used. Please use ’List of model names’ instead.
@@ -319,6 +323,17 @@ If the function you are describing represents a vector-valued function with mult
319323
**Documentation:** Minimal composition. Units: none.
320324
::::
321325

326+
(parameters:Boundary_20composition_20model/LandLab)=
327+
## **Subsection:** Boundary composition model / LandLab
328+
::::{dropdown} __Parameter:__ {ref}`Dummy variable<parameters:Boundary_20composition_20model/LandLab/Dummy_20variable>`
329+
:name: parameters:Boundary_20composition_20model/LandLab/Dummy_20variable
330+
**Default value:**
331+
332+
**Pattern:** [List of <[Double -MAX_DOUBLE...MAX_DOUBLE (inclusive)]> of length 0...4294967295 (inclusive)]
333+
334+
**Documentation:** A comma separated list of composition boundary values at the left boundary (at minimal $x$-value). This list must have as many entries as there are compositional fields. Units: none.
335+
::::
336+
322337
(parameters:Boundary_20composition_20model/Spherical_20constant)=
323338
## **Subsection:** Boundary composition model / Spherical constant
324339
::::{dropdown} __Parameter:__ {ref}`Inner composition<parameters:Boundary_20composition_20model/Spherical_20constant/Inner_20composition>`

doc/sphinx/parameters/Material_20model.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3821,6 +3821,15 @@ Also note that the fluid reaction time scale has to be larger than or equal to t
38213821
**Documentation:** Lower cutoff for the compaction viscosity. Units: $\text{Pa}\text{s}$.
38223822
::::
38233823

3824+
::::{dropdown} __Parameter:__ {ref}`Minimum weakened viscosity<parameters:Material_20model/Reactive_20Fluid_20Transport_20Model/Minimum_20weakened_20viscosity>`
3825+
:name: parameters:Material_20model/Reactive_20Fluid_20Transport_20Model/Minimum_20weakened_20viscosity
3826+
**Default value:** 1e17
3827+
3828+
**Pattern:** [Double 0...MAX_DOUBLE (inclusive)]
3829+
3830+
**Documentation:** Lower cutoff for the viscosity of the solid phase in the presence of fluids. Units: $\text{Pa}\text{s}$.
3831+
::::
3832+
38243833
::::{dropdown} __Parameter:__ {ref}`Reference fluid density<parameters:Material_20model/Reactive_20Fluid_20Transport_20Model/Reference_20fluid_20density>`
38253834
:name: parameters:Material_20model/Reactive_20Fluid_20Transport_20Model/Reference_20fluid_20density
38263835
**Default value:** 2500

source/material_model/reaction_model/katz2003_mantle_melting.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -344,15 +344,6 @@ namespace aspect
344344
melt_out->compaction_viscosities[i] *= visc_temperature_dependence;
345345
}
346346
}
347-
348-
if (this->include_melt_transport() && in.requests_property(MaterialProperties::viscosity))
349-
{
350-
for (unsigned int i=0; i<in.n_evaluation_points(); ++i)
351-
{
352-
const double porosity = std::min(1.0, std::max(in.composition[i][porosity_idx],0.0));
353-
out.viscosities[i] *= std::exp(- alpha_phi * porosity);
354-
}
355-
}
356347
}
357348

358349

source/material_model/reactive_fluid_transport.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,22 +180,22 @@ namespace aspect
180180
{
181181
base_model->evaluate(in,out);
182182

183-
if (fluid_solid_reaction_scheme != katz2003)
184-
{
185-
const unsigned int porosity_idx = this->introspection().compositional_index_for_name("porosity");
183+
const unsigned int porosity_idx = this->introspection().compositional_index_for_name("porosity");
186184

187-
// Modify the viscosity from the base model based on the presence of fluid.
188-
if (in.requests_property(MaterialProperties::viscosity))
185+
// Modify the viscosity from the base model based on the presence of fluid.
186+
if (in.requests_property(MaterialProperties::viscosity))
187+
{
188+
// Scale the base model viscosity value based on the porosity.
189+
for (unsigned int q=0; q<out.n_evaluation_points(); ++q)
189190
{
190-
// Scale the base model viscosity value based on the porosity.
191-
for (unsigned int q=0; q<out.n_evaluation_points(); ++q)
192-
{
193-
const double porosity = std::max(in.composition[q][porosity_idx],0.0);
194-
const double weakened_viscosity = out.viscosities[q] * (1.0 - porosity) * std::exp(- alpha_phi * porosity);
195-
out.viscosities[q] = std::max(weakened_viscosity, min_weakened_viscosity);
196-
}
191+
const double porosity = std::max(in.composition[q][porosity_idx],0.0);
192+
const double weakened_viscosity = out.viscosities[q] * (1.0 - porosity) * std::exp(- alpha_phi * porosity);
193+
out.viscosities[q] = std::max(weakened_viscosity, min_weakened_viscosity);
197194
}
195+
}
198196

197+
if (fluid_solid_reaction_scheme != katz2003)
198+
{
199199
// Fill the melt outputs if they exist. Note that the MeltOutputs class was originally
200200
// designed for two-phase flow material models in ASPECT that model the flow of melt,
201201
// but can be reused for a geofluid of arbitrary composition.

0 commit comments

Comments
 (0)