Skip to content

Commit aa2b9fc

Browse files
committed
update input parameters
1 parent 462f477 commit aa2b9fc

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

include/aspect/material_model/visco_plastic.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,15 @@ namespace aspect
272272
EquationOfState::MulticomponentCompressible<dim> equation_of_state_compressible;
273273

274274
/**
275-
* Whether to use a compressible or incompressible equation of state.
275+
* Enumeration for selecting which type of Equation of State
276+
* model to use. Select between multicomponent incompressible
277+
* or multicomponent incompressible.
276278
*/
277-
bool use_compressible_equation_of_state;
279+
enum EquationOfStateScheme
280+
{
281+
multicomponent_incompressible,
282+
multicomponent_compressible
283+
} equation_of_state;
278284

279285
/**
280286
* Object that handles phase transitions.

source/material_model/visco_plastic.cc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,10 @@ namespace aspect
352352

353353
EquationOfState::MulticomponentCompressible<dim>::declare_parameters (prm);
354354

355-
prm.declare_entry ("Use compressible equation of state","false",
356-
Patterns::Bool (),
357-
"Whether to use an incompressible or compressible equation of state. "
358-
"If set to true, the material model will switch from using the "
359-
"multicomponent incompressible multicomponent compressible equation "
360-
"of state model. ");
355+
prm.declare_entry ("Equation of state", "multicomponent incompressible",
356+
Patterns::Selection("multicomponent incompressible|multicomponent compresssible"),
357+
"Select the equation of state model to use between the options "
358+
"multicomponent incompressible and multicomponent incompressible.");
361359

362360
Rheology::ViscoPlastic<dim>::declare_parameters(prm);
363361

@@ -406,8 +404,14 @@ namespace aspect
406404
n_phases = phase_function.n_phases_over_all_chemical_compositions();
407405

408406
// Equation of state parameters
409-
use_compressible_equation_of_state = prm.get_bool ("Use compressible equation of state");
410-
if (use_compressible_equation_of_state == false)
407+
if (prm.get ("Equation of state") == "multicomponent incompressible")
408+
equation_of_state = multicomponent_incompressible;
409+
else if (prm.get ("Equation of state") == "multicomponent compressible")
410+
equation_of_state = multicomponent_compressible;
411+
else
412+
AssertThrow(false, ExcMessage("Not a valid equation of state model"));
413+
414+
if (equation_of_state == multicomponent_incompressible)
411415
{
412416
equation_of_state_incompressible.initialize_simulator (this->get_simulator());
413417
equation_of_state_incompressible.parse_parameters (prm,

0 commit comments

Comments
 (0)