BioSTEAMDevelopmentGroup / Bioindustrial-Park

BioSTEAM's Premier Repository for Biorefinery Models and Results
MIT License
36 stars 17 forks source link

Consultation on initial flow of stream #152

Open zasddsgg opened 5 days ago

zasddsgg commented 5 days ago

Hello, when I use the following code framework to solve the flow of stream makeup_chemical_a and run the system, I will encounter an error InfeasibleRegion: < reactor R: R101> conversion of 'chemical b' is over 100%; reaction conversion is infeasible. It seems that the flow of stream chemical_b is insufficient, but I have passed the specification(@M102.add_specification(run=True)) to solve the required chemical_b stream flow (which is sufficient for the reactor R). Besides, the input flow rate (2000) when defining the chemical_b stream (chemical_b = bst.Stream(total_flow=2000)) is the same as the flow rate of the chemical_b stream obtained by the specification(@M102.add_specification(run=True)).

When I try to increase the input flow rate of the chemical_b stream to 5000 (chemical_b = bst.Stream(total_flow=5000)), there is no error. But in fact the reactor R only needs 2000, and the actual mass of chemical_b stream after operation is still 2000, so could I consult you why is there above error InfeasibleRegion: < reactor R: R101> conversion of 'chemical b' is over 100%; reaction conversion is infeasible? If I want to define chemical_b flow as 2000 instead of 5000 when defining the chemical_b stream (chemical_b = bst.Stream(total_flow=2000)) without above error, could I ask you what code I need to add? Thanks for your help. Wish you a good day.

The process flow is as follows. 1

The code framework is as follows.

makeup_chemical a = bst.Stream(
    ID=' makeup_chemical_a',
    price=0.57,
    total_flow=1000,
    units='kg/hr',
    chemical a=1,
) 

chemical_b = bst.Stream(
    ID=' chemical_b',
    price=0.3, 
    total_flow=2000, # if total_flow=5000, no error reports
    units='kg/hr',
    chemical b=1,
)

Sugar= bst.Stream(
    ID=' Sugar ',
    price=0.1, 
    total_flow=5000, 
    units='kg/hr',
    glucose=0.2,
    xylose=0.3,
    mannose=0.5,
)

recovery_chemical_a= bst.Stream(ID='recovery_chemical_a ')

M101 = units.Mixer('M101', [makeup_chemical_a, recovery_chemical_a])
Stream a = M101-0
M101.chemical_a_loading_per_dry_mass = 15
Required_mass_ chemical_a = M101.chemical_a_loading_per_dry_mass * Sugar.F_mass

@M101.add_specification()
def M101_chemical_a_spec():
    makeup_chemical_a.empty()  
    makeup_chemical_a.imass['chemical a'] = max(0., Required_mass_ chemical_a- recovery_chemical_a.imass['chemical a']) 
    M101._run()

M102 =bst.Mixer('M102', [M101-0, Sugar, chemical_b])
@M102.add_specification(run=True)
def update_chemical_b_loading():
    chemical_b.imass[‘chemical b’] = Required_mass_ chemical_a / 30