コード例 #1
0
def burn(reactant, O2=0, Water=0, CO2=0, SO2=0, NO2=0, N2=0, Ash=0, NaOH=0):
    r = rxn.Reaction(
        f"{reactant} + {O2}O2 -> {Water}Water + {CO2}CO2 + {Ash}Ash + "
        f"{SO2}SO2 + {NO2}NO2 + {N2}N2 + {NaOH}NaOH", reactant, 1.)
    cmp = getattr(species, reactant)
    species.Water.P = 101325
    species.Water.T = 298.15
    cmp.Hc = (cmp.Hf - (Water * species.Water.Hf + CO2 * species.CO2.Hf +
                        SO2 * species.SO2.Hf + NO2 * species.NO2.Hf) -
              Water * species.Water.Hvapm)
    return r
コード例 #2
0
def burn(reactant, O2=0, H2O=0, CO2=0, SO2=0, NO2=0, N2=0, Ash=0, NaOH=0):
    r = rxn.Reaction(
        f"{reactant} + {O2}O2 -> {H2O}H2O + {CO2}CO2 + {Ash}Ash + "
        f"{SO2}SO2 + {NO2}NO2 + {N2}N2 + {NaOH}NaOH", reactant, 1.)
    cmp = getattr(species, reactant)
    species.H2O.P = 101325
    species.H2O.T = 298.15
    cmp.Hc = (cmp.Hf - (H2O * species.H2O.Hf + CO2 * species.CO2.Hf +
                        SO2 * species.SO2.Hf + NO2 * species.NO2.Hf) -
              H2O * species.H2O.Hvapm)
    return r
コード例 #3
0
def anaerobic_rxn(reactant):
    MW = getattr(species, reactant).MW
    return rxn.Reaction(
        f"{1/MW}{reactant} -> {P_ch4}CH4 + {P_co2}CO2 + {P_sludge}WWTsludge",
        reactant, 0.91)
コード例 #4
0
def growth(reactant):
    f = getattr(species, reactant).MW / species.WWTsludge.MW
    return rxn.Reaction(f"{f}{reactant} -> WWTsludge", reactant, 1.)
コード例 #5
0
mass /= mass.sum()
mass *= 0.86 / (0.91)
P_ch4, P_co2 = mass / MW


def anaerobic_rxn(reactant):
    MW = getattr(species, reactant).MW
    return rxn.Reaction(
        f"{1/MW}{reactant} -> {P_ch4}CH4 + {P_co2}CO2 + {P_sludge}WWTsludge",
        reactant, 0.91)


# TODO: Revise this with Jeremy
anaerobic_digestion = rxn.ParallelReaction(
    [anaerobic_rxn(i)
     for i in organics] + [rxn.Reaction(f"H2SO4 -> H2S + 2O2", 'H2SO4', 1.)])

# Note, nitogenous species included here, but most of it removed in R601 digester
# TODO: Add ammonium to reaction, make sure it can be a liquid, possibly add Henry's constant
aerobic_digestion = rxn.ParallelReaction([
    i * 0.74 + 0.22 * growth(i.reactant) for i in combustion
    if (i.reactant in organics)
])
aerobic_digestion.X[:] = 0.96

splits = [('Ethanol', 1, 15), ('Water', 27158, 356069), ('Glucose', 3, 42),
          ('Xylose', 7, 85), ('OtherSugars', 13, 175),
          ('SugarOligomers', 10, 130), ('OrganicSolubleSolids', 182, 2387),
          ('InorganicSolubleSolids', 8, 110), ('Ammonia', 48, 633),
          ('AceticAcid', 0, 5), ('Furfurals', 5, 70),
          ('OtherOrganics', 9, 113), ('Cellulose', 19, 6), ('Xylan', 6, 2),