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