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

Make calc_esoh a model attribute #4619

Open
rtimms opened this issue Nov 26, 2024 · 1 comment
Open

Make calc_esoh a model attribute #4619

rtimms opened this issue Nov 26, 2024 · 1 comment

Comments

@rtimms
Copy link
Contributor

rtimms commented Nov 26, 2024

Currently the Simulation class uses the following logic to decide if it should calculate the state of health in a simulation

    def _get_esoh_solver(self, calc_esoh):
        if (
            calc_esoh is False
            or isinstance(self._model, pybamm.lead_acid.BaseModel)
            or isinstance(self._model, pybamm.equivalent_circuit.Thevenin)
            or self._model.options["working electrode"] != "both"
        ):
            return None

        return pybamm.lithium_ion.ElectrodeSOHSolver(
            self._parameter_values, self._model.param, options=self._model.options
        )

It would be nice if cacl_esoh was a model attribute (True by default) so that when writing custom models you don't have to pass calc_esoh=False to the solver every time.

@valentinsulzer
Copy link
Member

I think the whole "this is how you calculate summary variables" logic should be in the model instead of the solver

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

2 participants