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

Calculating ffrac from volume fractions #121

Open
marbris opened this issue May 18, 2023 · 0 comments
Open

Calculating ffrac from volume fractions #121

marbris opened this issue May 18, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@marbris
Copy link

marbris commented May 18, 2023

I've been reading through the code and I've found a few things that seem inconsistent. Please let me know if I'm misunderstanding what the code is supposed to do.

ffrac is the overall filling fraction of the electrode. In mod_cell.py Lines 166-179 ffrac is calculated with

$$ffrac = dx \sum_{v} \sum_{p} \bar{c}_{v,p} V_{v,p}$$

This equation seems to treat $V_{v,p}$ as the particle volume as a fraction of the electrode volume $dx$. However, the $V_{v,p}$ is the particle volume as a fraction of the total particle volume in the electrode volume (configuration.py Line 669). This is only equivalent when each electrode volume contains the same total particle volume. This is not the case when the particle size distribution is randomized.

Instead, lines 166-179 could be replaced with something like

# Define the overall filling fraction in the electrodes
for trode in trodes:
    eq = self.CreateEquation("ffrac_{trode}".format(trode=trode))
    eq.Residual = self.ffrac[trode]()
    tmp = 0
    Vol_fracs = config["psd_vol"][trode] / config["psd_vol"][trode].sum(axis=None)
    for vInd in range(Nvol[trode]):
        for pInd in range(Npart[trode]):
            Vj = Vol_fracs[vInd,pInd]
            tmp += self.particles[trode][vInd,pInd].cbar() / config[trode,'csmax'] * Vj
    eq.Residual -= tmp
@marbris marbris changed the title ffrac assumes each electrode volume contains equal particle volume Calculating ffrac from volume fractions May 18, 2023
@d-cogswell d-cogswell added the help wanted Extra attention is needed label Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants