11using Jutul, BattMo, GLMakie
22using Plots
33using StatsBase
4+ # using HYPRE
5+ using Plots
6+ using Infiltrator
7+ using AlgebraicMultigrid
8+ using Preconditioners
9+ using Preferences
10+ revise (; throw= true )
11+ set_preferences! (BattMo, " precompile_workload" => false ; force= true )
12+ set_preferences! (Jutul, " precompile_workload" => false ; force= true )
13+ includet (" ../../src/solver_as_preconditioner.jl" )
14+ includet (" ../../src/solver_as_preconditioner_system.jl" )
15+ includet (" ../../src/precondgenneral.jl" )
16+
417GLMakie. closeall ()
518# GLMakie.activate!()
619include_cc = true
@@ -10,11 +23,66 @@ do_plot = true
1023fac = 1 # discretisation factor
1124
1225# # Create the pouch_grid
13- ugrids, ucouplings = pouch_grid (nx = 4 * fac,
14- ny = 4 * fac,
15- nz = 4 ,
16- tab_cell_nx = 3 ,
17- tab_cell_ny = 2 )
26+
27+ # x = [x0, 4, 2, 4, x4] .* 1e-2/nx
28+ # y = [2, 20, 2] .* 1e-3/ny
29+ # z = [10, 100, 50, 80, 10] .* 1e-6/nz
30+ tab_nx = 3
31+ tab_ny = 3
32+ (nx,ny) = (2 + 2 * tab_nx,3 + 2 * tab_ny)
33+ n = [4 ,4 ,4 ,4 ,4 ]
34+ z = [10 , 100 , 50 , 80 , 10 ] .* 1e-6 ./ nz
35+ tab_w = 4 * 1e-2
36+ tab_h = 2 * 1e-3
37+ x = 10 * 1e-2 + 2 * tab_w
38+ y = 20 * 1e-3 + 2 * tab_h
39+ # geomparam = Dict()
40+
41+ geomparams = Dict ()
42+ geomparams[" NegativeElectrode" ]= Dict ()
43+ geomparams[" PositiveElectrode" ] = Dict ()
44+ geomparams[" Separator" ] = Dict ()
45+ geomparams[" NegativeElectrode" ][" CurrentCollector" ] = Dict ()
46+ geomparams[" NegativeElectrode" ][" CurrentCollector" ][" tab" ]= Dict ()
47+ geomparams[" NegativeElectrode" ][" Coating" ] = Dict ()
48+ geomparams[" PositiveElectrode" ][" Coating" ] = Dict ()
49+ geomparams[" PositiveElectrode" ][" CurrentCollector" ] = Dict ()
50+ geomparams[" PositiveElectrode" ][" CurrentCollector" ][" tab" ]= Dict ()
51+ geomparams[" Geometry" ] = Dict ()
52+
53+ geomparams[" NegativeElectrode" ][" CurrentCollector" ][" thickness" ] = z[1 ]
54+ geomparams[" NegativeElectrode" ][" CurrentCollector" ][" N" ] = n[1 ]
55+
56+ geomparams[" NegativeElectrode" ][" Coating" ][" thickness" ] = z[2 ]
57+ geomparams[" NegativeElectrode" ][" Coating" ][" N" ] = n[2 ]
58+
59+ geomparams[" PositiveElectrode" ][" CurrentCollector" ][" thickness" ] = z[5 ]
60+ geomparams[" PositiveElectrode" ][" CurrentCollector" ][" N" ] = n[5 ]
61+
62+ geomparams[" PositiveElectrode" ][" Coating" ][" thickness" ] = z[4 ]
63+ geomparams[" PositiveElectrode" ][" Coating" ][" N" ] = n[4 ]
64+
65+ geomparams[" Separator" ][" thickness" ] = z[3 ]
66+ geomparams[" Separator" ][" N" ] = n[3 ]
67+
68+ geomparams[" Geometry" ][" width" ] = x
69+ geomparams[" Geometry" ][" height" ] = y
70+ geomparams[" Geometry" ][" Nw" ] = nx
71+ geomparams[" Geometry" ][" Nh" ] = ny
72+
73+ geomparams[" NegativeElectrode" ][" CurrentCollector" ][" tab" ][" Nw" ] = tab_nx
74+ geomparams[" NegativeElectrode" ][" CurrentCollector" ][" tab" ][" Nh" ] = tab_ny
75+ geomparams[" NegativeElectrode" ][" CurrentCollector" ][" tab" ][" width" ] = tab_w
76+ geomparams[" NegativeElectrode" ][" CurrentCollector" ][" tab" ][" height" ] = tab_h
77+
78+ geomparams[" PositiveElectrode" ][" CurrentCollector" ][" tab" ][" Nw" ] = tab_nx
79+ geomparams[" PositiveElectrode" ][" CurrentCollector" ][" tab" ][" Nh" ] = tab_ny
80+ geomparams[" PositiveElectrode" ][" CurrentCollector" ][" tab" ][" width" ] = tab_w
81+ geomparams[" PositiveElectrode" ][" CurrentCollector" ][" tab" ][" height" ] = tab_h
82+
83+ parameters = InputGeometryParams (geomparams)
84+
85+ ugrids, couplings = pouch_grid (parameters)
1886
1987if do_plot
2088 fig = Figure (size = (1600 , 900 ))
0 commit comments