Example #1
0
def equilibrium_inverse_with_h2o_nacl_caco3_co2_fixed_mass_amount_and_alkalinity():
    """
    Build a problem with H2O, NaCl, CaCO3, CO2 and Calcite 
    with fixed values of Species Mass, Amount and alkalinity 
    """
    editor = ChemicalEditor()
    editor.addAqueousPhase("H2O NaCl CaCO3")
    editor.addGaseousPhase(["H2O(g)", "CO2(g)"])
    editor.addMineralPhase("Calcite")

    system = ChemicalSystem(editor)

    problem = EquilibriumInverseProblem(system)
    problem.add("H2O", 1, "kg")
    problem.add("NaCl", 0.1, "mol")
    problem.fixSpeciesMass("Calcite", 100, "g")
    problem.fixSpeciesAmount("CO2(g)", 1.0, "mol")
    problem.alkalinity(25.0, "meq/L", "Cl")

    return (system, problem)
Example #2
0
def equilibrium_inverse_with_h_o_na_cl_ca_c_calcite_ph_and_fixed_amounts():
    """
    Build a problem with H, O, Na, Cl, Ca, C and Calcite with defined pH 
    and fixed species amount  
    """
    database = Database("supcrt98.xml")

    editor = ChemicalEditor(database)
    editor.addAqueousPhase("H O Na Cl Ca C")
    editor.addMineralPhase("Calcite")

    system = ChemicalSystem(editor)

    problem = EquilibriumInverseProblem(system)
    problem.add("H2O", 1, "kg")
    problem.add("NaCl", 0.1, "mol")
    problem.pH(8.0, "HCl", "NaOH")
    problem.fixSpeciesAmount("Calcite", 1, "mol")

    return (system, problem)
Example #3
0
def equilibrium_inverse_with_h2o_nacl_caco3_calcilte_and_fixed_mass():
    """
    Build a problem with H2O, NaCL, CaCO3, CO2, Calcite with fixed
    species mass and amount  
    """
    database = Database("supcrt98.xml")

    editor = ChemicalEditor(database)
    editor.addAqueousPhase("H2O NaCl CaCO3")
    editor.addGaseousPhase(["H2O(g)", "CO2(g)"])
    editor.addMineralPhase("Calcite")

    system = ChemicalSystem(editor)

    problem = EquilibriumInverseProblem(system)
    problem.add("H2O", 1, "kg")
    problem.add("NaCl", 0.1, "mol")
    problem.fixSpeciesMass("Calcite", 100, "g")
    problem.fixSpeciesAmount("CO2(g)", 1.0, "mol")

    return (system, problem)
Example #4
0
def equilibrium_inverse_with_h_o_na_cl_ca_mg_c_fixed_amount_and_activity():
    """
    Build a problem with H, Na, Cl, Ca, Mg, C with fixed
    species amount, activity and defined pH  
    """

    database = Database("supcrt98.xml")

    editor = ChemicalEditor(database)
    editor.addAqueousPhase("H O Na Cl Ca Mg C")
    editor.addGaseousPhase("H O C")

    system = ChemicalSystem(editor)

    problem = EquilibriumInverseProblem(system)
    problem.add("H2O", 1, "kg")
    problem.add("NaCl", 0.1, "mol")
    problem.add("CaCl2", 2, "mmol")
    problem.add("MgCl2", 4, "mmol")
    problem.pH(3.0, "HCl")
    problem.fixSpeciesAmount("CO2(g)", 1.0, "mol")
    problem.fixSpeciesActivity("O2(g)", 0.20)

    return (system, problem)