Skip to content

Commit

Permalink
Merge pull request #17 from BattMoTeam/dev
Browse files Browse the repository at this point in the history
New preconditioner infrastructure, updated tests and upgrade to Jutul 0.3
  • Loading branch information
moyner authored Nov 20, 2024
2 parents 3d29127 + dde446e commit 26a3058
Show file tree
Hide file tree
Showing 26 changed files with 2,597 additions and 117 deletions.
7 changes: 4 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name = "BattMo"
uuid = "6f0c0536-3c2c-4762-a987-c605a8a6f898"
authors = ["Olav Møyner <olav.moyner@gmail.com>"]
version = "0.1.7"
version = "0.1.8"

[deps]
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Jutul = "2b460a1a-8a2b-45b2-b125-b5c536396eb9"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Expand All @@ -22,7 +23,7 @@ x264_jll = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a"
[compat]
JLD2 = "0.4.31"
JSON = "0.21.4"
Jutul = "0.2.10"
Jutul = "0.3.0"
MAT = "0.10.4"
Polynomials = "3.2.11 - 4"
PrecompileTools = "1.1.1"
Expand Down
77 changes: 72 additions & 5 deletions examples/Experimental/Test_sim.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
using Jutul, BattMo, GLMakie
using Plots
using StatsBase
#using HYPRE
using Plots
using AlgebraicMultigrid
using Preconditioners
using Preferences
revise(; throw=true)
set_preferences!(BattMo, "precompile_workload" => false; force=true)
set_preferences!(Jutul, "precompile_workload" => false; force=true)
includet("../../src/solver_as_preconditioner.jl")
includet("../../src/solver_as_preconditioner_system.jl")
includet("../../src/precondgenneral.jl")

GLMakie.closeall()
#GLMakie.activate!()
include_cc = true
Expand All @@ -10,11 +22,66 @@ do_plot = true
fac = 1 # discretisation factor

## Create the pouch_grid
ugrids, ucouplings = pouch_grid(nx = 4*fac,
ny = 4*fac,
nz = 4,
tab_cell_nx = 3,
tab_cell_ny = 2)

#x = [x0, 4, 2, 4, x4] .* 1e-2/nx
#y = [2, 20, 2] .* 1e-3/ny
#z = [10, 100, 50, 80, 10] .* 1e-6/nz
tab_nx = 3
tab_ny = 3
(nx,ny) = (2+2*tab_nx,3+2*tab_ny)
n = [4,4,4,4,4]
z = [10, 100, 50, 80, 10] .* 1e-6./nz
tab_w = 4*1e-2
tab_h = 2*1e-3
x = 10*1e-2 + 2* tab_w
y = 20*1e-3 + 2*tab_h
#geomparam = Dict()

geomparams = Dict()
geomparams["NegativeElectrode"]=Dict()
geomparams["PositiveElectrode"] = Dict()
geomparams["Separator"] = Dict()
geomparams["NegativeElectrode"]["CurrentCollector"] = Dict()
geomparams["NegativeElectrode"]["CurrentCollector"]["tab"]=Dict()
geomparams["NegativeElectrode"]["Coating"] = Dict()
geomparams["PositiveElectrode"]["Coating"] = Dict()
geomparams["PositiveElectrode"]["CurrentCollector"] = Dict()
geomparams["PositiveElectrode"]["CurrentCollector"]["tab"]=Dict()
geomparams["Geometry"] =Dict()

geomparams["NegativeElectrode"]["CurrentCollector"]["thickness"] = z[1]
geomparams["NegativeElectrode"]["CurrentCollector"]["N"] = n[1]

geomparams["NegativeElectrode"]["Coating"]["thickness"] = z[2]
geomparams["NegativeElectrode"]["Coating"]["N"] = n[2]

geomparams["PositiveElectrode"]["CurrentCollector"]["thickness"] = z[5]
geomparams["PositiveElectrode"]["CurrentCollector"]["N"] = n[5]

geomparams["PositiveElectrode"]["Coating"]["thickness"] = z[4]
geomparams["PositiveElectrode"]["Coating"]["N"] = n[4]

geomparams["Separator"]["thickness"] = z[3]
geomparams["Separator"]["N"] = n[3]

geomparams["Geometry"]["width"] = x
geomparams["Geometry"]["height"] = y
geomparams["Geometry"]["Nw"] = nx
geomparams["Geometry"]["Nh"] = ny

geomparams["NegativeElectrode"]["CurrentCollector"]["tab"]["Nw"] = tab_nx
geomparams["NegativeElectrode"]["CurrentCollector"]["tab"]["Nh"] = tab_ny
geomparams["NegativeElectrode"]["CurrentCollector"]["tab"]["width"] = tab_w
geomparams["NegativeElectrode"]["CurrentCollector"]["tab"]["height"] = tab_h

geomparams["PositiveElectrode"]["CurrentCollector"]["tab"]["Nw"] = tab_nx
geomparams["PositiveElectrode"]["CurrentCollector"]["tab"]["Nh"] = tab_ny
geomparams["PositiveElectrode"]["CurrentCollector"]["tab"]["width"] = tab_w
geomparams["PositiveElectrode"]["CurrentCollector"]["tab"]["height"] = tab_h

parameters = InputGeometryParams(geomparams)

ugrids, couplings = pouch_grid(parameters)

if do_plot
fig = Figure(size = (1600, 900))
Expand Down
Loading

2 comments on commit 26a3058

@moyner
Copy link
Member Author

@moyner moyner commented on 26a3058 Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Updates

  • Fast AMG preconditioned solvers
  • SEI layer model
  • New docs (work in progress)
  • Improved treament of current and voltage controls
  • Better numerical tolerances
  • Better tests

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/119857

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.8 -m "<description of version>" 26a3058e30bf9b1560cda420762bedd56cf007ba
git push origin v0.1.8

Please sign in to comment.