[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:
parent
5d6a97f89a
commit
13e707999f
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue