PyBaMM icon indicating copy to clipboard operation
PyBaMM copied to clipboard

Adding customized function for tortuosity

Open amirsh213 opened this issue 2 years ago • 3 comments

Description

I was wondering if it is possible to enable adding customized non-Bruggeman functions to define tortuosity or MacMullin number as a function of porosity?

Thanks.

Motivation

No response

Possible Implementation

No response

Additional context

No response

amirsh213 avatar Jun 17 '22 16:06 amirsh213

You could create a new submodel in this folder. The simplest thing would be to copy the Bruggeman submodel and edit it to whatever function you want.

You could either hard-code some functional form with some new scalar parameters, or allow a general function of porosity/active material by adding a new FunctionParameter

rtimms avatar Jun 19 '22 07:06 rtimms

If I copy the Bruggeman submodel and add my function, how should I have the model use this custom submodel and not the Bruggeman?

Also, can you please elaborate on how this FunctionParamter works? I want to add (and change) two parameters for my customized equation in the "negative_electrode" folder like where you defined "Negative electrode Bruggeman coefficient (electrolyte)" in the CSV file. Should I define those parameters here?

I'm also wondering how you defined your effective properties e.g. electrolyte diffusivity/conductivity? I get tortuosity smaller than 1 which is confusing. Where should I define my effective properties the way I want?

amirsh213 avatar Jun 22 '22 22:06 amirsh213

I'm currently working on adding extra documentation around how to use submodels, but there is an example of swapping out submodels here. If you wanted to integrate your new submodel into the code you could make it so that you pass an option to the model to set the tortuosity. Take a look at the base battery model to see how options are handled.

For FunctionParameters you could look at how particle radius is defined, and see this example for how to provide a function. Yes, you can define your new parameters in GeometricParameters.

See this discussion around how the properties are defined (we actually define a "transport efficiency", not a tortuosity).

rtimms avatar Jun 23 '22 08:06 rtimms

Hi @amirsh213 , how's it going? We are running a hackathon on 29th of March in Oxford and this issue is potentially one we could work on together. You'd be welcome to join us if you can make it. Tickets are free but limited availability https://www.eventbrite.co.uk/e/pybamm-hackathon-tickets-517334430207?keep_tld=1 If you have already made some progress on this issue then let us know and we will exclude it from the options to work on during the day. Thanks

TomTranter avatar Jan 31 '23 11:01 TomTranter

Hackathon info

  • [ ] Look at submodel structure
  • [ ] Read tortuosity paper for a few different model ideas
  • [ ] Implement new submodel and parameters
  • [ ] Configure new option
  • [ ] New examples
  • [ ] Tests
  • [ ] PRs

TomTranter avatar Mar 29 '23 09:03 TomTranter