mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Reformatted ThermoPhase/changed property getter methods/add docstrings.
This commit is contained in:
parent
aae531a8ba
commit
6b1bcd089a
@ -73,6 +73,7 @@ classdef Solution < handle & ThermoPhase & Kinetics & Transport
|
||||
trans = 'default';
|
||||
end
|
||||
s@Transport(tp, trans, 0);
|
||||
s.tpClear;
|
||||
s.tpID = tp.tpID;
|
||||
end
|
||||
|
||||
@ -80,6 +81,7 @@ classdef Solution < handle & ThermoPhase & Kinetics & Transport
|
||||
|
||||
function delete(s)
|
||||
% Delete :mat:class:`Solution` object.
|
||||
s.tpClear;
|
||||
|
||||
disp('Solution class object has been deleted');
|
||||
end
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -72,7 +72,7 @@ gas.TPX = {tinlet, p, comp1};
|
||||
% platinum.
|
||||
|
||||
surf_phase = Interface('ptcombust.yaml', 'Pt_surf', gas);
|
||||
surf_phase.T = tsurf;
|
||||
surf_phase.TP = {tsurf, surf_phase.P};
|
||||
|
||||
% integrate the coverage equations in time for 1 s, holding the gas
|
||||
% composition fixed to generate a good starting estimate for the
|
||||
|
@ -35,9 +35,7 @@ function equil(g)
|
||||
x(ich4, 1) = phi(i);
|
||||
x(io2, 1) = 2.0;
|
||||
x(in2, 1) = 7.52;
|
||||
gas.T = 300;
|
||||
gas.P = 101325;
|
||||
gas.X = x;
|
||||
gas.TPX = {300, 101325, x};
|
||||
gas.equilibrate('HP');
|
||||
tad(i) = gas.T;
|
||||
xeq(:, i) = gas.X;
|
||||
|
@ -117,8 +117,8 @@ function anCurr = anode_curr(phi_s, phi_l, X_Li_an, anode, elde, elyt, ...
|
||||
anode.X = ['Li[anode]:' num2str(X_Li_an) ', V[anode]:' num2str(1 - X_Li_an)];
|
||||
|
||||
% Set the electrode and electrolyte potential
|
||||
elde.setElectricPotential(phi_s);
|
||||
elyt.setElectricPotential(phi_l);
|
||||
elde.electricPotential = phi_s;
|
||||
elyt.electricPotential = phi_l;
|
||||
|
||||
% Get the net reaction rate at the anode-side interface
|
||||
% Reaction according to cti file: Li+[elyt] + V[anode] + electron <=> Li[anode]
|
||||
@ -134,8 +134,8 @@ function caCurr = cathode_curr(phi_s, phi_l, X_Li_ca, cathode, elde, elyt, catho
|
||||
cathode.X = ['Li[cathode]:' num2str(X_Li_ca) ', V[cathode]:' num2str(1 - X_Li_ca)];
|
||||
|
||||
% Set the electrode and electrolyte potential
|
||||
elde.setElectricPotential(phi_s);
|
||||
elyt.setElectricPotential(phi_l);
|
||||
elde.electricPotential = phi_s;
|
||||
elyt.electricPotential = phi_l;
|
||||
|
||||
% Get the net reaction rate at the cathode-side interface
|
||||
% Reaction according to cti file: Li+[elyt] + V[cathode] + electron <=> Li[cathode]
|
||||
|
@ -21,8 +21,7 @@ function reactor1(g)
|
||||
|
||||
P = 101325.0;
|
||||
% set the initial conditions
|
||||
gas.T = 1001.0;
|
||||
gas.P = P;
|
||||
gas.TP = {1001.0, P};
|
||||
nsp = gas.nSpecies;
|
||||
xx = zeros(nsp, 1);
|
||||
xx(1) = 0.285;
|
||||
@ -35,7 +34,7 @@ function reactor1(g)
|
||||
|
||||
% create a reservoir to represent the environment
|
||||
a = Solution('air.yaml', 'air', 'None');
|
||||
a.P = P;
|
||||
a.TP = {a.T, P};
|
||||
env = Reservoir(a);
|
||||
|
||||
% Define a wall between the reactor and the environment and
|
||||
|
@ -24,7 +24,7 @@ gas.TPX = {t, OneAtm, 'CH4:0.01, O2:0.21, N2:0.78'};
|
||||
% methane on platinum, and is from Deutschman et al., 26th
|
||||
% Symp. (Intl.) on Combustion,1996, pp. 1747-1754
|
||||
surf = Interface('ptcombust.yaml', 'Pt_surf', gas);
|
||||
surf.T = t;
|
||||
surf.TP = {t, surf.P};
|
||||
|
||||
nsp = gas.nSpecies;
|
||||
nSurfSp = surf.nSpecies;
|
||||
@ -98,7 +98,7 @@ subplot(2, 2, 3);
|
||||
semilogy(tim, cov);
|
||||
xlabel('Time (s)');
|
||||
ylabel('Coverages');
|
||||
legend(speciesNames(surf));
|
||||
legend(surf.speciesNames);
|
||||
subplot(2, 2, 4);
|
||||
plot(tim, x);
|
||||
xlabel('Time (s)');
|
||||
|
Loading…
Reference in New Issue
Block a user