Skip to content

Commit

Permalink
Merge pull request #1323 from brosaplanella/issue-1322-thermal-parame…
Browse files Browse the repository at this point in the history
…ters-dependent-temperature

Issue 1322 thermal parameters dependent temperature
  • Loading branch information
brosaplanella authored Jan 13, 2021
2 parents 7360445 + 7567868 commit 77e0767
Show file tree
Hide file tree
Showing 11 changed files with 306 additions and 143 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Features


- Added temperature dependence to density, heat capacity and thermal conductivity ([1323](https://github.com/pybamm-team/PyBaMM/pull/1323))
- Updated solvers' method `solve()` so it can take a list of inputs dictionaries as the `inputs` keyword argument. In this case the model is solved for each input set in the list, and a list of solutions mapping the set of inputs to the solutions is returned. Note that `solve()` can still take a single dictionary as the `inputs` keyword argument. In this case the behaviour is unchanged compared to previous versions.
- Added temperature dependence to the transference number (`t_plus`) ([1317](https://github.com/pybamm-team/PyBaMM/pull/1317))
- Added new functionality for `Interpolant` ([#1312](https://github.com/pybamm-team/PyBaMM/pull/1312))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ 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,
Negative electrode density [kg.m-3],11300,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,
Expand Down
2 changes: 1 addition & 1 deletion pybamm/models/submodels/thermal/lumped.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def set_rhs(self, variables):
T_vol_av: (
self.param.B * Q_vol_av + total_cooling_coefficient * (T_vol_av - T_amb)
)
/ (self.param.C_th * self.param.rho)
/ (self.param.C_th * self.param.rho(T_vol_av))
}

def set_initial_conditions(self, variables):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def set_rhs(self, variables):
+ self.param.B * Q_av
+ total_cooling_coefficient * (T_av - T_amb)
)
/ (self.param.C_th * self.param.rho)
/ (self.param.C_th * self.param.rho(T_av))
}

def set_boundary_conditions(self, variables):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def set_rhs(self, variables):
- edge_cooling_coefficient
* pybamm.source(T_av - T_amb, T_av, boundary=True)
)
/ (self.param.C_th * self.param.rho)
/ (self.param.C_th * self.param.rho(T_av))
}

# TODO: Make h_edge a function of position to have bottom/top/side cooled cells.
Expand Down
28 changes: 24 additions & 4 deletions pybamm/models/submodels/thermal/x_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,31 @@ def get_coupled_variables(self, variables):

def set_rhs(self, variables):
T = variables["Cell temperature"]
T_n, T_s, T_p = T.orphans

Q = variables["Total heating"]

# Define volumetric heat capacity
rho_k = pybamm.Concatenation(
self.param.rho_n(T_n),
self.param.rho_s(T_s),
self.param.rho_p(T_p),
)

# Devine thermal conductivity
lambda_k = pybamm.Concatenation(
self.param.lambda_n(T_n),
self.param.lambda_s(T_s),
self.param.lambda_p(T_p),
)

# Fourier's law for heat flux
q = -self.param.lambda_k * pybamm.grad(T)
q = -lambda_k * pybamm.grad(T)

# N.B only y-z surface cooling is implemented for this model
self.rhs = {
T: (-pybamm.div(q) / self.param.delta ** 2 + self.param.B * Q)
/ (self.param.C_th * self.param.rho_k)
/ (self.param.C_th * rho_k)
}

def set_boundary_conditions(self, variables):
Expand All @@ -68,11 +84,15 @@ def set_boundary_conditions(self, variables):
self.boundary_conditions = {
T: {
"left": (
self.param.h_cn * (T_n_left - T_amb) / self.param.lambda_n,
self.param.h_cn
* (T_n_left - T_amb)
/ self.param.lambda_n(T_n_left),
"Neumann",
),
"right": (
-self.param.h_cp * (T_p_right - T_amb) / self.param.lambda_p,
-self.param.h_cp
* (T_p_right - T_amb)
/ self.param.lambda_p(T_p_right),
"Neumann",
),
}
Expand Down
21 changes: 11 additions & 10 deletions pybamm/parameters/lead_acid_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,21 +617,12 @@ def _set_dimensionless_parameters(self):
self.rho_s = self.therm.rho_s
self.rho_p = self.therm.rho_p
self.rho_cp = self.therm.rho_cp
self.rho_k = self.therm.rho_k
self.rho = (
self.rho_cn * self.l_cn
+ self.rho_n * self.l_n
+ self.rho_s * self.l_s
+ self.rho_p * self.l_p
+ self.rho_cp * self.l_cp
) / self.l # effective volumetric heat capacity

self.lambda_cn = self.therm.lambda_cn
self.lambda_n = self.therm.lambda_n
self.lambda_s = self.therm.lambda_s
self.lambda_p = self.therm.lambda_p
self.lambda_cp = self.therm.lambda_cp
self.lambda_k = self.therm.lambda_k

self.Theta = self.therm.Theta

Expand All @@ -647,7 +638,7 @@ def _set_dimensionless_parameters(self):
* self.R
* self.T_ref
* self.tau_th_yz
/ (self.therm.rho_eff_dim * self.F * self.Delta_T * self.L_x)
/ (self.therm.rho_eff_dim(self.T_ref) * self.F * self.Delta_T * self.L_x)
)

self.T_amb_dim = self.therm.T_amb_dim
Expand Down Expand Up @@ -771,6 +762,16 @@ def a_p(self, x):
x_dim = x * self.L_x
return self.a_p_dimensional(x_dim) / self.a_p_typ

def rho(self, T):
"Dimensionless effective volumetric heat capacity"
return (
self.rho_cn(T) * self.l_cn
+ self.rho_n(T) * self.l_n
+ self.rho_s(T) * self.l_s
+ self.rho_p(T) * self.l_p
+ self.rho_cp(T) * self.l_cp
) / self.l

def _set_input_current(self):
"Set the input current"

Expand Down
21 changes: 11 additions & 10 deletions pybamm/parameters/lithium_ion_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,21 +572,12 @@ def _set_dimensionless_parameters(self):
self.rho_s = self.therm.rho_s
self.rho_p = self.therm.rho_p
self.rho_cp = self.therm.rho_cp
self.rho_k = self.therm.rho_k
self.rho = (
self.rho_cn * self.l_cn
+ self.rho_n * self.l_n
+ self.rho_s * self.l_s
+ self.rho_p * self.l_p
+ self.rho_cp * self.l_cp
) / self.l # effective volumetric heat capacity

self.lambda_cn = self.therm.lambda_cn
self.lambda_n = self.therm.lambda_n
self.lambda_s = self.therm.lambda_s
self.lambda_p = self.therm.lambda_p
self.lambda_cp = self.therm.lambda_cp
self.lambda_k = self.therm.lambda_k

self.Theta = self.therm.Theta

Expand All @@ -602,7 +593,7 @@ def _set_dimensionless_parameters(self):
* self.R
* self.T_ref
* self.tau_th_yz
/ (self.therm.rho_eff_dim * self.F * self.Delta_T * self.L_x)
/ (self.therm.rho_eff_dim(self.T_ref) * self.F * self.Delta_T * self.L_x)
)

self.T_amb_dim = self.therm.T_amb_dim
Expand Down Expand Up @@ -848,6 +839,16 @@ def c_p_init(self, x):
"Dimensionless initial concentration as a function of dimensionless position x"
return self.c_p_init_dimensional(x) / self.c_p_max

def rho(self, T):
"Dimensionless effective volumetric heat capacity"
return (
self.rho_cn(T) * self.l_cn
+ self.rho_n(T) * self.l_n
+ self.rho_s(T) * self.l_s
+ self.rho_p(T) * self.l_p
+ self.rho_cp(T) * self.l_cp
) / self.l

def _set_input_current(self):
"Set the input current"

Expand Down
Loading

0 comments on commit 77e0767

Please sign in to comment.