Пример #1
0
    def test_public_functions(self):
        param = pybamm.standard_parameters_lead_acid

        a = pybamm.Scalar(0)
        variables = {
            "Current collector current density":
            a,
            "Negative electrolyte current density":
            pybamm.PrimaryBroadcast(a, ["negative electrode"]),
            "Positive electrolyte current density":
            pybamm.PrimaryBroadcast(a, ["positive electrode"]),
            "Negative electrode porosity":
            a,
            "Positive electrode porosity":
            a,
            "Separator electrolyte potential":
            a,
            "Positive electrode surface potential difference":
            a,
        }
        submodel = pybamm.electrode.ohm.SurfaceForm(param, "Negative")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        submodel = pybamm.electrode.ohm.SurfaceForm(param, "Positive")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
    def test_public_functions(self):
        param = pybamm.LithiumIonParameters()

        a_n = pybamm.FullBroadcast(
            pybamm.Scalar(1), "negative electrode", {"secondary": "current collector"}
        )
        a_p = pybamm.FullBroadcast(
            pybamm.Scalar(1), "positive electrode", {"secondary": "current collector"}
        )

        variables = {
            "Negative electrode interfacial current density": a_n,
            "Negative electrode temperature": a_n,
            "Negative electrode active material volume fraction": a_n,
            "Negative electrode surface area to volume ratio": a_n,
            "Negative particle radius": a_n,
        }

        submodel = pybamm.particle.FickianManyParticles(param, "Negative")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        variables = {
            "Positive electrode interfacial current density": a_p,
            "Positive electrode temperature": a_p,
            "Positive electrode active material volume fraction": a_p,
            "Positive electrode surface area to volume ratio": a_p,
            "Positive particle radius": a_p,
        }
        submodel = pybamm.particle.FickianManyParticles(param, "Positive")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #3
0
    def test_public_functions(self):
        param = pybamm.standard_parameters_lead_acid

        a = pybamm.Scalar(0)
        a_n = pybamm.PrimaryBroadcast(pybamm.Scalar(0), ["negative electrode"])
        a_p = pybamm.PrimaryBroadcast(pybamm.Scalar(0), ["positive electrode"])
        variables = {
            "Current collector current density": a,
            "Negative electrode potential": a_n,
            "Negative electrolyte potential": a_n,
            "Negative electrode open circuit potential": a_n,
            "Negative electrolyte concentration": a_n,
            "Negative electrode temperature": a_n,
        }
        submodel = pybamm.interface.ButlerVolmer(param, "Negative",
                                                 "lead-acid main")
        std_tests = tests.StandardSubModelTests(submodel, variables)

        std_tests.test_all()

        variables = {
            "Current collector current density": a,
            "Positive electrode potential": a_p,
            "Positive electrolyte potential": a_p,
            "Positive electrode open circuit potential": a_p,
            "Positive electrolyte concentration": a_p,
            "Positive electrode temperature": a_p,
            "Negative electrode interfacial current density": a_n,
            "Negative electrode exchange current density": a_n,
        }
        submodel = pybamm.interface.ButlerVolmer(param, "Positive",
                                                 "lead-acid main")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #4
0
    def test_public_functions(self):
        param = pybamm.standard_parameters_lithium_ion

        a = pybamm.Scalar(0)
        variables = {
            "Current collector current density": a,
            "Negative electrode potential": a,
            "Negative electrolyte potential": a,
            "Negative electrode open circuit potential": a,
        }
        submodel = pybamm.interface.kinetics.BaseModel(param, "Negative")
        std_tests = tests.StandardSubModelTests(submodel, variables)

        with self.assertRaises(NotImplementedError):
            std_tests.test_all()

        variables = {
            "Current collector current density": a,
            "Positive electrode potential": a,
            "Positive electrolyte potential": a,
            "Positive electrode open circuit potential": a,
        }
        submodel = pybamm.interface.kinetics.BaseModel(param, "Positive")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        with self.assertRaises(NotImplementedError):
            std_tests.test_all()
Пример #5
0
    def test_public_function(self):
        param = pybamm.standard_parameters_lead_acid

        a_n = pybamm.PrimaryBroadcast(pybamm.Scalar(0), ["negative electrode"])
        a_s = pybamm.PrimaryBroadcast(pybamm.Scalar(0), ["separator"])
        a = pybamm.Scalar(0)
        variables = {
            "Current collector current density": a,
            "Negative electrode potential": a_n,
            "Negative electrolyte potential": a_n,
            "Negative electrolyte concentration": a_n,
            "Negative electrode temperature": a_n,
            "X-averaged positive electrode oxygen interfacial current density": a,
            "Separator tortuosity": a_s,
            "Separator oxygen concentration": a_s,
            "Leading-order negative electrode oxygen interfacial current density": a,
        }
        submodel = pybamm.interface.DiffusionLimited(
            param, "Negative", "lead-acid oxygen", "leading"
        )
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        submodel = pybamm.interface.DiffusionLimited(
            param, "Negative", "lead-acid oxygen", "composite"
        )
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        submodel = pybamm.interface.DiffusionLimited(
            param, "Negative", "lead-acid oxygen", "full"
        )
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #6
0
 def test_public_functions(self):
     a_n = pybamm.FullBroadcast(pybamm.Scalar(0), ["negative electrode"],
                                "current collector")
     a_p = pybamm.FullBroadcast(pybamm.Scalar(0), ["positive electrode"],
                                "current collector")
     a = pybamm.Scalar(0)
     variables = {
         "Negative particle crack length": a_n,
         "Negative particle surface concentration": a_n,
         "R-averaged negative particle concentration": a_n,
         "Average negative particle concentration": a,
         "X-averaged cell temperature": a,
         "Negative electrode temperature": a_n,
         "Positive particle crack length": a_p,
         "Positive particle surface concentration": a_p,
         "R-averaged positive particle concentration": a_p,
         "Average positive particle concentration": a,
         "Positive electrode temperature": a_p,
     }
     options = {
         "particle": "Fickian diffusion",
         "particle cracking": "both"
     }
     param = pybamm.LithiumIonParameters(options)
     submodel = pybamm.particle_cracking.CrackPropagation(param, "Negative")
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
     submodel = pybamm.particle_cracking.CrackPropagation(param, "Positive")
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
     submodel = pybamm.particle_cracking.NoCracking(param, "Positive")
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
    def test_public_functions(self):
        param = pybamm.LithiumIonParameters()

        a = pybamm.Scalar(0.5)
        variables = {
            "Negative electrode open circuit potential": a,
            "Negative particle surface concentration": a,
            "Negative electrode temperature": a,
            "Negative electrolyte concentration": a,
            "Current collector current density": a,
        }
        submodel = pybamm.interface.inverse_kinetics.InverseButlerVolmer(
            param, "Negative", "lithium-ion main"
        )
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        variables = {
            "Positive electrode open circuit potential": a,
            "Positive particle surface concentration": a,
            "Positive electrode temperature": a,
            "Positive electrolyte concentration": a,
            "Current collector current density": a,
        }
        submodel = pybamm.interface.inverse_kinetics.InverseButlerVolmer(
            param, "Positive", "lithium-ion main"
        )
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #8
0
    def test_public_functions(self):
        submodel = pybamm.electrode.ohm.BaseModel(None, "Negative")
        std_tests = tests.StandardSubModelTests(submodel)
        std_tests.test_all()

        submodel = pybamm.electrode.ohm.BaseModel(None, "Positive")
        std_tests = tests.StandardSubModelTests(submodel)
        std_tests.test_all()
Пример #9
0
    def test_public_functions(self):
        submodel = pybamm.tortuosity.BaseModel(None, "Electrode")
        std_tests = tests.StandardSubModelTests(submodel)
        std_tests.test_all()

        submodel = pybamm.tortuosity.BaseModel(None, "Electrolyte")
        std_tests = tests.StandardSubModelTests(submodel)
        std_tests.test_all()
Пример #10
0
    def test_public_functions(self):
        submodel = pybamm.interface.BaseInterface(None, "Negative", None)
        std_tests = tests.StandardSubModelTests(submodel)
        std_tests.test_all()

        submodel = pybamm.interface.BaseInterface(None, "Positive", None)
        std_tests = tests.StandardSubModelTests(submodel)
        std_tests.test_all()
Пример #11
0
    def test_public_functions(self):
        param = pybamm.LithiumIonParameters()
        a = pybamm.PrimaryBroadcast(1, "current collector")
        a_n = pybamm.FullBroadcast(
            pybamm.Scalar(1), ["negative electrode"], "current collector"
        )
        a_s = pybamm.FullBroadcast(pybamm.Scalar(1), ["separator"], "current collector")
        a_p = pybamm.FullBroadcast(
            pybamm.Scalar(1), ["positive electrode"], "current collector"
        )
        c_e_n = pybamm.standard_variables.c_e_n
        c_e_s = pybamm.standard_variables.c_e_s
        c_e_p = pybamm.standard_variables.c_e_p
        variables = {
            "Leading-order current collector current density": a,
            "Negative electrolyte concentration": c_e_n,
            "Separator electrolyte concentration": c_e_s,
            "Positive electrolyte concentration": c_e_p,
            "X-averaged electrolyte concentration": a,
            "X-averaged negative electrode potential": a,
            "X-averaged negative electrode surface potential difference": a,
            "Leading-order x-averaged negative electrode porosity": a,
            "Leading-order x-averaged separator porosity": a,
            "Leading-order x-averaged positive electrode porosity": a,
            "Leading-order x-averaged negative electrolyte tortuosity": a,
            "Leading-order x-averaged separator tortuosity": a,
            "Leading-order x-averaged positive electrolyte tortuosity": a,
            "X-averaged cell temperature": a,
            "Current collector current density": a,
            "Negative electrode porosity": a_n,
            "Sum of x-averaged negative electrode interfacial current densities": a,
            "X-averaged negative electrode total interfacial current density": a,
            "Current collector current density": a,
            "Negative electrolyte potential": a_n,
            "Negative electrolyte current density": a_n,
            "Separator electrolyte potential": a_s,
            "Separator electrolyte current density": a_s,
            "Positive electrode porosity": a_p,
            "Sum of x-averaged positive electrode interfacial current densities": a,
            "X-averaged positive electrode total interfacial current density": a,
        }

        spf = pybamm.electrolyte_conductivity.surface_potential_form
        submodel = spf.CompositeAlgebraic(param, "Negative")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
        submodel = spf.CompositeDifferential(param, "Negative")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        submodel = spf.CompositeAlgebraic(param, "Positive")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
        submodel = spf.CompositeDifferential(param, "Positive")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #12
0
    def test_public_functions(self):
        submodel = pybamm.particle.BaseParticle(None, "Negative")
        std_tests = tests.StandardSubModelTests(submodel)
        with self.assertRaises(NotImplementedError):
            std_tests.test_all()

        submodel = pybamm.particle.BaseParticle(None, "Positive")
        std_tests = tests.StandardSubModelTests(submodel)
        with self.assertRaises(NotImplementedError):
            std_tests.test_all()
Пример #13
0
    def test_public_functions(self):
        param = pybamm.standard_parameters_lithium_ion
        a = pybamm.Scalar(0)
        a_n = pybamm.Broadcast(pybamm.Scalar(0), ["negative electrode"])
        a_s = pybamm.Broadcast(pybamm.Scalar(0), ["separator"])
        a_p = pybamm.Broadcast(pybamm.Scalar(0), ["positive electrode"])
        variables = {
            "Current collector current density": a,
            "Negative electrode porosity": a_n,
            "Negative electrolyte concentration": a_n,
            "Negative electrode interfacial current density": a_n,
            "X-averaged negative electrode interfacial current density": a,
            "X-averaged negative electrode total interfacial current density":
            a,
        }
        icd = " interfacial current density"
        reactions = {
            "main": {
                "Negative": {
                    "s": 1,
                    "aj": "Negative electrode" + icd
                },
                "Positive": {
                    "s": 1,
                    "aj": "Positive electrode" + icd
                },
            }
        }
        spf = pybamm.electrolyte.stefan_maxwell.conductivity.surface_potential_form
        submodel = spf.LeadingOrderAlgebraic(param, "Negative", reactions)
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
        submodel = spf.LeadingOrderDifferential(param, "Negative", reactions)
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        variables = {
            "Current collector current density": a,
            "Negative electrolyte potential": a_n,
            "Negative electrolyte current density": a_n,
            "Separator electrolyte potential": a_s,
            "Separator electrolyte current density": a_s,
            "Positive electrode porosity": a_p,
            "Positive electrolyte concentration": a_p,
            "X-averaged positive electrode interfacial current density": a,
            "X-averaged positive electrode total interfacial current density":
            a,
        }
        submodel = spf.LeadingOrderAlgebraic(param, "Positive", reactions)
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
        submodel = spf.LeadingOrderDifferential(param, "Positive", reactions)
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #14
0
    def test_public_functions(self):
        variables = {
            "Negative particle surface concentration": 0,
            "Positive particle surface concentration": 0,
        }
        submodel = pybamm.particle.BaseParticle(None, "Negative")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        submodel = pybamm.particle.BaseParticle(None, "Positive")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #15
0
    def test_public_functions(self):
        param = pybamm.standard_parameters_lithium_ion
        submodel = pybamm.current_collector.PotentialPair1plus1D(param)
        variables = {
            "Positive current collector potential":
            pybamm.PrimaryBroadcast(0, "current collector")
        }
        std_tests = tests.StandardSubModelTests(submodel, variables)

        std_tests.test_all()
        submodel = pybamm.current_collector.PotentialPair2plus1D(param)
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #16
0
    def test_public_functions(self):
        param = pybamm.standard_parameters_lithium_ion

        submodel = pybamm.thermal.Lumped(param)
        std_tests = tests.StandardSubModelTests(submodel, coupled_variables)
        std_tests.test_all()

        submodel = pybamm.thermal.Lumped(param, cc_dimension=1)
        std_tests = tests.StandardSubModelTests(submodel, coupled_variables)
        std_tests.test_all()

        submodel = pybamm.thermal.Lumped(param, cc_dimension=2)
        std_tests = tests.StandardSubModelTests(submodel, coupled_variables)
        std_tests.test_all()
Пример #17
0
 def test_public_functions(self):
     param = pybamm.LithiumIonParameters()
     variables = {
         "Positive current collector potential": pybamm.PrimaryBroadcast(
             0, "current collector"
         ),
         "Total current density": 0,
     }
     submodel = pybamm.current_collector.PotentialPair1plus1D(param)
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
     submodel = pybamm.current_collector.PotentialPair2plus1D(param)
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
Пример #18
0
 def test_public_functions(self):
     param = pybamm.standard_parameters_lithium_ion
     submodel = pybamm.external_circuit.FunctionControl(
         param, external_circuit_function)
     variables = {"Terminal voltage [V]": pybamm.Scalar(0)}
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
    def test_public_functions_first_order(self):
        param = pybamm.LithiumIonParameters()
        a = pybamm.PrimaryBroadcast(1, "current collector")
        c_e_n = pybamm.standard_variables.c_e_n
        c_e_s = pybamm.standard_variables.c_e_s
        c_e_p = pybamm.standard_variables.c_e_p

        variables = {
            "Leading-order current collector current density": a,
            "Negative electrolyte concentration": c_e_n,
            "Separator electrolyte concentration": c_e_s,
            "Positive electrolyte concentration": c_e_p,
            "Leading-order x-averaged electrolyte concentration": a,
            "X-averaged electrolyte concentration": a,
            "X-averaged negative electrode potential": a,
            "X-averaged negative electrode surface potential difference": a,
            "Leading-order x-averaged negative electrode porosity": a,
            "Leading-order x-averaged separator porosity": a,
            "Leading-order x-averaged positive electrode porosity": a,
            "Leading-order x-averaged negative electrolyte tortuosity": a,
            "Leading-order x-averaged separator tortuosity": a,
            "Leading-order x-averaged positive electrolyte tortuosity": a,
            "X-averaged cell temperature": a,
        }
        submodel = pybamm.electrolyte_conductivity.Composite(
            param, higher_order_terms="first-order")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #20
0
 def test_public_functions(self):
     param = pybamm.LithiumIonParameters()
     a = pybamm.Scalar(0)
     surf = "surface area per unit volume distribution in x"
     variables = {
         "Electrolyte tortuosity":
         a,
         "Electrolyte concentration":
         pybamm.FullBroadcast(
             a,
             ["negative electrode", "separator", "positive electrode"],
             "current collector",
         ),
         "Negative " + surf:
         pybamm.FullBroadcast(a, "negative electrode", "current collector"),
         "Positive " + surf:
         pybamm.FullBroadcast(a, "positive electrode", "current collector"),
         "Sum of interfacial current densities":
         pybamm.FullBroadcast(
             a,
             ["negative electrode", "separator", "positive electrode"],
             "current collector",
         ),
         "Cell temperature":
         a,
     }
     submodel = pybamm.electrolyte_conductivity.Full(param)
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
 def test_public_functions(self):
     param = pybamm.standard_parameters_lithium_ion
     a = pybamm.Scalar(0)
     variables = {
         "Electrolyte tortuosity":
         a,
         "Electrolyte concentration":
         a,
         "Negative electrode interfacial current density":
         pybamm.FullBroadcast(a, "negative electrode", "current collector"),
         "Positive electrode interfacial current density":
         pybamm.FullBroadcast(a, "positive electrode", "current collector"),
         "Cell temperature":
         a,
     }
     icd = " interfacial current density"
     reactions = {
         "main": {
             "Negative": {
                 "s": 1,
                 "aj": "Negative electrode" + icd
             },
             "Positive": {
                 "s": 1,
                 "aj": "Positive electrode" + icd
             },
         }
     }
     submodel = pybamm.electrolyte.stefan_maxwell.conductivity.Full(
         param, reactions)
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
Пример #22
0
 def test_public_functions(self):
     param = pybamm.LeadAcidParameters()
     a = pybamm.Scalar(0)
     variables = {
         "Porosity":
         a,
         "X-averaged negative electrode porosity":
         a,
         "X-averaged separator porosity":
         a,
         "X-averaged positive electrode porosity":
         a,
         "X-averaged negative electrode porosity change":
         a,
         "X-averaged separator porosity change":
         a,
         "X-averaged positive electrode porosity change":
         a,
         "Sum of x-averaged negative electrode interfacial current densities":
         a,
         "Sum of x-averaged positive electrode interfacial current densities":
         a,
         "Sum of x-averaged negative electrode electrolyte reaction source terms":
         a,
         "Sum of x-averaged positive electrode electrolyte reaction source terms":
         a,
         "X-averaged separator transverse volume-averaged acceleration":
         a,
     }
     submodel = pybamm.electrolyte_diffusion.LeadingOrder(param)
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
 def test_public_functions(self):
     param = pybamm.LithiumIonParameters()
     a = pybamm.Scalar(0)
     variables = {"Porosity": a, "Electrolyte concentration": a}
     submodel = pybamm.electrolyte_diffusion.ConstantConcentration(param)
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
 def test_public_functions(self):
     # param = pybamm.LeadAcidParameters()
     param = pybamm.LithiumIonParameters()
     a = pybamm.PrimaryBroadcast(pybamm.Scalar(0), "current collector")
     variables = {
         "X-averaged negative electrode interfacial current density":
         a,
         "X-averaged negative electrode SEI interfacial current density":
         a,
         "X-averaged positive electrode interfacial current density":
         a,
         "X-averaged negative electrode lithium plating "
         "interfacial current density":
         a,
     }
     options = {
         "SEI": "ec reaction limited",
         "SEI film resistance": "distributed",
         "SEI porosity change": "true",
         "lithium plating": "irreversible",
         "lithium plating porosity change": "true",
     }
     submodel = pybamm.porosity.ReactionDriven(param, options, True)
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
Пример #25
0
 def test_public_functions(self):
     param = pybamm.LithiumIonParameters()
     a = pybamm.Scalar(1)
     full = pybamm.FullBroadcast(
         a,
         ["negative electrode", "separator", "positive electrode"],
         "current collector",
     )
     variables = {
         "Porosity": a,
         "Negative electrode porosity": a,
         "Separator porosity": a,
         "Positive electrode porosity": a,
         "Electrolyte tortuosity": a,
         "Porosity change": a,
         "Volume-averaged velocity": a,
         "Electrolyte concentration": a,
         "Electrolyte current density": full,
         "Sum of electrolyte reaction source terms": full,
         "Cell temperature": full,
         "Transverse volume-averaged acceleration": full,
     }
     submodel = pybamm.electrolyte_diffusion.Full(param)
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
Пример #26
0
 def test_public_functions(self):
     param = pybamm.LeadAcidParameters()
     a = pybamm.Scalar(0)
     variables = {
         "Porosity": pybamm.Concatenation(
             pybamm.FullBroadcast(a, "negative electrode", "current collector"),
             pybamm.FullBroadcast(a, "separator", "current collector"),
             pybamm.FullBroadcast(a, "positive electrode", "current collector"),
         ),
         "Electrolyte tortuosity": pybamm.Concatenation(
             pybamm.FullBroadcast(a, "negative electrode", "current collector"),
             pybamm.FullBroadcast(a, "separator", "current collector"),
             pybamm.FullBroadcast(a, "positive electrode", "current collector"),
         ),
         "Porosity change": pybamm.Concatenation(
             pybamm.FullBroadcast(a, "negative electrode", "current collector"),
             pybamm.FullBroadcast(a, "separator", "current collector"),
             pybamm.FullBroadcast(a, "positive electrode", "current collector"),
         ),
         "Volume-averaged velocity": a,
         "Negative electrode interfacial current density": pybamm.FullBroadcast(
             a, "negative electrode", "current collector"
         ),
         "Positive electrode interfacial current density": pybamm.FullBroadcast(
             a, "positive electrode", "current collector"
         ),
         "Positive electrode oxygen interfacial current "
         "density": pybamm.FullBroadcast(
             a, "positive electrode", "current collector"
         ),
     }
     submodel = pybamm.oxygen_diffusion.Full(param)
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
 def test_public_functions(self):
     param = pybamm.standard_parameters_lead_acid
     reactions = {
         "main": {
             "Negative": {
                 "s": param.s_n,
                 "aj": "Negative electrode interfacial current density",
             },
             "Positive": {
                 "s": param.s_p,
                 "aj": "Positive electrode interfacial current density",
             },
         }
     }
     a = pybamm.Scalar(0)
     variables = {
         "X-averaged negative electrode porosity": a,
         "X-averaged separator porosity": a,
         "X-averaged positive electrode porosity": a,
         "X-averaged negative electrode porosity change": a,
         "X-averaged separator porosity change": a,
         "X-averaged positive electrode porosity change": a,
         "X-averaged negative electrode interfacial current density": a,
         "X-averaged positive electrode interfacial current density": a,
     }
     submodel = pybamm.electrolyte.stefan_maxwell.diffusion.LeadingOrder(
         param, reactions
     )
     std_tests = tests.StandardSubModelTests(submodel, variables)
     std_tests.test_all()
Пример #28
0
    def test_public_functions(self):
        param = pybamm.standard_parameters_lead_acid

        a = pybamm.Scalar(0)
        variables = {"Current collector current density": a}
        submodel = pybamm.convection.NoConvection(param)
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #29
0
    def test_public_functions(self):
        param = pybamm.LeadAcidParameters()

        a = pybamm.Scalar(0)
        variables = {
            "Current collector current density": a,
            "X-averaged positive electrode open circuit potential": a,
            "X-averaged positive electrode reaction overpotential": a,
            "X-averaged positive electrolyte potential": a,
        }
        submodel = pybamm.electrode.ohm.LeadingOrder(param, "Negative")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        submodel = pybamm.electrode.ohm.LeadingOrder(param, "Positive")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()
Пример #30
0
    def test_public_functions(self):
        param = pybamm.LithiumIonParameters()
        a = pybamm.Concatenation(
            pybamm.FullBroadcast(0, ["negative electrode"],
                                 "current collector"),
            pybamm.FullBroadcast(0, ["separator"], "current collector"),
            pybamm.FullBroadcast(0, ["positive electrode"],
                                 "current collector"),
        )
        variables = {"Porosity": a, "Active material volume fraction": a}
        submodel = pybamm.tortuosity.Bruggeman(param, "Electrolyte")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()

        submodel = pybamm.tortuosity.Bruggeman(param, "Electrode")
        std_tests = tests.StandardSubModelTests(submodel, variables)
        std_tests.test_all()