def equilibrium_inverse_with_h2o_nacl_caco3_co2_calcite_fixed_phase_volume(): """ Build a problem with H2O, NaCl, CaCO3, CO2 and Calcite with fixed values of phase volume """ 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.fixPhaseVolume("Gaseous", 0.2, "m3", "CO2") problem.fixPhaseVolume("Aqueous", 0.3, "m3", "1 kg H2O; 0.1 mol NaCl") problem.fixPhaseVolume("Calcite", 0.5, "m3", "CaCO3") return (system, problem)
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)
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)
def equilibrium_inverse_with_h_o_na_cl_ca_mg_c_defined_ph(): """ Build a problem with H, Na, Cl, Ca, Mg, C with 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(4.0, "CO2") return (system, problem)
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)
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)