Skip to content

Commit

Permalink
Include current collectors
Browse files Browse the repository at this point in the history
  • Loading branch information
augustjohansson committed Feb 27, 2023
1 parent 66d693d commit 8c41408
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
25 changes: 14 additions & 11 deletions Examples/runBattery2D.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
% provided in json format. All the parameters for the model are stored in
% the paramobj object.
jsonstruct = parseBattmoJson(fullfile('ParameterData','BatteryCellParameters','LithiumIonBatteryCell','lithium_ion_battery_nmc_graphite.json'));
jsonstruct.include_current_collectors = true;
paramobj = BatteryInputParams(jsonstruct);

% We define some shorthand names for simplicity.
Expand Down Expand Up @@ -55,18 +56,20 @@
% The mesh is plotted using the plotGrid() function from MRST.
colors = crameri('vik', 5);
figure
plotGrid(model.(ne).(cc).G, 'facecolor', colors(1,:), 'edgealpha', 0.5, 'edgecolor', [1, 1, 1]);
plotGrid(model.(ne).(am).G, 'facecolor', colors(2,:), 'edgealpha', 0.5, 'edgecolor', [1, 1, 1]);
plotGrid(model.(elyte).(sep).G, 'facecolor', colors(3,:), 'edgealpha', 0.5, 'edgecolor', [1, 1, 1]);
plotGrid(model.(pe).(am).G, 'facecolor', colors(4,:), 'edgealpha', 0.5, 'edgecolor', [1, 1, 1]);
plotGrid(model.(pe).(cc).G, 'facecolor', colors(5,:), 'edgealpha', 0.5, 'edgecolor', [1, 1, 1]);
legtext = {};
edgeparams = {'edgealpha', 0.5, 'edgecolor', [1, 1, 1]};
plotGrid(model.(ne).(am).G, 'facecolor', colors(2,:), edgeparams{:});
plotGrid(model.(elyte).(sep).G, 'facecolor', colors(3,:), edgeparams{:});
plotGrid(model.(pe).(am).G, 'facecolor', colors(4,:), edgeparams{:});
legtext = [legtext, {'negative electrode active material', 'separator', 'positive electrode current collector'}];
if model.include_current_collectors
plotGrid(model.(ne).(cc).G, 'facecolor', colors(1,:), edgeparams{:});
plotGrid(model.(pe).(cc).G, 'facecolor', colors(5,:), edgeparams{:});
legtext{end+1} = 'negative electrode current collector';
legtext{end+1} = 'positive electrode current collector';
end
legend(legtext, 'location', 'southwest');
axis tight;
legend({'negative electrode current collector' , ...
'negative electrode active material' , ...
'separator' , ...
'positive electrode active material' , ...
'positive electrode current collector'}, ...
'location', 'southwest'),
setFigureStyle('quantity', 'single');
drawnow();
pause(0.1);
Expand Down
3 changes: 2 additions & 1 deletion Examples/runBattery2DMech.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
%% Setup the properties of Li-ion battery materials and cell design

jsonstruct = parseBattmoJson(fullfile('ParameterData','BatteryCellParameters','LithiumIonBatteryCell','lithium_ion_battery_nmc_graphite.json'));
jsonstruct.include_current_collectors = true;

% We define some shorthand names for simplicity.
ne = 'NegativeElectrode';
Expand Down Expand Up @@ -195,7 +196,7 @@

%% We run the mechanical simulation for each time step

state0 = initstate
state0 = initstate;
figure
plotGrid(G)
ax = axis();
Expand Down
2 changes: 2 additions & 0 deletions Examples/runBattery3D.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
% provided in json format. All the parameters for the model are stored in
% the paramobj object.
jsonstruct = parseBattmoJson(fullfile('ParameterData','BatteryCellParameters','LithiumIonBatteryCell','lithium_ion_battery_nmc_graphite.json'));
jsonstruct.include_current_collectors = true;

paramobj = BatteryInputParams(jsonstruct);

% We define some shorthand names for simplicity.
Expand Down
1 change: 1 addition & 0 deletions Examples/runGittTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
% provided in json format. All the parameters for the model are stored in
% the paramobj object.
jsonstruct = parseBattmoJson(fullfile('ParameterData','BatteryCellParameters','LithiumIonBatteryCell','lithium_ion_battery_nmc_graphite.json'));
jsonstruct.include_current_collectors = true;
paramobj = BatteryInputParams(jsonstruct);

% We define some shorthand names for simplicity.
Expand Down

0 comments on commit 8c41408

Please sign in to comment.