o.py

Created by teivaetienne

Created on December 03, 2025

8.15 KB


def menu():
  while True:
    print("\n=== SUPER MEMO V3 (ULTIME) ===")
    print("--- THERMODYNAMIQUE ---")
    print("1. COURS: Courbes & Defs")
    print("2. FORMULES & Lois")
    print("3. METHODE: Resoudre Exos")
    print("--- MECANIQUE FLUIDES ---")
    print("4. COURS: Regimes & Hyp")
    print("5. FORMULES: Bern/Pertes")
    print("6. METHODE: Resoudre Exos")
    print("--- ECHANGEURS ---")
    print("7. COURS & FORMULES (Tout)")
    print("0. QUITTER")
    c = input("Choix? ")
    if c=='1': c_thermo()
    elif c=='2': f_thermo()
    elif c=='3': m_thermo()
    elif c=='4': c_fluides()
    elif c=='5': f_fluides()
    elif c=='6': m_fluides()
    elif c=='7': c_echange()
    elif c=='0': break

# ==========================================
#      BLOC THERMODYNAMIQUE
# ==========================================
def c_thermo():
  print("\n-- ALLURE COURBES (Diag PV) --")
  print("Axe Y=Pression / Axe X=Volume")
  print("1. ISOCHORE (V=cst):")
  print("   -> Droite VERTICALE")
  print("   -> W=0 (Surface nulle)")
  print("2. ISOBARE (P=cst):")
  print("   -> Droite HORIZONTALE")
  print("   -> W = Rectangle sous courbe")
  print("3. ISOTHERME (T=cst):")
  print("   -> Hyperbole (courbe douce)")
  print("   -> P = nRT/V")
  print("4. ADIABATIQUE (Q=0):")
  print("   -> Hyperbole PENTE RAIDE")
  print("   -> Pente + forte que Isotherme")
  print("   -> PV^gamma = Cst")
  input("Suivant...")
  print("\n-- CYCLES (Sens parcours) --")
  print("HORAIRE (Aiguilles montre):")
  print("   -> MOTEUR (W < 0, fourni)")
  print("   -> W = Aire interieure")
  print("ANTI-HORAIRE (Trigo):")
  print("   -> RECEPTEUR (W > 0, recu)")
  print("   -> Frigo ou PAC")
  input("Suivant...")
  print("\n-- DEFINITIONS CLES --")
  print("U (Energie Interne):")
  print("   -> Dep. que de T (Gaz Parfait)")
  print("   -> dU=0 sur un CYCLE entier")
  print("   -> dU=0 si ISOTHERME (GP)")
  print("H (Enthalpie): H = U + PV")
  print("   -> Utile pour ecoulements")

def f_thermo():
  print("\n-- GAZ PARFAITS --")
  print("PV = nRT")
  print("Unites: P(Pa), V(m3), T(Kelvin)")
  print("T(K) = T(C) + 273.15")
  print("1 bar = 10^5 Pa | 1 L = 10^-3 m3")
  print("R = 8.314 J/mol.K")
  print("M(Air)=29 g/mol | n=m/M")
  print("\n-- COEFFICIENTS --")
  print("Alpha = 1/V (dV/dT)p (Isobare)")
  print("Beta = 1/P (dP/dT)v (Isochore)")
  print("Khi_T = -1/V (dV/dP)T (Isoth)")
  print("Lien: Alpha = P . Beta . Khi_T")
  input("Suivant...")
  print("\n-- 1er PRINCIPE (Ferme) --")
  print("dU = W + Q")
  print("Loi Joule (GP): dU = n.Cv.dT")
  print("Mayer: Cp - Cv = R")
  print("Gamma(y) = Cp/Cv (>1)")
  print("Mono: y=1.67 | Di(Air): y=1.4")
  print("Cv = R/(y-1) | Cp = yR/(y-1)")
  input("Suivant...")
  print("\n-- CALCUL TRAVAIL (W) --")
  print("Isochore: W = 0")
  print("Isobare:  W = -P(V2-V1)")
  print("Isotherme:W = -nRT.ln(V2/V1)")
  print("Adiabat.: W = dU = n.Cv.dT")
  print("          W = (P2V2-P1V1)/(y-1)")
  print("\n-- LOIS LAPLACE (Adiaba) --")
  print("Seulement si Adiabatique Rev!")
  print("1. PV^y = Cst")
  print("2. TV^(y-1) = Cst")
  print("3. T^y . P^(1-y) = Cst")
  input("Suivant...")
  print("\n-- RENDEMENTS (e) --")
  print("Def: e = |Utile / Payee|")
  print("1. MOTEUR (W<0, Qc>0):")
  print("   e = -W / Qc = 1 + Qf/Qc")
  print("   (0 < e < 1)")
  print("2. FRIGO (W>0, Qf>0):")
  print("   COP = Qf / W (souvent > 1)")
  print("3. PAC (W>0, Qc<0):")
  print("   COP = -Qc / W")
  print("   Relation: COP_pac = COP_fr + 1")

def m_thermo():
  print("\n-- METHODE EXO THERMO --")
  print("1. IDENTIFIER TRANSFORMATION")
  print("   - 'Volume constant' -> Isochore")
  print("   - 'Pression cst' -> Isobare")
  print("   - 'Temp cst' -> Isotherme")
  print("   - 'Calorifuge/Rapide' -> Adiabatique")
  print("2. CALCULER VARIABLES (P,V,T)")
  print("   - Utiliser PV=nRT a l'etat 1")
  print("   - Utiliser la loi de la transfo")
  print("     (ex: P1V1=P2V2 si Isotherme)")
  print("     (ex: P1/T1=P2/T2 si Isochore)")
  print("3. CALCULER ENERGIES")
  print("   - Calculer W (voir Formules)")
  print("   - Calculer dU = n.Cv.(T2-T1)")
  print("   - Deduire Q = dU - W")
  print("   (Sauf si Adia: Q=0, W=dU)")

# ==========================================
#      BLOC MECANIQUE FLUIDES
# ==========================================
def c_fluides():
  print("\n-- REGIMES ECOULEMENT --")
  print("Nombre Reynolds: Re = rho.v.D / mu")
  print(" ou Re = v.D / nu")
  print("1. LAMINAIRE (Re < 2000):")
  print("   - Filets paralleles, calme")
  print("   - Profil vitesse parabolique")
  print("   - Pertes charge lineaires")
  print("2. TURBULENT (Re > 3000):")
  print("   - Melange, tourbillons")
  print("   - Profil vitesse 'plat'")
  print("   - Pertes charge en V^2")
  print("\n-- VISCOSITE --")
  print("Dynamique (mu): Pa.s (ou Poiseuille)")
  print("Cinematique (nu): m2/s (ou Stokes)")
  print("Lien: nu = mu / rho")

def f_fluides():
  print("\n-- HYDROSTATIQUE (Repos) --")
  print("P_bas - P_haut = rho.g.h")
  print("P_abs = P_rel + P_atm")
  print("Force Paroi: F = Integrale(P.dS)")
  print("Mur rect (Lxh): F = 1/2.rho.g.L.h^2")
  print("Centre Poussee: a h/3 du fond")
  print("ARCHIMEDE: Pi = rho_fluide.V_imm.g")
  print("Pt appli: Centre carene (vol imm)")
  input("Suivant...")
  print("\n-- DYNAMIQUE (Mvt) --")
  print("Debit: Qv = S.v (m3/s)")
  print("Masse: Qm = rho.Qv (kg/s)")
  print("Continuite: S1.v1 = S2.v2")
  print("\n-- BERNOULLI (Energy) --")
  print("Hyp: Incomp, Parfait, Perm")
  print("P + rho.g.z + 0.5.rho.v^2 = Cst")
  print("Avec Pertes (J ou dP):")
  print("Charge_A = Charge_B + dP_AB")
  print("Charge_A + Pompe = Charge_B + dP")
  input("Suivant...")
  print("\n-- PERTES DE CHARGE --")
  print("dP_tot = dP_lin + dP_sing")
  print("LINEAIRES (Darcy):")
  print("   dP = lam . (L/D) . (0.5.rho.v^2)")
  print("   Si Laminaire: lam = 64/Re")
  print("   Si Turbulent: Blasius 0.316.Re^-0.25")
  print("SINGULIERES (Coudes, vannes):")
  print("   dP = K . (0.5.rho.v^2)")
  print("   (K donne ou abaque)")
  input("Suivant...")
  print("\n-- FORMULES SPECIALES --")
  print("Torricelli (Vidange): v = sqrt(2gh)")
  print("Pitot (Vitesse): v = sqrt(2dP/rho)")
  print("Venturi (Debit):")
  print("   Qv = S1.S2.sqrt(2dP/rho(S1^2-S2^2))")
  print("Euler (Force jet):")
  print("   F = Qm * (v_sortie - v_entree)")

def m_fluides():
  print("\n-- METHODE BERNOULLI --")
  print("1. CHOIX DES POINTS A et B")
  print("   - Surface libre (P=Patm, v=0)")
  print("   - Sortie a l'air (P=Patm)")
  print("2. ECRIRE L'EQUATION")
  print("   Pa + rgzA + 0.5rvA^2 + Pomp")
  print("   = Pb + rgzB + 0.5rvB^2 + Pertes")
  print("3. SIMPLIFIER")
  print("   - Si A et B a l'air: Pa=Pb")
  print("   - Si grand reservoir: vA=0")
  print("   - Si tuyau horizontal: zA=zB")
  print("4. CALCULER PERTES")
  print("   - Calculer Re d'abord")
  print("   - Trouver lambda")
  print("   - Sommer les K")

# ==========================================
#      BLOC ECHANGEURS
# ==========================================
def c_echange():
  print("\n-- MODES TRANSFERT --")
  print("1. CONDUCTION (Solide, Fourier)")
  print("   Flux = dT / R_th")
  print("   R_mur = e / (lambda.S)")
  print("   R_tube = ln(Re/Ri)/(2pi.L.lam)")
  print("   Mur serie: R_eq = R1 + R2")
  print("2. CONVECTION (Fluide, Newton)")
  print("   Flux = h . S . (Tparoi - Tfluide)")
  print("   R_conv = 1 / (h . S)")
  print("   h depend vitesse, fluide...")
  input("Suivant...")
  print("\n-- ECHANGEURS --")
  print("CO-COURANT: Fluides meme sens")
  print("   - T sortie froid < T sortie chaud")
  print("   - Moins efficace")
  print("CONTRE-COURANT: Sens opposes")
  print("   - T sortie froid peut > T s ch")
  print("   - Plus efficace (DTLM + grand)")
  input("Suivant...")
  print("\n-- CALCULS ECHANGEUR --")
  print("1. BILAN PUISSANCE (Adiabatique)")
  print("   Phi = Qm_c.Cp_c.(Te_c - Ts_c)")
  print("       = Qm_f.Cp_f.(Ts_f - Te_f)")
  print("   (Permet de trouver une Temp)")
  print("2. DIMENSIONNEMENT (Surface)")
  print("   Phi = U . S . DTLM")
  print("   U = Coeff global (inverse des R)")
  print("   1/US = 1/hiSi + Rcond + 1/heSe")
  print("3. DTLM (Moyenne Log)")
  print("   DTLM = (dT1 - dT2) / ln(dT1/dT2)")
  print("   dT1 = Ecart T entree echangeur")
  print("   dT2 = Ecart T sortie echangeur")
  print("   /!\ Bien faire le schema sens!")

menu()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.