Skip to content

Commit 614225d

Browse files
refactor katz2003 code, modify docs
1 parent 0f45daf commit 614225d

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

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)