Skip to content

Commit b7d8bd2

Browse files
authored
Merge pull request #6366 from danieldouglas92/correctly_compute_mass_fractions_tian
Correctly Compute Reactions in the Reactive Fluid Transport Model
2 parents 72fb4d1 + 46aeca6 commit b7d8bd2

File tree

44 files changed

+934
-590
lines changed

Some content is hidden

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

44 files changed

+934
-590
lines changed

benchmarks/solubility/plugin/solubility.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,14 @@ namespace aspect
7272
* @param in Object that contains the current conditions.
7373
* @param melt_fractions Vector of doubles that is filled with the
7474
* allowable free fluid fraction for each given input conditions.
75+
* @param out Optional pointer to the material properties provided by the
76+
* material model. By default, this variable is a nullptr. If the melt
77+
* fractions depend on material model properties, then this parameter
78+
* must be set to a valid pointer to a MaterialModelOutputs object.
7579
*/
7680
void melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
77-
std::vector<double> &melt_fractions) const override;
81+
std::vector<double> &melt_fractions,
82+
const MaterialModel::MaterialModelOutputs<dim> *out = nullptr) const override;
7883

7984
double reference_darcy_coefficient () const override;
8085

@@ -357,7 +362,8 @@ namespace aspect
357362
void
358363
Volatiles<dim>::
359364
melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
360-
std::vector<double> &melt_fractions) const
365+
std::vector<double> &melt_fractions,
366+
const MaterialModel::MaterialModelOutputs<dim> *) const
361367
{
362368
for (unsigned int q=0; q<in.n_evaluation_points(); ++q)
363369
{

cookbooks/tian_parameterization_kinematic_slab/coupled-two-phase-tian-parameterization-kinematic-slab.prm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ subsection Solver parameters
6161
set Linear solver tolerance = 1e-10
6262
set Number of cheap Stokes solver steps = 1000
6363
end
64+
subsection Operator splitting parameters
65+
set Reaction solver type = fixed step
66+
set Reaction time step = 10
67+
end
6468
end
6569

6670
# Initialize the compositional fields. When using the tian approximation
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Fixed: The conservation of water mass when being partitioned
2+
within the solid phase and the free fluid phase in the
3+
reactive fluid transport model.
4+
<br>
5+
(Daniel Douglas, 2025/06/14)

include/aspect/material_model/latent_heat_melt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ namespace aspect
7373
*/
7474

7575
void melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
76-
std::vector<double> &melt_fractions) const override;
76+
std::vector<double> &melt_fractions,
77+
const MaterialModel::MaterialModelOutputs<dim> *out = nullptr) const override;
7778

7879

7980
/**

include/aspect/material_model/melt_boukare.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,14 @@ namespace aspect
9090
* @param in Object that contains the current conditions.
9191
* @param melt_fractions Vector of doubles that is filled with the
9292
* equilibrium melt fraction for each given input conditions.
93+
* @param out Optional pointer to the material properties provided by the
94+
* material model. By default, this variable is a nullptr. If the melt
95+
* fractions depend on material model properties, then this parameter
96+
* must be set to a valid pointer to a MaterialModelOutputs object.
9397
*/
9498
void melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
95-
std::vector<double> &melt_fractions) const override;
99+
std::vector<double> &melt_fractions,
100+
const MaterialModel::MaterialModelOutputs<dim> *out = nullptr) const override;
96101

97102
/**
98103
* @name Reference quantities

include/aspect/material_model/melt_global.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,14 @@ namespace aspect
6767
* @param in Object that contains the current conditions.
6868
* @param melt_fractions Vector of doubles that is filled with the
6969
* equilibrium melt fraction for each given input conditions.
70+
* @param out Optional pointer to the material properties provided by the
71+
* material model. By default, this variable is a nullptr. If the melt
72+
* fractions depend on material model properties, then this parameter
73+
* must be set to a valid pointer to a MaterialModelOutputs object.
7074
*/
7175
void melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
72-
std::vector<double> &melt_fractions) const override;
76+
std::vector<double> &melt_fractions,
77+
const MaterialModel::MaterialModelOutputs<dim> *out = nullptr) const override;
7378

7479
/**
7580
* @name Reference quantities

include/aspect/material_model/melt_simple.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ namespace aspect
7878
typename Interface<dim>::MaterialModelOutputs &out) const override;
7979

8080
void melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
81-
std::vector<double> &melt_fractions) const override;
81+
std::vector<double> &melt_fractions,
82+
const MaterialModel::MaterialModelOutputs<dim> *out = nullptr) const override;
8283

8384
/**
8485
* @name Reference quantities

include/aspect/material_model/reaction_model/tian2019_solubility.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ namespace aspect
6161
* @p in and @p melt_fraction need to have the same size.
6262
*
6363
* @param in Object that contains the current conditions.
64-
* @param porosity_idx the index of the "porosity" composition
64+
* @param mass_frac_porosity the mass fraction of the "porosity" composition
6565
* @param q the quadrature point index
6666
*/
6767
double
6868
melt_fraction (const MaterialModel::MaterialModelInputs<dim> &in,
69-
const unsigned int porosity_idx,
69+
const double mass_frac_porosity,
7070
unsigned int q) const;
7171

7272
/**

include/aspect/material_model/reactive_fluid_transport.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,14 @@ namespace aspect
6868
* @param in Object that contains the current conditions.
6969
* @param melt_fractions Vector of doubles that is filled with the
7070
* allowable free fluid fraction for each given input conditions.
71+
* @param out Optional pointer to the material properties provided by the
72+
* material model. By default, this variable is a nullptr. If the melt
73+
* fractions depend on material model properties, then this parameter
74+
* must be set to a valid pointer to a MaterialModelOutputs object.
7175
*/
7276
void melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
73-
std::vector<double> &melt_fractions) const override;
77+
std::vector<double> &melt_fractions,
78+
const MaterialModel::MaterialModelOutputs<dim> *out = nullptr) const override;
7479

7580
/**
7681
* Initialize the base model at the beginning of the model run

include/aspect/melt.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,14 @@ namespace aspect
153153
* @param in Object that contains the current conditions.
154154
* @param melt_fractions Vector of doubles that is filled with the
155155
* equilibrium melt fraction for each given input conditions.
156+
* @param out Optional pointer to the material properties provided by the
157+
* material model. By default, this variable is a nullptr. If the melt
158+
* fractions depend on material model properties, then this parameter
159+
* must be set to a valid pointer to a MaterialModelOutputs object.
156160
*/
157161
virtual void melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
158-
std::vector<double> &melt_fractions) const = 0;
162+
std::vector<double> &melt_fractions,
163+
const MaterialModel::MaterialModelOutputs<dim> *out = nullptr) const = 0;
159164

160165
/**
161166
* Return whether an object provided as argument is of a class that is

0 commit comments

Comments
 (0)