Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 882 la thermal #885

Merged
merged 9 commits into from
Mar 13, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ Electrons in hydrogen reaction,2,,
Negative electrode reference exchange-current density (hydrogen) [A.m-2],1.56E-11,srinivasan2003mathematical,
Hydrogen reference OCP vs SHE [V],0,srinivasan2003mathematical,
Negative electrode double-layer capacity [F.m-2],0.2,,
,,,
# Density,,,
Negative electrode density [kg.m-3],113400,CRC Handbook of Chemistry and Physics,
,,,
# Thermal parameters,,,
Negative electrode specific heat capacity [J.kg-1.K-1],130,CRC Handbook of Chemistry and Physics,
Negative electrode thermal conductivity [W.m-1.K-1],35,CRC Handbook of Chemistry and Physics,
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ Electrons in hydrogen reaction,2,,
Positive electrode reference exchange-current density (hydrogen) [A.m-2],0,srinivasan2003mathematical,
Hydrogen reference OCP vs SHE [V],0,srinivasan2003mathematical,
Positive electrode double-layer capacity [F.m-2],0.2,,
,,,
# Density,,,
Positive electrode density [kg.m-3],9375,Pubchem,
,,,
# Thermal parameters,,,
Positive electrode specific heat capacity [J.kg-1.K-1],256,NIST Chemistry WebBook SRD69,
Positive electrode thermal conductivity [W.m-1.K-1],35,assume same as lead,
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ Name [units],Value,Reference,Notes
# Empty rows and rows starting with ‘#’ will be ignored,,,
,,,
# Macroscale geometry,,,
Negative current collector thickness [m],0,,
Negative electrode thickness [m],0.0009,Manufacturer,
Separator thickness [m],0.0015,Manufacturer,
Positive electrode thickness [m],0.00125,Manufacturer,
Positive current collector thickness [m],0,,
Electrode height [m],0.114,Manufacturer,
Electrode width [m],0.065,Manufacturer,
Negative tab width [m],0.04,,Estimated value
Expand All @@ -17,3 +19,18 @@ Positive tab centre z-coordinate [m],0.114,Tab at top,
# Electrical,,,
Cell capacity [A.h],17,Manufacturer,
Typical current [A],1,,

,,,
# Density,,,
Negative current collector density [kg.m-3],11300, same as electrode,
Positive current collector density [kg.m-3],9375,same as electrode,

,,,
# Specific heat capacity,,,
Negative current collector specific heat capacity [J.kg-1.K-1],130,CRC Handbook of Chemistry and Physics,
Positive current collector specific heat capacity [J.kg-1.K-1],256,NIST Chemistry WebBook SRD69,
,,,
# Thermal conductivity,,,
Negative current collector thermal conductivity [W.m-1.K-1],35,CRC Handbook of Chemistry and Physics,
Positive current collector thermal conductivity [W.m-1.K-1],35,assume same as lead,

Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Name [units],Value,Reference,Notes
# Temperature,,,
Reference temperature [K],294.85,Room temperature,
Maximum temperature [K],333.15,,
Ambient temperature [K], 298.15,,
Ambient temperature [K], 294.85,,
Heat transfer coefficient [W.m-2.K-1],10,,

Initial temperature [K],294.85,Room temperature,

,,,
# Electrical
Number of electrodes connected in parallel to make a cell,8,Manufacturer,
Number of cells connected in series to make a battery,6,Manufacturer,
Lower voltage cut-off [V],1.73,,(just under) 10.5V across 6-cell battery
Upper voltage cut-off [V],2.44,,(just over) 14.5V across 6-cell battery
Lower voltage cut-off [V],1.73,(just under) 10.5V across 6-cell battery,
Upper voltage cut-off [V],2.44,(just over) 14.5V across 6-cell battery,
C-rate,0.1,,
,,,
# Initial conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ Name [units],Value,Reference,Notes
Maximum porosity of separator,0.92,,
Separator Bruggeman coefficient (electrolyte),1.5,,
Separator Bruggeman coefficient (electrode),1.5,,
Separator density [kg.m-3],1680, Bulk density from Gigova 2006,
Separator specific heat capacity [J.kg-1.K-1],700, Electronics Cooling (fiberglass),
Separator thermal conductivity [W.m-1.K-1],0.04, University Physics Sears et al. 1999 (fiberglass),
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ def electrolyte_conductivity_Landesfeind2019_EC_DMC_1_1(c_e, T, T_inf, E_k_e, R_
:`numpy.Array`
Electrolyte diffusivity
"""
coeffs = np.array([7.98e-1,
2.28e2,
-1.22,
5.09e-1,
-4e-3,
3.79e-3])
coeffs = np.array([7.98e-1, 2.28e2, -1.22, 5.09e-1, -4e-3, 3.79e-3])

return base.electrolyte_conductivity_Landesfeind2019_base(c_e, T, coeffs)
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,5 @@ def electrolyte_conductivity_Landesfeind2019_EC_EMC_3_7(c_e, T, T_inf, E_k_e, R_
:`numpy.Array`
Electrolyte diffusivity
"""
coeffs = np.array([5.21e-1,
2.28e2,
-1.06,
3.53e-1,
-3.59e-3,
1.48e-3])
coeffs = np.array([5.21e-1, 2.28e2, -1.06, 3.53e-1, -3.59e-3, 1.48e-3])
return base.electrolyte_conductivity_Landesfeind2019_base(c_e, T, coeffs)
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,5 @@ def electrolyte_conductivity_Landesfeind2019_EMC_FEC_19_1(c_e, T, T_inf, E_k_e,
:`numpy.Array`
Electrolyte diffusivity
"""
coeffs = np.array([2.51e-2,
1.75e2,
1.23,
2.05e-1,
-8.81e-2,
2.83e-3])
coeffs = np.array([2.51e-2, 1.75e2, 1.23, 2.05e-1, -8.81e-2, 2.83e-3])
return base.electrolyte_conductivity_Landesfeind2019_base(c_e, T, coeffs)
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def electrolyte_conductivity_Landesfeind2019_base(c_e, T, coeffs):
c = c_e / 1000 # mol.m-3 -> mol.l
p1, p2, p3, p4, p5, p6 = coeffs
A = p1 * (1 + (T - p2))
B = (1 + p3 * sqrt(c) + p4 * (1 + p5 * exp(1000 / T)) * c)
C = 1 + c**4 * (p6 * exp(1000 / T))
B = 1 + p3 * sqrt(c) + p4 * (1 + p5 * exp(1000 / T)) * c
C = 1 + c ** 4 * (p6 * exp(1000 / T))
sigma_e = A * c * B / C # mS.cm-1

return sigma_e / 10
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ def electrolyte_diffusivity_Landesfeind2019_EC_DMC_1_1(c_e, T, T_inf, E_k_e, R_g
:`numpy.Array`
Electrolyte diffusivity
"""
coeffs = np.array([1.47e3,
1.33,
-1.69e3,
-5.63e2])
coeffs = np.array([1.47e3, 1.33, -1.69e3, -5.63e2])

return base.electrolyte_diffusivity_Landesfeind2019_base(c_e, T, coeffs)
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@ def electrolyte_diffusivity_Landesfeind2019_EC_EMC_3_7(c_e, T, T_inf, E_k_e, R_g
:`numpy.Array`
Electrolyte diffusivity
"""
coeffs = np.array([1.01e3,
1.01,
-1.56e3,
-4.87e2])
coeffs = np.array([1.01e3, 1.01, -1.56e3, -4.87e2])
return base.electrolyte_diffusivity_Landesfeind2019_base(c_e, T, coeffs)
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@ def electrolyte_diffusivity_Landesfeind2019_EMC_FEC_19_1(c_e, T, T_inf, E_k_e, R
:`numpy.Array`
Electrolyte diffusivity
"""
coeffs = np.array([5.86e2,
1.33,
-1.38e3,
-5.82e2])
coeffs = np.array([5.86e2, 1.33, -1.38e3, -5.82e2])
return base.electrolyte_diffusivity_Landesfeind2019_base(c_e, T, coeffs)
16 changes: 7 additions & 9 deletions pybamm/models/full_battery_models/base_battery_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class BaseBatteryModel(pybamm.BaseModel):
Can be "Fickian diffusion" (default) or "fast diffusion".
* "thermal" : str, optional
Sets the thermal model to use. Can be "isothermal" (default),
"x-full", "x-lumped", "xyz-lumped" or "lumped". Must be "isothermal" for
lead-acid models.
"x-full", "x-lumped", "xyz-lumped" or "lumped".
* "thermal current collector" : bool, optional
Whether to include thermal effects in the current collector in
one-dimensional models (default is False). Note that this option
Expand Down Expand Up @@ -218,22 +217,21 @@ def options(self, extra_options):

# Options that are incompatible with models
if isinstance(self, pybamm.lithium_ion.BaseModel):
# if options["surface form"] is not False:
# raise pybamm.OptionError(
# "surface form not implemented for lithium-ion models"
# )
if options["convection"] is True:
raise pybamm.OptionError(
"convection not implemented for lithium-ion models"
)
if isinstance(self, pybamm.lead_acid.BaseModel):
if options["thermal"] != "isothermal":
if options["thermal"] != "isothermal" and options["dimensionality"] != 0:
raise pybamm.OptionError(
"thermal effects not implemented for lead-acid models"
"Lead-acid models can only have thermal "
"effects if dimensionality is 0."
)

if options["thermal current collector"] is True:
raise pybamm.OptionError(
"thermal effects not implemented for lead-acid models"
"Thermal current collector effects are not implemented "
"for lead-acid models."
)

self._options = options
Expand Down
50 changes: 42 additions & 8 deletions pybamm/parameters/standard_parameters_lead_acid.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,9 @@
Q_p_max_dimensional = pybamm.Parameter("Positive electrode volumetric capacity [C.m-3]")


# Fake thermal
# thermal
Delta_T = pybamm.thermal_parameters.Delta_T


# --------------------------------------------------------------------------------------
"2. Dimensional Functions"

Expand Down Expand Up @@ -277,18 +276,27 @@ def U_p_dimensional(c_e, T):
# Electrolyte diffusion timescale
tau_diffusion_e = L_x ** 2 / D_e_typ

# Thermal diffusion timescale
tau_th_yz = pybamm.thermal_parameters.tau_th_yz

# Choose discharge timescale
timescale = tau_discharge

# --------------------------------------------------------------------------------------
"4. Dimensionless Parameters"
# Timescale ratios
C_th = tau_th_yz / tau_discharge

# Macroscale Geometry
l_n = pybamm.geometric_parameters.l_n
l_s = pybamm.geometric_parameters.l_s
l_p = pybamm.geometric_parameters.l_p
l_x = pybamm.geometric_parameters.l_x
l_y = pybamm.geometric_parameters.l_y
l_z = pybamm.geometric_parameters.l_z
a_cc = pybamm.geometric_parameters.a_cc
l = pybamm.geometric_parameters.l
delta = pybamm.geometric_parameters.delta
# In lead-acid the current collector and electrodes are the same (same thickness)
l_cn = l_n
l_cp = l_p
Expand Down Expand Up @@ -403,7 +411,39 @@ def U_p_dimensional(c_e, T):
Q_e_max_dimensional = Q_e_max * c_e_typ * F
capacity = Q_e_max_dimensional * n_electrodes_parallel * A_cs * L_x

# Thermal
rho_cn = pybamm.thermal_parameters.rho_cn
rho_n = pybamm.thermal_parameters.rho_n
rho_s = pybamm.thermal_parameters.rho_s
rho_p = pybamm.thermal_parameters.rho_p
rho_cp = pybamm.thermal_parameters.rho_cp

rho_k = pybamm.thermal_parameters.rho_k
rho = rho_n * l_n + rho_s * l_s + rho_p * l_p

lambda_cn = pybamm.thermal_parameters.lambda_cn
lambda_n = pybamm.thermal_parameters.lambda_n
lambda_s = pybamm.thermal_parameters.lambda_s
lambda_p = pybamm.thermal_parameters.lambda_p
lambda_cp = pybamm.thermal_parameters.lambda_cp

lambda_k = pybamm.thermal_parameters.lambda_k

Theta = pybamm.thermal_parameters.Theta
h = pybamm.thermal_parameters.h
B = (
i_typ
* R
* T_ref
* tau_th_yz
/ (pybamm.thermal_parameters.rho_eff_dim * F * Delta_T * L_x)
)

T_amb_dim = pybamm.thermal_parameters.T_amb_dim
T_amb = pybamm.thermal_parameters.T_amb

# Initial conditions
T_init = pybamm.thermal_parameters.T_init
q_init = pybamm.Parameter("Initial State of Charge")
c_e_init = q_init
c_ox_init = c_ox_init_dim / c_ox_typ
Expand All @@ -428,12 +468,6 @@ def c_p_init(x):
return c_e_init


# Thermal effects not implemented for lead-acid, but parameters needed for consistency
T_init = pybamm.Scalar(0)
Theta = pybamm.Scalar(0) # ratio of typical temperature change to ambient temperature
T_amb_dim = pybamm.thermal_parameters.T_amb_dim
T_amb = pybamm.thermal_parameters.T_amb

# --------------------------------------------------------------------------------------
"5. Dimensionless Functions"

Expand Down
1 change: 0 additions & 1 deletion pybamm/solvers/algebraic_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,3 @@ def jac(y):

# Return solution object (no events, so pass None to t_event, y_event)
return pybamm.Solution(t_eval, y, termination="success")

1 change: 0 additions & 1 deletion pybamm/solvers/casadi_algebraic_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,3 @@ def _integrate(self, model, t_eval, inputs=None):

# Return solution object (no events, so pass None to t_event, y_event)
return pybamm.Solution(t_eval, y, termination="success")

Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ def test_basic_processing_algebraic(self):
modeltest = tests.StandardModelTest(model, parameter_values=param)
modeltest.test_all() # solver=pybamm.CasadiSolver())

# def test_thermal(self):
# options = {"thermal": "x-lumped"}
# model = pybamm.lead_acid.Composite(options)
# modeltest = tests.StandardModelTest(model)
# modeltest.test_all()

# options = {"thermal": "x-full"}
# model = pybamm.lead_acid.Composite(options)
# modeltest = tests.StandardModelTest(model)
# modeltest.test_all()


class TestLeadAcidCompositeExtended(unittest.TestCase):
def test_basic_processing(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ def test_set_up(self):
optimtest.set_up_model(simplify=False, to_python=False)
optimtest.set_up_model(simplify=True, to_python=False)

def test_thermal(self):
options = {"thermal": "x-lumped"}
model = pybamm.lead_acid.Full(options)
modeltest = tests.StandardModelTest(model)
modeltest.test_all()

options = {"thermal": "x-full"}
model = pybamm.lead_acid.Full(options)
modeltest = tests.StandardModelTest(model)
modeltest.test_all()


if __name__ == "__main__":
print("Add -v for more debug output")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ def test_basic_processing_with_convection(self):
modeltest = tests.StandardModelTest(model)
modeltest.test_all()

def test_thermal(self):
options = {"thermal": "x-lumped"}
model = pybamm.lead_acid.LOQS(options)
modeltest = tests.StandardModelTest(model)
modeltest.test_all()

options = {"thermal": "x-full"}
model = pybamm.lead_acid.LOQS(options)
modeltest = tests.StandardModelTest(model)
modeltest.test_all()


if __name__ == "__main__":
print("Add -v for more debug output")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ def test_default_geometry(self):

def test_incompatible_options(self):
with self.assertRaisesRegex(
pybamm.OptionError, "thermal effects not implemented"
pybamm.OptionError,
"Thermal current collector effects are "
"not implemented for lead-acid models.",
):
pybamm.lead_acid.BaseModel({"thermal": "x-full"})
pybamm.lead_acid.BaseModel({"thermal current collector": True})

with self.assertRaisesRegex(
pybamm.OptionError, "thermal effects not implemented"
pybamm.OptionError,
"Lead-acid models can only have thermal " "effects if dimensionality is 0.",
):
pybamm.lead_acid.BaseModel({"thermal current collector": True})
pybamm.lead_acid.BaseModel({"dimensionality": 1, "thermal": "x-full"})


if __name__ == "__main__":
Expand Down
Loading