예제 #1
0
def Idiam(diam, **params):
    dim = params["dim"]
    x0 = params.pop("x0")
    params.pop("diamPore")
    Jon = []
    Joff = []
    # TODO bad hack
    if dim==3:
        params.update(h=1.5, Nmax=7e5)
    if dim==2:
        params.update(h=0.75, Nmax=1e5)

    for d in diam:
        # get diffusivity interpolation
        cache_pugh_diffusivity(diamPore=d, **dparams[dim])
        ddata = dict(dparams[dim], name="Dpugh", diamPore=d)

        # current WITHOUT molecule
        setup = pugh.Setup(x0=None, diamPore=d, diffusivity_data=ddata, **params)
        pb, pnps = pugh.solve(setup, visualize=True)
        Jon.append(pnps.evaluate(setup.phys.CurrentPNPS)["J"])

        # current WITH molecule
        setup = pugh.Setup(x0=x0, diamPore=d, diffusivity_data=ddata, **params)
        pb, pnps = pugh.solve(setup, visualize=True)
        Joff.append(pnps.evaluate(setup.phys.CurrentPNPS)["J"])

    return dict(Jon=Jon, Joff=Joff)
예제 #2
0
def IVDetail(V, **params):
    params["x0"] = None
    for bV, result in collect_dict(V):
        params["bV"] = bV
        setup = pugh.Setup(**params)
        pb, pnps = pugh.solve(setup)
        result.new = pnps.evaluate(setup.phys.CurrentPNPSDetail)
    return result
예제 #3
0
def IrhoDetail(Rho, **params):
    params["x0"] = None
    for rho, result in collect_dict(Rho):
        params["dnaqsdamp"] = rho
        setup = pugh.Setup(**params)
        pb, pnps = pugh.solve(setup, visualize=True)
        result.new = pnps.evaluate(setup.phys.CurrentPNPSDetail)
    return result
예제 #4
0
def IV(V, **params):
    params["x0"] = None
    J = []
    for bV in V:
        params["bV"] = bV
        setup = pugh.Setup(**params)
        pb, pnps = pugh.solve(setup)
        J.append(pnps.evaluate(setup.phys.CurrentPNPS)["J"])
    return dict(J=J)
예제 #5
0
def Irho(Rho, **params):
    params["x0"] = None
    bV = params["bV"]
    J = []
    for rho in Rho:
        params["dnaqsdamp"] = rho
        setup = pugh.Setup(**params)
        pb, pnps = pugh.solve(setup, visualize=True)
        J.append(pnps.evaluate(setup.phys.CurrentPNPS)["J"])
    cond = [abs(j / bV) for j in J]
    return dict(J=J, cond=cond)
예제 #6
0
def Idiam(diam, **params):
    dim = params["dim"]
    x0 = params.pop("x0")
    params.pop("diamPore")
    Jon = []
    Joff = []

    for d in diam:
        # get diffusivity interpolation
        cache_pugh_diffusivity(geoname="pugh2", diamPore=d, **dparams[dim])

        # current WITHOUT molecule
        setup = pugh.Setup(x0=None, diamPore=d, **params)
        pb, pnps = pugh.solve(setup, visualize=True)
        Jon.append(pnps.evaluate(setup.phys.CurrentPNPS)["J"])

        # current WITH molecule
        setup = pugh.Setup(x0=x0, diamPore=d, **params)
        pb, pnps = pugh.solve(setup, visualize=True)
        Joff.append(pnps.evaluate(setup.phys.CurrentPNPS)["J"])

    return dict(Jon=Jon, Joff=Joff)