[Matlab/Examples] Make constant pressure reactor example more explicit

Both the reactor and the adjacent reservoir need to have the same pressure. This
example relied on the fact that the default pressure of the 'air' phase is 1
atm, which caused it to break if the user changed the pressure of the reactor
gas.
This commit is contained in:
Ray Speth 2013-07-16 22:09:59 +00:00
parent 5d6a97f89a
commit 13e707999f

View file

@ -20,14 +20,16 @@ end
nsp = nSpecies(gas);
P = oneatm
% set the initial conditions
set(gas,'T',1001.0,'P',oneatm,'X','H2:2,O2:1,N2:4');
set(gas,'T',1001.0,'P',P,'X','H2:2,O2:1,N2:4');
% create a reactor, and insert the gas
r = Reactor(gas);
% create a reservoir to represent the environment
a = IdealGasMix('air.cti');
set(a,'P',P)
env = Reservoir(a);
% Define a wall between the reactor and the environment and