def __init__(self, tend, dt, tstart=0): """ init function initialize the lab class Arguments: tend {float} -- end time of computation dt {float} -- timestep Keyword Arguments: tstart {float} -- strart time of computation (default: {0}) """ self.tend = tend self.dt = dt self.time = np.linspace(tstart, tend, round(tend / dt) + 1) self.species = DotDict({}) self.dynamic_functions = DotDict({}) self.profiles = DotDict({}) self.dcdt = DotDict({}) self.rates = DotDict({}) self.estimated_rates = DotDict({}) self.constants = DotDict({}) self.henry_law_equations = [] self.acid_base_components = [] self.acid_base_system = phcalc.System() self.ode_method = 'scipy'
def create_acid_base_system(self): """creates an object of acid-base system stores it as instance variable creates variable 'pH' with initial pH=7. """ self.add_species(element='pH', init_conc=7) self.acid_base_system = phcalc.System( *[c['pH_object'] for c in self.acid_base_components])
def create_acid_base_system(self): self.add_species(theta=True, name='pH', D=0, init_conc=7, bc_top_value=7, bc_top_type='dirichlet', bc_bot_value=7, bc_bot_type='dirichlet', w=False, int_transport=False) self.acid_base_system = phcalc.System( *[c['pH_object'] for c in self.acid_base_components])