From 13e707999f46977ba0e08245d86e96600889bd34 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 16 Jul 2013 22:09:59 +0000 Subject: [PATCH] [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. --- samples/matlab/reactor1.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/matlab/reactor1.m b/samples/matlab/reactor1.m index 9a9e989a1..a15af66c6 100644 --- a/samples/matlab/reactor1.m +++ b/samples/matlab/reactor1.m @@ -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