Example #1
0
 def __init__(self, wrm=None, coef=1, dT=1.):
     if wrm is None:
         wrm = wrm_vangenuchten.VanGenuchten(0.8, 1.5e-4)
     self.smooth_coef = coef
     self.dp = capillary_pressure.pc_ice(273.15 - dT, 101325., 1)
     print self.dp
     self.pm = permafrost_model_explicit_fpd.PermafrostModel(wrm)
 def __init__(self,
              wrm=None,
              pc_ice=capillary_pressure.pc_ice,
              pc_liq=capillary_pressure.pc_liq):
     self.pc_ice = pc_ice
     self.pc_liq = pc_liq
     if wrm is None:
         wrm = wrm_vangenuchten.VanGenuchten(0.8, 1.5e-4)
     self.wrm = wrm
Example #3
0
 def __init__(self,
              wrm=None,
              dT=1.,
              pc_ice=capillary_pressure.pc_ice,
              pc_liq=capillary_pressure.pc_liq):
     if wrm is None:
         wrm = wrm_vangenuchten.VanGenuchten(0.8, 1.5e-4)
     self.wrm = wrm
     self.pc_ice = pc_ice
     self.pc_liq = pc_liq
     self.dp = self.pc_ice(273.15 - dT, 101325.)
Example #4
0
def water_of_T_sg(T, sg, afunc=saturations_A):
    nl = n_water(T)
    ni = n_ice(T)
    ng = n_gas(T)
    omega = mol_frac_gas(T)

    A = afunc(T)
    B = (1. - sg + sg * A) / (1. - sg)

    wrm = wrm_vangenuchten.VanGenuchten(0.8, 1.5e-4)
    pc = wrm.capillaryPressure(1.0 / B)
    p = _p_atm - pc

    s_l = 1.0 / (A + B - 1.0)
    s_i = s_l * (A - 1.0)
    return (s_l, s_i, s_g), p
Example #5
0
def saturation_with_wc(T, wc, afunc=saturations_A):
    nl = n_water(T)
    ni = n_ice(T)
    ng = n_gas(T)
    omega = mol_frac_gas(T)

    A = afunc(T)
    wrm = wrm_vangenuchten.VanGenuchten(0.8, 1.5e-4)
    B = (nl + ni * (A - 1) - omega * ng - (A - 1) * wc) / (wc - omega * ng)
    pc = wrm.capillaryPressure(1.0 / B)
    p = _p_atm - pc

    s_l = 1.0 / (A + B - 1.0)
    s_g = s_l * (B - 1.0)
    s_i = s_l * (A - 1.0)
    return (s_l, s_i, s_g), p
 def __init__(self, wrm=None, coef=1., dT=1.):
     if wrm is None:
         wrm = wrm_vangenuchten.VanGenuchten(0.8, 1.5e-4)
     self.wrm = wrm
     self.coef = coef
     self.dp = capillary_pressure.pc_ice(273.15 - dT, 101325., coef)
Example #7
0
 def __init__(self, wrm=None):
     if wrm is None:
         wrm = wrm_vangenuchten.VanGenuchten(0.205, 5.5e-4)
     self.wrm = wrm
Example #8
0
def saturations_AB(T, p, afunc=saturations_A):
    wrm = wrm_vangenuchten.VanGenuchten(0.8, 1.5e-4)
    B = 1.0 / wrm.saturation(_p_atm - p)
    A = afunc(T)
    return A, B
Example #9
0
def saturations_A3(T):
    wrm = wrm_vangenuchten.VanGenuchten(0.8, 1.5e-4)
    Mv = 0.0180153
    gamma = 72.7 / 33.1 * 3.34e4 * Mv
    A = 1.0 / wrm.saturation(gamma * (273.15 - T) / 273.15 * n_water(T))
    return A
Example #10
0
    # pcs_linear = p_atm - 1.e6*np.array([wrm.potentialLinear(s) for s in sats])
    # pcs_p_plus_sol = p_atm - 1.e6*(np.array([wrm.potentialP(s) for s in sats])+np.array([wrm.potentialSol(s) for s in sats]))
    # pcs_sol = p_atm - 1.e6*np.array([wrm.potentialSol(s) for s in sats])

    sats_inv = np.array([wrm.saturation(pc) for pc in pcs])

    ax.semilogy(sats, pcs, fmt)
    ax.semilogy(sats_inv, pcs, fmt)
    # ax.plot(sats, pcs_linear, 'b')
    # ax.plot(sats, pcs_p_plus_sol, 'r')
    # ax.plot(sats, pcs_sol, 'g')
    # ax.plot(sats, pcs, 'k--')


if __name__ == "__main__":
    from matplotlib import pyplot as plt
    fig = plt.figure()
    ax = fig.add_subplot(111)

    # typical values: s_r = 0.4, s_tlp = 0.85 (both stem and leaf)
    wrm = WRMPlantHydraulics(0.4, 0.85)
    plot(wrm, 'b', ax)

    import wrm_vangenuchten
    wrmvg = wrm_vangenuchten.VanGenuchten(m=.3, alpha=1.e-3, sr=0.1)
    plot(wrmvg, 'g', ax)
    wrmvg = wrm_vangenuchten.VanGenuchten(n=1.27, alpha=5.e-3, sr=0.13)
    plot(wrmvg, 'r', ax)
    plt.show()