File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ import pybamm
2
+
3
+
4
+ x_n = pybamm .standard_spatial_vars .x_n
5
+ x_s = pybamm .standard_spatial_vars .x_s
6
+ x_p = pybamm .standard_spatial_vars .x_p
7
+ r_n = pybamm .standard_spatial_vars .r_n
8
+ r_p = pybamm .standard_spatial_vars .r_p
9
+
10
+ var_pts = {x_n : 10 , x_s : 3 , x_p : 10 }
11
+ model_lin = pybamm .lead_acid .Full ()
12
+ sim_lin = pybamm .Simulation (model_lin , var_pts = var_pts )
13
+ sim_lin .solve ()
14
+
15
+ model_quad = pybamm .lead_acid .Full ()
16
+ method_options = {"extrapolation" : {"order" : "quadratic" , "use bcs" : False }}
17
+ spatial_methods = {
18
+ "negative particle" : pybamm .FiniteVolume (method_options ),
19
+ "positive particle" : pybamm .FiniteVolume (method_options ),
20
+ "macroscale" : pybamm .FiniteVolume (method_options ),
21
+ "current collector" : pybamm .ZeroDimensionalMethod (),
22
+ }
23
+ sim_quad = pybamm .Simulation (
24
+ model_quad , spatial_methods = spatial_methods , var_pts = var_pts
25
+ )
26
+ sim_quad .solve ()
27
+
28
+
29
+ # plot the two sols
30
+ models = [sim_lin .built_model , sim_quad .built_model ]
31
+ solutions = [sim_lin .solution , sim_quad .solution ]
32
+ plot = pybamm .QuickPlot (models , sim_lin .mesh , solutions )
33
+ plot .dynamic_plot ()
34
+
Original file line number Diff line number Diff line change @@ -183,6 +183,10 @@ def parameter_values(self):
183
183
def submesh_types (self ):
184
184
return self ._submesh_types
185
185
186
+ @property
187
+ def mesh (self ):
188
+ return self ._mesh
189
+
186
190
@property
187
191
def var_pts (self ):
188
192
return self ._var_pts
You can’t perform that action at this time.
0 commit comments