boundary_conditions
Handle boundary conditions.
- class boundary_conditions.BoundaryConditions(params, thermo, V_partial, min_atom_fraction, logger, side, ready)[source]
Bases:
objectBoundary conditions on one side of the domain (left or right).
Can be either:
‘Dirichlet’: prescribed composition, if ‘atom_fractions’ is provided in the input parameters.
‘Neumann’: prescribed flux, if ‘flux’ is provided.
Defaults to 0-flux if none is specified in the input parameters.
The class is used through cvar_fun and J_fun, which are both function of time built from the input parameters, which may be a float or a str with t as the time variable (ex: (3*t + 2)**(1/2)).
- Variables:
thermo (
thermodynamics.Thermodynamics) – Thermodynamic properties handler.comps (list of str) – System components.
inds (list of str) – Independent components.
V_partial (dict) – Partial molar volumes. See
data_io.get_volume_data().min_atom_fraction (float) – Minimum atom fraction accepted.
logger (
log_utils.CustomLogger) – Logger.side (str) – Side where boundary condition applies (left or right).
type (str) – Type of boundary condition (Neumann or Dirichlet).
- cvar_fun(t) :
Function of time, returns a
composition_variables.CompositionVariablesinstance.
- J_fun(t)
Function of time, returns a flux array.
- __init__(params, thermo, V_partial, min_atom_fraction, logger, side, ready)[source]
Class constructor.
- make_J_fun(Jparams)[source]
Make function that returns a boundary flux array.
The inner function returns a 1D array of fluxes, which include all atom components.
- make_cvar_fun(xparams)[source]
Make function that returns a boundary composition variable.
The inner function returns a
composition_variables.CompositionVariablesinstance. Two assumptions are made:vacancies are at equilibrium,
the pore fraction is 0.