@@ -141,6 +141,7 @@ def options(self):
141
141
@options .setter
142
142
def options (self , extra_options ):
143
143
default_options = {
144
+ "operating mode" : "current" ,
144
145
"dimensionality" : 0 ,
145
146
"surface form" : False ,
146
147
"convection" : False ,
@@ -161,6 +162,10 @@ def options(self, extra_options):
161
162
raise pybamm .OptionError ("option {} not recognised" .format (name ))
162
163
163
164
# Some standard checks to make sure options are compatible
165
+ if options ["operating mode" ] not in ["current" , "potential" ]:
166
+ raise pybamm .OptionError (
167
+ "operating mode '{}' not recognised" .format (options ["operating mode" ])
168
+ )
164
169
if (
165
170
isinstance (self , (pybamm .lead_acid .LOQS , pybamm .lead_acid .Composite ))
166
171
and options ["surface form" ] is False
@@ -341,18 +346,6 @@ def set_standard_output_variables(self):
341
346
342
347
self .variables = {}
343
348
344
- # Current
345
- i_cell = pybamm .electrical_parameters .current_with_time
346
- i_cell_dim = pybamm .electrical_parameters .dimensional_current_density_with_time
347
- I = pybamm .electrical_parameters .dimensional_current_with_time
348
- self .variables .update (
349
- {
350
- "Total current density" : i_cell ,
351
- "Total current density [A.m-2]" : i_cell_dim ,
352
- "Current [A]" : I ,
353
- }
354
- )
355
-
356
349
# Time
357
350
time_scale = pybamm .electrical_parameters .timescale
358
351
self .variables .update (
@@ -361,7 +354,6 @@ def set_standard_output_variables(self):
361
354
"Time [s]" : pybamm .t * time_scale ,
362
355
"Time [min]" : pybamm .t * time_scale / 60 ,
363
356
"Time [h]" : pybamm .t * time_scale / 3600 ,
364
- "Discharge capacity [A.h]" : I * pybamm .t * time_scale / 3600 ,
365
357
}
366
358
)
367
359
@@ -491,6 +483,20 @@ def build_model(self):
491
483
492
484
self ._built = True
493
485
486
+ def set_external_circuit_submodel (self ):
487
+ """
488
+ Define how the external circuit defines the boundary conditions for the model,
489
+ e.g. (not necessarily constant-) current, voltage, etc
490
+ """
491
+ if self .options ["operating mode" ] == "current" :
492
+ self .submodels [
493
+ "external circuit"
494
+ ] = pybamm .external_circuit .ConstantCurrent (self .param )
495
+ if self .options ["operating mode" ] == "voltage" :
496
+ self .submodels [
497
+ "external circuit"
498
+ ] = pybamm .external_circuit .ConstantVoltage (self .param )
499
+
494
500
def set_thermal_submodel (self ):
495
501
496
502
if self .options ["thermal" ] == "isothermal" :
0 commit comments