Skip to content

Commit eee206a

Browse files
committed
Merge branch 'linear_solver' into dev
2 parents 8da6319 + 26c6bb8 commit eee206a

23 files changed

+2551
-71
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
88
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
99
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1010
Jutul = "2b460a1a-8a2b-45b2-b125-b5c536396eb9"
11+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1112
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
1213
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
1314
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1415
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
16+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1517
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1618
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1719
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

examples/Experimental/Test_sim.jl

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
using Jutul, BattMo, GLMakie
22
using Plots
33
using 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+
417
GLMakie.closeall()
518
#GLMakie.activate!()
619
include_cc = true
@@ -10,11 +23,66 @@ do_plot = true
1023
fac = 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

1987
if do_plot
2088
fig = Figure(size = (1600, 900))

0 commit comments

Comments
 (0)