cideMOD.models.particle_models.SGM_basic.preprocessing
Classes
Base mixin class that contains the mandatory methods to be overrided related to the preprocessing of the model inputs. |
- class cideMOD.models.particle_models.SGM_basic.preprocessing.ParticleModelSGMPreprocessing[source]
Bases:
BaseCellModelPreprocessingBase mixin class that contains the mandatory methods to be overrided related to the preprocessing of the model inputs.
- initial_guess(f: BlockFunction, var: ProblemVariables, cell: BatteryCell, problem) None[source]
This method initializes the state variables based on the initial conditions and assuming that the simulation begins after a stationary state.
- Parameters:
f (BlockFunction) – Block function that contain the state variables to be initialized.
var (ProblemVariables) – Object that store the preprocessed problem variables.
cell (BatteryCell) – Object where cell parameters are preprocessed and stored.
problem (Problem) – Object that handles the battery cell simulation.
- set_active_material_parameters(am: BaseCellComponent, problem) None[source]
This method preprocesses the active material parameters of the SGM particle model.
- Parameters:
am (BaseCellComponent) – Object where active material parameters are preprocessed and stored.
problem (Problem) – Object that handles the battery cell simulation.
- set_problem_variables(var: ProblemVariables, DT: TimeScheme, problem) None[source]
This method sets the problem variables of the SGM particle model.
- Parameters:
var (ProblemVariables) – Object that store the preprocessed problem variables.
DT (TimeScheme) – Object that provide the temporal derivatives with the specified scheme.
problem (Problem) – Object that handles the battery cell simulation.
Notes
This method is called within
ProblemVariablesright after setting up the state variables and before theBatteryCellis created. In this class is meant to create the control variables and those ones that will help cell parameters preprocessing.
- set_state_variables(state_vars: list, mesher, V, V_vec, problem) None[source]
This method sets the state variables of the SGM particle model.
- Parameters:
state_vars (List(Tuple(str, numpy.ndarray, dolfinx.fem.FunctionSpace))) – List of tuples, each one containing the name, the subdomain and the function space of the state variable.
mesher (BaseMesher) – Object that contains the mesh information.
V (dolfinx.fem.FunctionSpace) – Common FunctionSpace to be used for each model.
V_vec (dolfinx.fem.VectorFunctionSpace) – Common VectorFunctionSpace to be used for each model.
Examples
>>> res = mesher.get_restrictions() >>> state_vars.append(('new_var', res.electrolyte, V.clone()))