Hello, may I ask you some questions about @unit.add_specification? Thanks for your help.
a) If I adjust pressure drop of the unit, are both of the following codes correct?
The only difference between the two codes is that the first code first runs unit._run(), then run P0 = min([i.P for i in unit.ins]), Pf = P0 - unit.dP, for i in unit.outs: i.P = Pf, and the second code first runs P0 = min([i.P for i in unit.ins]), Pf = P0 - unit.dP, for i in unit.outs: i.P = Pf, and then runs unit._run(), is it right?
Both two codes do not need to add code like unit.run_until(), is it right?
It seems first run P0 = min([i.P for i in unit.ins]), Pf = p0-unit. dP, for i in unit.outs: i.P = Pf, then runs unit._run(), that is, the second type of code is more appropriate to adjust the unit pressure drop? Because it seems to reduce the unit outlet pressure first, and then run the unit to get the corresponding flow mass and heat conditions.
The two codes are as follows:
unit.dP = 0.04
@unit.add_specification(run=False)
def set_dP():
unit._run()
P0 = min([i.P for i in unit.ins])
Pf = P0 - unit.dP
for i in unit.outs: i.P = Pf
unit.dP = 0.04
@unit.add_specification(run=True)
def set_dP():
P0 = min([i.P for i in unit.ins])
Pf = P0 - unit.dP
for i in unit.outs: i.P = Pf
b) If I want to increase the pressure of the outlet stream of the previous unit (such as H101) through a pump (such as P101, i.e. the pressure of H101 outlet plus 10132.5), and then act as the inlet stream of the later unit (such as F101), could I consult you which of the following two codes is correct?
There can be other codes between P101=units.Pump('P101', H101-0, P=101325) and @P101.add_specification(run=True), is it right?
Both two codes do not need to add code like unit.run_until(), is it right?
The codes are as follows:
c) In def() in @unit.add_specification, def(), there is no need to add the code unit.run_until(), is it right? If no need to add the code unit.run_until(), how can we ensure that the unit that is @ and the units that after the unit that is @ are rerun after the specification is executed?
d) When using @unit.add_specification, how to select the unit that is @?
Hello, may I ask you some questions about
@unit.add_specification
? Thanks for your help.a) If I adjust pressure drop of the unit, are both of the following codes correct? The only difference between the two codes is that the first code first runs
unit._run()
, then runP0 = min([i.P for i in unit.ins]), Pf = P0 - unit.dP, for i in unit.outs: i.P = Pf
, and the second code first runsP0 = min([i.P for i in unit.ins]), Pf = P0 - unit.dP, for i in unit.outs: i.P = Pf
, and then runsunit._run()
, is it right? Both two codes do not need to add code likeunit.run_until()
, is it right? It seems first runP0 = min([i.P for i in unit.ins]), Pf = p0-unit. dP, for i in unit.outs: i.P = Pf
, then runsunit._run()
, that is, the second type of code is more appropriate to adjust the unit pressure drop? Because it seems to reduce the unit outlet pressure first, and then run the unit to get the corresponding flow mass and heat conditions. The two codes are as follows:b) If I want to increase the pressure of the outlet stream of the previous unit (such as
H101
) through a pump (such asP101
, i.e. the pressure ofH101
outlet plus 10132.5), and then act as the inlet stream of the later unit (such asF101
), could I consult you which of the following two codes is correct? There can be other codes betweenP101=units.Pump('P101', H101-0, P=101325)
and@P101.add_specification(run=True)
, is it right? Both two codes do not need to add code likeunit.run_until()
, is it right? The codes are as follows:c) In
def()
in@unit.add_specification, def()
, there is no need to add the codeunit.run_until()
, is it right? If no need to add the codeunit.run_until()
, how can we ensure that the unit that is @ and the units that after the unit that is @ are rerun after the specification is executed?d) When using
@unit.add_specification
, how to select the unit that is @?