def TipAsym_UniversalW_delt_Res(w, *args): """The residual function zero of which will give the General asymptote """ (dist, Kprime, Eprime, muPrime, Cbar, Vel) = args Kh = Kprime * dist**0.5 / (Eprime * w) Ch = 2 * Cbar * dist**0.5 / (Vel**0.5 * w) sh = muPrime * Vel * dist**2 / (Eprime * w**3) g0 = f(Kh, 0.9911799823 * Ch, 10.392304845) delt = 10.392304845 * (1 + 0.9911799823 * Ch) * g0 C1 = 4 * (1 - 2 * delt) / (delt * (1 - delt)) * np.tan(np.pi * delt) C2 = 16 * (1 - 3 * delt) / (3 * delt * (2 - 3 * delt)) * np.tan(3 * np.pi * delt / 2) b = C2 / C1 return sh - f(Kh, Ch * b, C1)
def TipAsym_UniversalW_zero_Res(w, *args): """Function to be minimized to find root for universal Tip assymptote (see Donstov and Pierce 2017)""" (dist, Kprime, Eprime, muPrime, Cbar, Vel) = args Kh = Kprime * dist**0.5 / (Eprime * w) Ch = 2 * Cbar * dist**0.5 / (Vel**0.5 * w) g0 = f(Kh, 0.9911799823 * Ch, 6 * 3**0.5) sh = muPrime * Vel * dist**2 / (Eprime * w**3) return sh - g0
def TipAsym_UniversalW_delt_Res(w, *args): """The residual function zero of which will give the General asymptote """ (dist, Kprime, Eprime, muPrime, Cbar, Vel) = args if Cbar == 0: return TipAsym_MK_W_deltaC_Res(w, *args) Kh = Kprime * dist**0.5 / (Eprime * w) Ch = 2 * Cbar * dist**0.5 / (Vel**0.5 * w) sh = muPrime * Vel * dist**2 / (Eprime * w**3) g0 = f(Kh, 0.9911799823 * Ch, 10.392304845) delt = 10.392304845 * (1 + 0.9911799823 * Ch) * g0 b = C2(delt) / C1(delt) con = C1(delt) gdelt = f(Kh, Ch * b, con) return sh - gdelt
def MomentsTipAssympGeneral(dist, Kprime, Eprime, muPrime, Cbar, Vel, stagnant, KIPrime, regime): """Moments of the General tip asymptote to calculate the volume integral (see Donstov and Pierce, 2017)""" log = logging.getLogger('PyFrac.MomentsTipAssympGeneral') TipAsmptargs = (dist, Kprime, Eprime, muPrime, Cbar, Vel) if dist == 0: w = 0 elif stagnant: w = KIPrime * dist**0.5 / Eprime else: a, b = FindBracket_w(dist, Kprime, Eprime, muPrime, Cbar, Vel, regime) try: if regime == 'U': w = brentq(TipAsym_UniversalW_zero_Res, a, b, TipAsmptargs) # root finding else: w = brentq(TipAsym_UniversalW_delt_Res, a, b, TipAsmptargs) # root finding except RuntimeError: M0, M1 = np.nan, np.nan return M0, M1 except ValueError: M0, M1 = np.nan, np.nan return M0, M1 if w < -1e-15: log.warning('Negative width encountered in volume integral') w = abs(w) if Vel < 1e-6 or w == 0: delt = 1 / 6 else: Kh = Kprime * dist**0.5 / (Eprime * w) Ch = 2 * Cbar * dist**0.5 / (Vel**0.5 * w) g0 = f(Kh, 0.9911799823 * Ch, 10.392304845) delt = 10.392304845 * (1 + 0.9911799823 * Ch) * g0 M0 = 2 * w * dist / (3 + delt) M1 = 2 * w * dist**2 / (5 + delt) if np.isnan(M0) or np.isnan(M1): M0, M1 = np.nan, np.nan return M0, M1
def MomentsTipAssympGeneral(dist, Kprime, Eprime, muPrime, Cbar, Vel, stagnant, KIPrime): """Moments of the General tip asymptote to calculate the volume integral (see Donstov and Pierce, 2017)""" TipAsmptargs = (dist, Kprime, Eprime, muPrime, Cbar, Vel) if stagnant: w = KIPrime * dist**0.5 / Eprime else: a, b = FindBracket_w(dist, Kprime, Eprime, muPrime, Cbar, Vel) try: w = brentq(TipAsym_UniversalW_zero_Res, a, b, TipAsmptargs) # root finding except RuntimeError: M0, M1 = np.nan, np.nan return M0, M1 except ValueError: M0, M1 = np.nan, np.nan return M0, M1 if w < -1e-15: w = abs(w) if Vel < 1e-6: delt = 1 / 6 else: Kh = Kprime * dist**0.5 / (Eprime * w) Ch = 2 * Cbar * dist**0.5 / (Vel**0.5 * w) g0 = f(Kh, 0.9911799823 * Ch, 10.392304845) delt = 10.392304845 * (1 + 0.9911799823 * Ch) * g0 M0 = 2 * w * dist / (3 + delt) M1 = 2 * w * dist**2 / (5 + delt) if np.isnan(M0) or np.isnan(M1): M0, M1 = np.nan, np.nan return M0, M1