Skip to content

Commit 26a3058

Browse files
authored
Merge pull request #17 from BattMoTeam/dev
New preconditioner infrastructure, updated tests and upgrade to Jutul 0.3
2 parents 3d29127 + dde446e commit 26a3058

26 files changed

+2597
-117
lines changed

Project.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
name = "BattMo"
22
uuid = "6f0c0536-3c2c-4762-a987-c605a8a6f898"
33
authors = ["Olav Møyner <[email protected]>"]
4-
version = "0.1.7"
4+
version = "0.1.8"
55

66
[deps]
7-
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
87
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
98
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
109
Jutul = "2b460a1a-8a2b-45b2-b125-b5c536396eb9"
10+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1111
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
1212
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
1313
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1414
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
15+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1516
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1617
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1718
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
@@ -22,7 +23,7 @@ x264_jll = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a"
2223
[compat]
2324
JLD2 = "0.4.31"
2425
JSON = "0.21.4"
25-
Jutul = "0.2.10"
26+
Jutul = "0.3.0"
2627
MAT = "0.10.4"
2728
Polynomials = "3.2.11 - 4"
2829
PrecompileTools = "1.1.1"

examples/Experimental/Test_sim.jl

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
using Jutul, BattMo, GLMakie
22
using Plots
33
using 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+
416
GLMakie.closeall()
517
#GLMakie.activate!()
618
include_cc = true
@@ -10,11 +22,66 @@ do_plot = true
1022
fac = 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

1986
if do_plot
2087
fig = Figure(size = (1600, 900))

0 commit comments

Comments
 (0)