Skip to content
SoulDancer27 edited this page May 26, 2020 · 17 revisions

Version 0.9.1 Python 3.0+

Contents:

  1. Installation Guide >
  2. Getting Started >
  3. Vanadium Redox Flow Battery Structure >
  4. Experimental Data & Polarization curves >
  5. Battery Dynamics >

Examples

1. Processing experimental data.

You can find open-source experimental data here or in our github repository. It contains two data sets for different States of Charge (10% and 50%) and three electrolyte flows (10, 50, 80rpm*). 1rpm = 1ml/min

Each experiment represents I (current) and U (voltage) as a function of time and contains approximately 7*104 points. It's the data on polarization curve experiment. In short, it represents the dependency of the stationary state U as a function of system load current I. You can read theory in details in this article.

It can be processed with no difficulty. To read and plot the data:

from pathlib import Path
import RFB

# Opening experimental data
data_path = Path.cwd() / 'Data' / 'Discharge curve' / '10%SOC' / '50rpm.txt'

# Loading 
data = RFB.ExperimentalDataCSV(data_path).loadFile()
RFB.plot_IU(data)
No IU plot

The data contains information on polarization curve, as well as periods of the following battery charge to return to the initial state. You can easily extract all of the information with the following code:

from pathlib import Path
import RFB

# Opening experimental data
data_path = Path.cwd() / 'Data' / 'Discharge curve' / '10%SOC' / '50rpm.txt'

# Loading
data = RFB.ExperimentalDataCSV(data_path).loadFile()
data = RFB.select_meaningful_data(data, mode='discharge', tolerance=50)
# data now contains a list of dataFrames for each of the experiments (23 in this case)
RFB.plot_IU(data[2])
No IU plot here

Look here for more information.

2. Fitting polarization curves.

You can fit polarization curve on the experimental data. Polarization curve represents battery power output for certain conditions U(I, Q), where I- system load in Amperes, Q- electrolyte flow rate. Currently three parametrical model is implemented U(R, α, β ). You can read about theory behind it here.

from pathlib import Path
import RFB

path = Path.cwd() / 'Battery.xlsx'
load = RFB.BatteryDataXLSX(path)
battery = RFB.VanadiumBattery(load, x=[0.045, 0.4, 2.3*10**(-3)], crossover=False)

data_path = Path.cwd() / 'Data' / 'Discharge curve' / '10%SOC/'

data = RFB.ExperimentalDataCSV(data_path).loadFolder()

pol_curve = RFB.PolarizationCurve(battery, data, current_unit='mA')

pol_curve.metadata['u'] = [RFB.rpm_to_u(Q, battery.Electrode['A']) for Q in [10, 50, 80]]
# pol_curve.with_dynamical = True

result = pol_curve.fit()
pol_curve.plot()
Polarization curve image is missing

The fit is not perfect here due to the fact that for this data set not for every point stationary conditions were obtained. Better fit can be obtained after some adjustments. See the picture below.

Adjusted PolCurve missing

Look here for more information.

3. Battery dynamics.

Theoretical models for Vanadium Battery dynamics are described in this article.

In the package models with Membrane Crossover and thermal effects are implemented. You can learn about battery object implementation here. And full specification of dynamical models is in the file DynamicalModels.docx in the main project repo.

The following code allows to solve dynamical system for Vanadium Battery in the simple case:

import matplotlib.pyplot as plt
from pathlib import Path
import RFB

path = Path.cwd() / 'Battery.xlsx'
load = RFB.BatteryDataXLSX(path)
battery = RFB.VanadiumBattery(load, x=[0.045, 0.4, 2.3*10**(-3)], crossover=False)

battery.DynamicalModel.constraints.update({'SOC_max': 0.99, 'SOC_min': 0.01, 'U_max': 1.7, 'U_min': 0.8})
battery.DynamicalModel.rect_current_args = {'I_high': 3, 'I_low': -3, 't_high': 2600, 't_low': 2600}
dynamics = battery.Solve(t_end=5200, I='rect')

plt.plot(dynamics['I'])
plt.show()

plt.plot(dynamics['U'])
plt.show()
plt.plot(dynamics['C'])
plt.show()

Various loads and constraints can be used. Battery performance over time can also be examined and capacity decrease monitored. Look here for more examples.