Skip to content

Commit

Permalink
added checking to see if nonisothermal parameters are input
Browse files Browse the repository at this point in the history
  • Loading branch information
lightningclaw001 committed Jul 18, 2022
1 parent 96435ac commit 553979e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
4 changes: 2 additions & 2 deletions configs/params_system.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ G_stddev_a = 0
[Thermal Parameters]
# Heat capacity of anode, cathode, electrolyte material in J/(kg*K).
cp_c = 700
cp_l = 700
cp_s = 700
cp_a = 700
# Mass density of anode, cathode, and electrolyte materialin kg/m^3.
rhom_c = 2500
rhom_l = 1100
rhom_s = 1100
rhom_a = 2500
# Heat transfer coefficient with the cell separator (W/(m^2*K))
h_h = 2e4
Expand Down
11 changes: 11 additions & 0 deletions mpet/config/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,12 @@ def _scale_electrode_parameters(self):
self['cp'][trode] = self['cp'][trode] / \
(self['k_h_ref'] * self['t_ref'] / (self['rho_ref']*self['L_ref']**2))
self['rhom'][trode] = self['rhom'][trode] / self['rho_ref']
if self['nonisothermal']:
if self['rhom'][trode] == 0 or self['cp'][trode] == 0 or self['k_h'][trode] == 0:
raise Exception(
"Please provide all nonisothermal parameters for the "
+ trode
+ " electrode and ensure they are nonzero")

if self[trode, 'lambda'] is not None:
self[trode, 'lambda'] = self[trode, 'lambda'] / kT
Expand All @@ -527,6 +533,11 @@ def _scale_electrode_parameters(self):
self['cp']['s'] = self['cp']['s'] / \
(self['k_h_ref'] * self['t_ref'] / (self['rho_ref']*self['L_ref']**2))
self['rhom']['s'] = self['rhom']['s'] / self['rho_ref']
if self['nonisothermal']:
if self['rhom']['s'] == 0 or self['cp']['s'] == 0 or self['k_h']['s'] == 0:
raise Exception(
"Please provide all nonisothermal parameters for the "
+ " separator and ensure they are nonzero")

def _scale_macroscopic_parameters(self, Vref):
"""
Expand Down
20 changes: 10 additions & 10 deletions mpet/config/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ def tobool(value):
'BruggExp_c': Use(float),
'BruggExp_a': Use(float),
'BruggExp_s': Use(float)},
'Thermal Parameters': {Optional('cp_c', default=1e8): Use(float),
Optional('cp_a', default=1e8): Use(float),
Optional('cp_s', default=1e8): Use(float),
Optional('rhom_c', default=0.2): Use(float),
Optional('rhom_a', default=0.2): Use(float),
Optional('rhom_s', default=0.2): Use(float),
Optional('k_h_c', default=0.2): Use(float),
Optional('k_h_a', default=0.2): Use(float),
Optional('k_h_s', default=0.2): Use(float),
Optional('h_h', default=500): Use(float),
'Thermal Parameters': {Optional('cp_c', default=0): Use(float),
Optional('cp_a', default=0): Use(float),
Optional('cp_s', default=0): Use(float),
Optional('rhom_c', default=0): Use(float),
Optional('rhom_a', default=0): Use(float),
Optional('rhom_s', default=0): Use(float),
Optional('k_h_c', default=0): Use(float),
Optional('k_h_a', default=0): Use(float),
Optional('k_h_s', default=0): Use(float),
Optional('h_h', default=0): Use(float),
Optional('entropy_heat_gen', default=False): Use(tobool)},
'Electrolyte': {'c0': Use(float),
'zp': Use(int),
Expand Down

0 comments on commit 553979e

Please sign in to comment.