Can I Model A Boiler w/ Blowdown as a Node, and how to add Qin? #598
energydatachpguy
started this conversation in
General
Replies: 1 comment 2 replies
-
Hi John and thanks for reaching out! That is actually possible, and it is not even too complicated. In the very basic version, we could just ignore the heat transfer (in the sense, that we do not include it in the parameter list). You can inherit from the from tespy.components import Source, Sink, Splitter
from tespy.connections import Connection
from tespy.networks import Network
class BoilerWithBlowdown(Splitter):
def get_mandatory_constraints(self):
constraints = super().get_mandatory_constraints()
del constraints["energy_balance_constraints"]
return constraints
nw = Network()
water = Source("water")
blowdown = Sink("blowdown")
steam = Sink("main steam")
boiler = BoilerWithBlowdown("boiler")
c1 = Connection(water, "out1", boiler, "in1", label="1")
c2 = Connection(boiler, "out1", steam, "in1", label="2")
c3 = Connection(boiler, "out2", blowdown, "in1", label="3")
nw.add_conns(c1, c2, c3)
c1.set_attr(fluid={"water": 1}, m=10, p=100e5, Td_bp=-50)
c2.set_attr(Td_bp=50)
c3.set_attr(m=0.2, x=1)
nw.solve("design") For more advanced component, i.e. you want to be able to specify a
from tespy.components import Source, Sink, Splitter, SimpleHeatExchanger
from tespy.connections import Connection
from tespy.networks import Network
from tespy.tools.data_containers import ComponentProperties as dc_cp
class BoilerWithBlowdown(Splitter):
def get_mandatory_constraints(self):
constraints = super().get_mandatory_constraints()
del constraints["energy_balance_constraints"]
return constraints
def get_parameters(self):
parameters = super().get_parameters()
parameters["Q"] = dc_cp(
func=self.Q_func, deriv=self.Q_deriv, min_val=0, max_val=1e15,
num_eq=1
)
return parameters
def calc_Q(self):
return (
self.outl[0].m.val_SI * self.outl[0].h.val_SI
+ self.outl[1].m.val_SI * self.outl[1].h.val_SI
- self.inl[0].m.val_SI * self.inl[0].h.val_SI
)
def Q_func(self):
return self.calc_Q() - self.Q.val
def Q_deriv(self, increment_filter, k):
if self.inl[0].m.is_var:
self.jacobian[k, self.inl[0].m.J_col] = -self.inl[0].h.val_SI
if self.inl[0].h.is_var:
self.jacobian[k, self.inl[0].h.J_col] = -self.inl[0].m.val_SI
for o in self.outl:
if o.m.is_var:
self.jacobian[k, o.m.J_col] = o.h.val_SI
if o.h.is_var:
self.jacobian[k, o.h.J_col] = o.m.val_SI
def calc_parameters(self):
self.Q.val = self.calc_Q()
nw = Network()
water = Source("water")
blowdown = Sink("blowdown")
steam = Sink("main steam")
boiler = BoilerWithBlowdown("boiler")
c1 = Connection(water, "out1", boiler, "in1", label="1")
c2 = Connection(boiler, "out1", steam, "in1", label="2")
c3 = Connection(boiler, "out2", blowdown, "in1", label="3")
nw.add_conns(c1, c2, c3)
c1.set_attr(fluid={"water": 1}, m=10, p=100e5, Td_bp=-50)
c3.set_attr(m=0.2, x=1)
c2.set_attr(Td_bp=50)
nw.solve("design")
c1.set_attr(m=None)
boiler.set_attr(Q=20e6)
nw.solve("design")
nw.print_results() I have not verified if things are fully correct, it is just a quick draft, which you can make the next steps on! :) Have a nice weekend! Francesco |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey Francisco,
I would like to treat a boiler as a "black box" but still be able to have a blowdown bit, without going into the detail required to set it up as internal components,( ie drum, evap, superheater, economizer , etc..) , I would love if i could just set the states of the main steam, the states of the pressurized water post BFP, and pull blowdown at some set predefined condition.
I think I could do this and just have the solver work out the mass flows for a given heat input, or heat input for a given mass flow, but I am wondering if there is a way to have a Q_in, as I show in red arrow for a "node/ merge point component" in the tespy library.
Overall I would like to use the cleaver brooks datasheet for a package boiler, make an assumption that the header and input states hardly change, and model it as a black box for now.
Could you help me if this is possible?
Warm regards,
John
Beta Was this translation helpful? Give feedback.
All reactions