# Path: proptools/convection.py
# def adiabatic_wall_temperature(T_c, M, gamma, r=0.9, Pr=None):
# def long_tube_coeff(mass_flux, D, c_p, mu, k):
# def bartz(p_c, c_star, D_t, D, c_p, mu_e, Pr, sigma=1.):
# def bartz_sigma_sanchez(T_e, T_avg, w=0.6):
# def bartz_sigma_huzel(T_c, T_w, M, gamma):
# def film_adiabatic_wall_temperature(eta_film, T_aw, T_f):
# def film_efficiency(x, D, m_dot_core, m_dot_film, mu_core, Pr_film=1, film_param=1, cp_ratio=1):
# def rannie_transpiration_cooling(cool_flux_fraction, Pr_film, Re_bulk):
#     G = cool_flux_fraction
#     R = Re_bulk**0.1


import numpy as np
from matplotlib import pyplot as plt
from proptools import convection
"""Film cooting example"""


T_aw = 3200   # Adiabatic wall temperature of core flow [units: kelvin].
T_f = 1600    # Film temperature [units: kelvin].
T_w = 700    # Wall temperature [units: kelvin].
x = np.linspace(0, 1)    # Distance downstream  [units: meter].
D = 0.5    # Diameter [units: meter].
m_dot_core = np.pi / 4 * D**2 * 5.33 * 253    # Core mass flow [units: kilogram second**-1].
m_dot_film = (1./99) * m_dot_core
mu_core = 2e-5 / 0.66   # Dynamic viscosity of the core fluid [units: pascal second].
Pr_film = 0.8
film_param = 1.265
cp_ratio = 0.8

eta = np.array([
    convection.film_efficiency(x_, D, m_dot_core, m_dot_film,
                               mu_core, Pr_film, film_param, cp_ratio)
    for x_ in x])

# Path: proptools/convection.py
# def adiabatic_wall_temperature(T_c, M, gamma, r=0.9, Pr=None):
# def long_tube_coeff(mass_flux, D, c_p, mu, k):
# def bartz(p_c, c_star, D_t, D, c_p, mu_e, Pr, sigma=1.):
# def bartz_sigma_sanchez(T_e, T_avg, w=0.6):
# def bartz_sigma_huzel(T_c, T_w, M, gamma):
# def film_adiabatic_wall_temperature(eta_film, T_aw, T_f):
# def film_efficiency(x, D, m_dot_core, m_dot_film, mu_core, Pr_film=1, film_param=1, cp_ratio=1):
# def rannie_transpiration_cooling(cool_flux_fraction, Pr_film, Re_bulk):
#     G = cool_flux_fraction
#     R = Re_bulk**0.1


# Path: docs/source/examples/convection/plots/film_cooling.py
import numpy as np
from matplotlib import pyplot as plt
from proptools import convection

"""Film cooting example"""


T_aw = 3200   # Adiabatic wall temperature of core flow [units: kelvin].
T_f = 1600    # Film temperature [units: kelvin].
T_w = 700    # Wall temperature [units: kelvin].
x = np.linspace(0, 1)    # Distance downstream  [units: meter].
D = 0.5    # Diameter [units: meter].
m_dot_core = np.pi / 4 * D**2 * 5.33 * 253    # Core mass flow [units: kilogram second**-1].
m_dot_film = (1./99) * m_dot_core
mu_core = 2e-5 / 0.66   # Dynamic viscosity of the core fluid [units: pascal second].
Pr_film = 0.8
film_param = 1.265
cp_ratio = 0.8

eta = np.array([
    convection.film_efficiency(x_, D, m_dot_core, m_dot_film,
                               mu_core, Pr_film, film_param, cp_ratio)
    for x_ in x])

T_aw_f = convection.film_adiabatic_wall_temperature(eta, T_aw, T_f)