Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing hydrolysis and fermentation reaction for different fermentation types in the 'Fermentation' unit #212

Open
SarvadaC opened this issue Jan 21, 2025 · 0 comments

Comments

@SarvadaC
Copy link

Hello,
I have been trying to work on a xylitol biorefinery using yeast. However, every time I call the 'Fermentation' unit the program uses the by default hydrolysis reaction in the 'NRELBioreactor.py'. How do I replace the reactions in the code for the xylitol biorefinery? Here's what I have been trying so far:

Code:
R301 = units.Fermentation ('R301',M101-0, outs=('CO2', ''), tau=9, efficiency=0.90, N=4)

def _init(self, tau, N=None, V=None, T=305.15, P=101325., Nmin=2, Nmax=36,
efficiency=None, iskinetic=False, fermentation_reaction=None,
cell_growth_reaction=None):
R301._init(self, tau=tau, N=N, V=V, T=T, P=P, Nmin=Nmin, Nmax=Nmax)
self._load_components()
self.iskinetic = iskinetic
chemicals = self.chemicals
self.hydrolysis_reaction = Reaction('Xylose -> Xylitol', 'Xylose', efficiency, chemicals)
if fermentation_reaction is None:
if efficiency is None: efficiency = 0.9
fermentation_reaction = Reaction('Xylose -> Xylitol', 'Xylose', efficiency, chemicals, basis='wt')
else:
efficiency = fermentation_reaction.X
self.fermentation_reaction = fermentation_reaction
if cell_growth_reaction is None:
cell_growth_reaction = Reaction('Xylose -> Yeast', 'Xylose', 0.70, chemicals, basis='wt')
cell_growth_reaction.basis = 'mol'
self.cell_growth_reaction = cell_growth_reaction
self.efficiency = efficiency

Output:
Traceback (most recent call last):

Cell In[7], line 1
R301 = units.Fermentation ('R301',M101-0, outs=('CO2', ''), tau=9, efficiency=0.90, N=4)

File ~\AppData\Local\anaconda3\Lib\site-packages\biosteam_unit.py:390 in init
super().init(ID, ins, outs, thermo, **kwargs)

File ~\AppData\Local\anaconda3\Lib\site-packages\thermosteam\network.py:1038 in init
self._init(**kwargs)

File ~\AppData\Local\anaconda3\Lib\site-packages\biosteam\units\nrel_bioreactor.py:372 in _init
self.hydrolysis_reaction = Reaction('Sucrose + Water -> 2Glucose', 'Sucrose', 1.00, chemicals)

File ~\AppData\Local\anaconda3\Lib\site-packages\thermosteam\reaction_reaction.py:314 in init
self._stoichiometry = prs.get_stoichiometric_array(reaction, chemicals)

File ~\AppData\Local\anaconda3\Lib\site-packages\thermosteam\reaction_parse.py:26 in get_stoichiometric_array
stoichiometric_array = dct2arr(stoichiometry_dict, chemicals)

File ~\AppData\Local\anaconda3\Lib\site-packages\thermosteam\reaction_parse.py:50 in dct2arr
raise UndefinedChemical(ID)

UndefinedChemicalAlias: 'Sucrose'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant