Variable object in initial conditions - pouch cell model #3824
Unanswered
akhilmabraham
asked this question in
Q&A
Replies: 1 comment
-
This is a bug, thanks for finding it! See #3828 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to solve for temperature/voltage distribution across the 2D current collector in a pouch cell. I am getting a typeerror that says "TypeError: Initial conditions cannot contain 'Variable' objects, but 'Variable(-0x67993b00aac3e7da, Current variable [A], children=[], domains={})' found in initial conditions for 'Current collector current density [A.m-2]'". Can someone help me with this @rtimms @tinosulzer @TomTranter @brosaplanella. The script is attached below
model = pybamm.lithium_ion.DFN(
{
"calculate discharge energy":"true",
"particle mechanics": ("swelling and cracking", "swelling only"),
"SEI":"solvent-diffusion limited",
"SEI on cracks": "true",
"SEI porosity change": "true",
"cell geometry": "pouch",
"current collector": "potential pair",
"dimensionality": 1,
"thermal": "x-lumped"
}, name = "1 + 1D DFN"
parameter_values = pybamm.ParameterValues("OKane2022")
thermalparameters = {
"Negative current collector surface heat transfer coefficient [W.m-2.K-1]": 5,
"Positive current collector surface heat transfer coefficient [W.m-2.K-1]": 5,
"Negative tab heat transfer coefficient [W.m-2.K-1]": 5,
"Positive tab heat transfer coefficient [W.m-2.K-1]": 5,
"Edge heat transfer coefficient [W.m-2.K-1]": 5,
'Negative tab centre y-coordinate [m]': 0.135,
'Negative tab centre z-coordinate [m]': 0.556,
'Negative tab width [m]': 0.020,
'Positive tab centre y-coordinate [m]': 0.485,
'Positive tab centre z-coordinate [m]': 0.556,
'Positive tab width [m]': 0.020
}
parameter_values.update(thermalparameters, check_already_exists=False)
npts = 20
var_pts = {
"x_n" : npts,
"x_s" : npts,
"x_p" : npts,
"r_n" : npts,
"r_p" : npts,
"z": npts
}
protocol = pybamm.Experiment(
[
"Discharge at C/10 until 2.8 V (10 seconds period)",
"Rest for 5 minutes (10 seconds period)"
]
+ [
"Charge at C/10 until 4.2 V (30 seconds period)",
"Hold at 4.2 V until C/20 (5 seconds period)",
"Rest for 5 minutes (10 seconds period)",
"Discharge at C/10 until 2.8 V (10 seconds period)",
"Rest for 5 minutes (10 seconds period)"
]*5
solver = pybamm.CasadiSolver(dt_max = 40)
sim = pybamm.Simulation(model, experiment = protocol, parameter_values = parameter_values, var_pts = var_pts, solver=solver)
sol = sim.solve(initial_soc = 0.6)
Beta Was this translation helpful? Give feedback.
All reactions