Skip to content

Commit

Permalink
Use camelCase-style timeControl
Browse files Browse the repository at this point in the history
  • Loading branch information
augustjohansson committed Jul 3, 2024
1 parent 6261bd9 commit 797ac73
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 116 deletions.
16 changes: 8 additions & 8 deletions Battery/BatteryInputParams.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
ctrl = 'Control';

jsontruct = setDefaultJsonStructField(jsonstruct, 'include_current_collectors', false);

jsonstruct = equalizeJsonStructFields(jsonstruct, {'include_current_collectors' , ...
{ne, 'include_current_collectors'}, ...
{pe, 'include_current_collectors'}});

if getJsonStructField(jsonstruct, {pe, 'include_current_collectors'})
jsonstruct = setDefaultJsonStructField(jsonstruct, {pe, 'use_normed_current_collector'}, true);
end

jsonstruct = setDefaultJsonStructField(jsonstruct, 'use_thermal', false);

jsonstruct = equalizeJsonStructFields(jsonstruct, {{'use_thermal'} , ...
{ne, 'use_thermal'} , ...
{pe, 'use_thermal'} , ...
Expand All @@ -57,11 +57,11 @@

jsonstruct = setDefaultJsonStructField(jsonstruct, {ne, co, 'activeMaterialModelSetup', 'composite'}, false);
jsonstruct = setDefaultJsonStructField(jsonstruct, {pe, co, 'activeMaterialModelSetup', 'composite'}, false);

use_thermal = getJsonStructField(jsonstruct, 'use_thermal');

if use_thermal

iscomp1 = getJsonStructField(jsonstruct, {ne, co, 'activeMaterialModelSetup', 'composite'});
iscomp2 = getJsonStructField(jsonstruct, {pe, co, 'activeMaterialModelSetup', 'composite'});
assert(~iscomp1 && ~iscomp2, 'We do not support for the moment thermal simulation for composite materials');
Expand All @@ -78,7 +78,7 @@
inputparams.(elyte) = ElectrolyteInputParams(pick(elyte));
inputparams.(sep) = SeparatorInputParams(pick(sep));
inputparams.(thermal) = ThermalComponentInputParams(pick(thermal));

switch jsonstruct.(ctrl).controlPolicy
case 'Impedance'
inputparams.(ctrl) = ImpedanceControlModelInputParams(pick(ctrl));
Expand All @@ -92,7 +92,7 @@
inputparams.(ctrl) = CcCvControlModelInputParams(pick(ctrl));
case 'powerControl'
inputparams.(ctrl) = PowerControlModelInputParams(pick(ctrl));
case 'timecontrol'
case 'timeControl'
inputparams.(ctrl) = TimeControlModelInputParams(pick(ctrl));
otherwise
error('controlPolicy %s not recognized', jsonstruct.(ctrl).controlPolicy);
Expand Down
Loading

0 comments on commit 797ac73

Please sign in to comment.