Skip to content

Commit e4e080a

Browse files
fix bound_fluid.cc
1 parent 1786b4d commit e4e080a

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

cookbooks/2D_subduction_with_two_phase_flow/fixed_slab_darcy_with_fugacity.prm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ subsection Solver parameters
5151
set GMRES solver restart length = 1000
5252
set Number of cheap Stokes solver steps = 20000
5353
set Use full A block as preconditioner = true
54-
set Linear solver tolerance = 1e-4
54+
set Linear solver tolerance = 1e-5
5555
set Maximum number of expensive Stokes solver steps = 0
5656
end
5757
subsection Operator splitting parameters
@@ -99,7 +99,7 @@ subsection Initial composition model
9999
set List of model names = world builder disequilibrium
100100
subsection World builder
101101
set List of relevant compositions = porosity, bound_fluid, peridotite, gabbro, MORB, sediment
102-
set Disequilibrium percentage = 10
102+
set Disequilibrium percentage = 5
103103
end
104104
end
105105

cookbooks/2D_subduction_with_two_phase_flow/fixed_slab_mckenzie_with_fugacity.prm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ subsection Material model
3030
end
3131
end
3232

33-
# Remove the darcy velocity from the list of output variables.
33+
# Remove the darcy velocity from the list of output variables, output the melt material properties.
3434
subsection Postprocess
3535
subsection Visualization
3636
set List of output variables = material properties, strain rate, named additional outputs, melt material properties

cookbooks/2D_subduction_with_two_phase_flow/plugin/bound_fluid_source.cc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ namespace aspect
4545
{
4646
ReactiveFluidTransport<dim>::evaluate(in, out);
4747
const unsigned int bound_fluid_idx = this->introspection().compositional_index_for_name("bound_fluid");
48+
const std::shared_ptr<ReactionRateOutputs<dim>> reaction_rate_out
49+
= out.template get_additional_output_object<ReactionRateOutputs<dim>>();
4850

49-
// Do not allow the bound fluid content to decrease.
50-
for (unsigned int q=0; q < in.n_evaluation_points(); ++q)
51-
if (out.reaction_terms[q][bound_fluid_idx] <= 0.0)
52-
out.reaction_terms[q][bound_fluid_idx] = 0.0;
51+
if (this->get_parameters().use_operator_splitting && reaction_rate_out != nullptr
52+
&& in.requests_property(MaterialProperties::reaction_rates))
53+
{
54+
for (unsigned int q=0; q < in.n_evaluation_points(); ++q)
55+
if (reaction_rate_out->reaction_rates[q][bound_fluid_idx] <= 0.0)
56+
reaction_rate_out->reaction_rates[q][bound_fluid_idx] = 0.0;
57+
}
5358
}
54-
5559
}
5660
}
5761

@@ -62,8 +66,8 @@ namespace aspect
6266
{
6367
ASPECT_REGISTER_MATERIAL_MODEL(BoundFluidSource,
6468
"reactive fluid transport bound fluid source",
65-
"A simple material model that is like the "
66-
"'reactive fluid transport' model, but prevents "
67-
"the bound fluid content from decreasing.")
69+
"A material model that is like the 'reactive "
70+
"fluid transport' model, but modifies the reactions "
71+
"to prevent the bound fluid content from decreasing.")
6872
}
6973
}

cookbooks/2D_subduction_with_two_phase_flow/plugin/world_builder_disequilibrium_fluid.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ namespace aspect
157157
"for all compositions that are not selected in the list. "
158158
"By default the list is empty and the world builder is "
159159
"evaluated for all compositional fields.");
160-
prm.declare_entry ("Disequilibrium percentage", "10",
160+
prm.declare_entry ("Disequilibrium percentage", "5",
161161
Patterns::Double(0),
162162
"A percentage value that defines the increase in the "
163163
"bound_fluid compositional field from its equilibrium value. "
@@ -216,12 +216,10 @@ namespace aspect
216216
ASPECT_REGISTER_INITIAL_COMPOSITION_MODEL(WorldBuilderDisequilibrium,
217217
"world builder disequilibrium",
218218
"Specify the initial composition through the World Builder. "
219-
"More information on the World Builder can be found at "
220-
"\\url{https://geodynamicworldbuilder.github.io}. "
221-
"Make sure to specify the location of the World Builder file "
222-
"in the parameter 'World builder file'. It is possible to use "
223-
"the World Builder only for selected compositional fields by "
224-
"specifying the parameter 'List of relevant compositions'.")
219+
"If the composition is not named bound_fluid, the composition "
220+
"is set to the value returned by the World Builder. If the "
221+
"composition is named bound_fluid, the value returned by the "
222+
"World Builder is increased by a user defined percentage. ")
225223
}
226224
}
227225
#endif

0 commit comments

Comments
 (0)