-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dave Goodwin
committed
Mar 12, 2004
1 parent
2351fc7
commit d298e3b
Showing
22 changed files
with
236 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,83 @@ | ||
# | ||
# an ideal Rankine cycle | ||
# an Rankine cycle | ||
# | ||
from Cantera import * | ||
from Cantera.pureFluids import Water | ||
from Cantera.liquidvapor import Water | ||
|
||
w = Water() | ||
# parameters | ||
eta_pump = 0.6 # pump isentropic efficiency | ||
et_turbine = 0.8 # turbine isentropic efficiency | ||
pmax = 8.0e5 # maximum pressure | ||
|
||
# start with saturated liquid water at 300 K | ||
w.setTemperature(300.0) | ||
w.setState_satLiquid() | ||
h1 = w.enthalpy_mass() | ||
p1 = w.pressure() | ||
######################################################## | ||
# | ||
# some useful functions | ||
# | ||
|
||
# pump it isentropically to 10 MPa | ||
w.setState_SP(w.entropy_mass(), 1.0e7) | ||
h2 = w.enthalpy_mass() | ||
def pump(fluid, pfinal, eta): | ||
"""Adiabatically pump a fluid to pressure pfinal, using | ||
a pump with isentropic efficiency eta.""" | ||
h0 = fluid.enthalpy_mass() | ||
s0 = fluid.entropy_mass() | ||
fluid.setState_SP(s0, pfinal) | ||
h1s = fluid.enthalpy_mass() | ||
isentropic_work = h1s - h0 | ||
actual_work = isentropic_work / eta | ||
h1 = h0 + actual_work | ||
fluid.setState_HP(h1, pfinal) | ||
return actual_work | ||
|
||
pump_work = h2 - h1 | ||
def expand(fluid, pfinal, eta): | ||
"""Adiabatically expand a fluid to pressure pfinal, using | ||
a turbine with isentropic efficiency eta.""" | ||
h0 = fluid.enthalpy_mass() | ||
s0 = fluid.entropy_mass() | ||
fluid.setState_SP(s0, pfinal) | ||
h1s = fluid.enthalpy_mass() | ||
isentropic_work = h0 - h1s | ||
actual_work = isentropic_work * eta | ||
h1 = h0 - actual_work | ||
fluid.setState_HP(h1, pfinal) | ||
return actual_work | ||
|
||
# heat at constant pressure to 1500 K | ||
w.setState_TP(1500.0, w.pressure()) | ||
h3 = w.enthalpy_mass() | ||
############################################################### | ||
|
||
heat_in = h3 - h2 | ||
|
||
# expand isentropically back to 300 K | ||
w.setState_SP(w.entropy_mass(), p1) | ||
h4 = w.enthalpy_mass() | ||
# create an object representing water | ||
w = Water() | ||
|
||
# start with saturated liquid water at 300 K | ||
w.setTemperature(300.0) | ||
w.setState_Tsat(0.0) | ||
hf = w.enthalpy_mass() | ||
print w | ||
w.setState_Tsat(1.0) | ||
hv = w.enthalpy_mass() | ||
print hv - hf | ||
|
||
print w | ||
|
||
work_out = h3 - h4 | ||
heat_out = h4 - h1 | ||
# pump it adiabatically to pmax | ||
pump_work = pump(w, pmax, eta_pump) | ||
print pump_work | ||
|
||
efficiency = (work_out - pump_work)/heat_in | ||
# heat it at constant pressure until it reaches the | ||
# saturated vapor state at this pressure | ||
#w.setState_Psat(1.0) | ||
#print w | ||
|
||
print 'efficiency = ',efficiency | ||
w.setTemperature(273.16) | ||
w.setState_Tsat(0.0) | ||
h0 = w.enthalpy_mass() | ||
for t in [300.0, 350.0, 400.0, 450.0, 500.0]: | ||
w.setTemperature(t) | ||
w.setState_Tsat(0.0) | ||
hf = w.enthalpy_mass() | ||
w.setState_Tsat(1.0) | ||
hv = w.enthalpy_mass() | ||
print t, 0.001*(hf - h0), 0.001*(hv - h0), 0.001*(hv - hf) | ||
|
||
for t in [750.0, 800.0, 850.0, 1150.0]: | ||
w.setState_TP(t, 2.0e4) | ||
print t, w.enthalpy_mass() - h0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.