Previous topic

Reaction-driven Model

Next topic

Thermal

This Page

Reaction-driven Model as an ODE

class pybamm.porosity.ReactionDrivenODE(param, options, x_average)

Reaction-driven porosity changes as an ODE

Parameters
  • param (parameter class) – The parameters to use for this submodel

  • options (dict) – Options dictionary passed from the full model

  • x_average (bool) – Whether to use x-averaged variables (SPM, SPMe, etc) or full variables (DFN)

  • **Extends (** pybamm.porosity.BaseModel) –

get_coupled_variables(variables)

A public method that creates and returns the variables in a submodel which require variables in other submodels to be set first. For example, the exchange current density requires the concentration in the electrolyte to be created before it can be created. If a variable can be created independent of other submodels then it should be created in ‘get_fundamental_variables’ instead of this method.

Parameters

variables (dict) – The variables in the whole model.

Returns

The variables created in this submodel which depend on variables in other submodels.

Return type

dict

get_fundamental_variables()

A public method that creates and returns the variables in a submodel which can be created independent of other submodels. For example, the electrolyte concentration variables can be created independent of whether any other variables have been defined in the model. As a rule, if a variable can be created without variables from other submodels, then it should be placed in this method.

Returns

The variables created by the submodel which are independent of variables in other submodels.

Return type

dict

set_initial_conditions(variables)

A method to set the initial conditions for the submodel. Note: this method modifies the state of self.initial_conditions. Unless overwritten by a submodel, the default behaviour of ‘pass’ is used a implemented in pybamm.BaseSubModel.

Parameters

variables (dict) – The variables in the whole model.

set_rhs(variables)

A method to set the right hand side of the differential equations which contain a time derivative. Note: this method modifies the state of self.rhs. Unless overwritten by a submodel, the default behaviour of ‘pass’ is used as implemented in pybamm.BaseSubModel.

Parameters

variables (dict) – The variables in the whole model.