More than one constant component
Currently we just allow a single "constant component" (component whose parameters are fixed through the input file). A recent update allows one component per "ModelParameterGroup". However, we want to have as many different of those components as we want.
Proposal:
- the component class gets an integer id
template <int id>
class ConstantComponent;
- the id is used in the input file key such that we can write
[1.ConstantComponent]
Density = 1000
[2.ConstantComponent]
Density = 900
- Making the id a group allows for simple defaults in the base group "ConstantComponent" and also allows to write
[ConstantComponent]
Density = 1000
if there is just one component no matter which id it has. In order for that to work we need to write in the component class
static const Scalar density = getParamFromGroup<Scalar>(std::to_string(id), "ConstantComponent.Density");
- This also makes components independent of the ModelParameterGroup and thus any TypeTag, which makes sense since components shouldn't be different in a different compartment or model domain of the global model. They are unique within a Dumux simulation.
Edited by Timo Koch