File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
cookbooks/2D_subduction_with_two_phase_flow/plugin Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments