taufactor.electrode
Main module.
Classes
|
Default solver for two phase images. |
|
Electrode Solver - solves the electrode tortuosity factor system (migration and capacitive current between current collector and solid/electrolyte interface) Once solve method is called, tau, D_eff and D_rel are available as attributes. |
|
Solver with periodic boundary conditions in y and z direction. |
|
Solver with periodic boundary conditions in y and z direction. |
- class taufactor.electrode.ElectrodeSolver(img, conductive_label=1, reactive_label=0, omega=None, spacing=None, device='cuda')[source]
Default solver for two phase images. Once solve method is called, tau, D_eff and D_rel are available as attributes.
- __init__(img, conductive_label=1, reactive_label=0, omega=None, spacing=None, device='cuda')[source]
Initialise parameters, solution field and other tools that can be re-used for multiple solves.
- Parameters:
img – input img with 1s conductive and 0s non-conductive
bc – Upper and lower boundary conditions. Leave as default.
D_0 – reference material diffusivity
device – pytorch device, can be cuda or cpu
- class taufactor.electrode.ImpedanceSolver(img, conductive_label=1, reactive_label=0, omega=None, spacing=None, mode='tau_e', device='cuda')[source]
Electrode Solver - solves the electrode tortuosity factor system (migration and capacitive current between current collector and solid/electrolyte interface) Once solve method is called, tau, D_eff and D_rel are available as attributes.
- __init__(img, conductive_label=1, reactive_label=0, omega=None, spacing=None, mode='tau_e', device='cuda')[source]
- count_neighbours(img, mask)[source]
Initialise factor based on conductive and capacitive neighbours factor = (N_i + 2*S_i* j*r*w*c / (1 + j*r*frequency*c) N_i: amount of conductive neighbours (cond_nn) S_i: amount of capacitive neighbours (reac_nn)
- Parameters:
img (cp.array) – input image, with 1s conductive and 0s non-conductive
- Returns:
prefactor
- Return type:
cp.array
- init_field_internal(mask)[source]
Initialise field with analytical solution :param img: input image, with 1s conductive and 0s non-conductive :type img: torch.array :return: initial field :rtype: torch.array
- solve(iter_limit=10000, verbose=True, conv_crit=0.001, plot_interval=10)[source]
run a solve simulation
- Parameters:
iter_limit – max iterations before aborting, will attemtorch double for the same no. iterations
if initialised as singles :param verbose: Whether to print tau. Can be set to ‘per_iter’ for more feedback :param conv_crit: convergence criteria - running standard deviation of tau_e :param conv_crit_2: convergence criteria - maximum difference between tau_e in consecutive frequency solves :return: tau
- class taufactor.electrode.PeriodicElectrodeSolver(img, conductive_label=1, reactive_label=0, omega=None, spacing=None, device='cuda')[source]
Solver with periodic boundary conditions in y and z direction.
- class taufactor.electrode.PeriodicImpedanceSolver(img, conductive_label=1, reactive_label=0, omega=None, spacing=None, mode='tau_e', device='cuda')[source]
Solver with periodic boundary conditions in y and z direction.
- count_neighbours(img, mask)[source]
Initialise factor based on conductive and capacitive neighbours factor = (N_i + 2*S_i* j*r*w*c / (1 + j*r*frequency*c) N_i: amount of conductive neighbours (cond_nn) S_i: amount of capacitive neighbours (reac_nn)
- Parameters:
img (cp.array) – input image, with 1s conductive and 0s non-conductive
- Returns:
prefactor
- Return type:
cp.array