caeroc icon indicating copy to clipboard operation
caeroc copied to clipboard

Document how the app works

Open ashwinvis opened this issue 11 months ago • 2 comments

The app was built on Qt4, and later upgraded to Qt5 rather seamlessly. I can explain what goes on and ideally it should have been documented somewhere. The call tree goes like this

  1. terminal command:

https://github.com/ashwinvis/caeroc/blob/0ae3f21bd9ac2b496e1338e3cf53fc4ee2131983/pyproject.toml#L33

  1. launches the app

https://github.com/ashwinvis/caeroc/blob/0ae3f21bd9ac2b496e1338e3cf53fc4ee2131983/src/caeroc/cli.py#L5-L12

  1. via this launch function https://github.com/ashwinvis/caeroc/blob/0ae3f21bd9ac2b496e1338e3cf53fc4ee2131983/src/caeroc/init.py#L34-L37

  2. via the run method https://github.com/ashwinvis/caeroc/blob/0ae3f21bd9ac2b496e1338e3cf53fc4ee2131983/src/caeroc/gui/init.py#L11-L21

The run method initializes the app. The class CalcApp merely exists to swap between PyQt5 or PySide2, based on what is installed.

All user interactions are channeled through the methods in runtime.py which are decorated with @Slot.

P.S.: not important, but a development detail. The UI is designed using Qt Designer which let's one save it as an XML file, named base.ui here. Running a small script called configure provided in the same directory produces from base.ui, the files base_pyqt.py & base_pyside2.py which is the equivalent Python code for PyQt and PySide2 respectively.

Originally posted by @ashwinvis in https://github.com/ashwinvis/caeroc/issues/10#issuecomment-2648048509

ashwinvis avatar Feb 10 '25 13:02 ashwinvis

Can you confirm my interpretation please ?

Primary input is the Mach number:

  • then choose Isentropic or Expansion (you have to choose one)
  • if Expansion then also input angle and gamma
  • choose shockwave - normal or oblique
  • not yet: - Fanno flow or Rayleigh Flow
    • Fanno flow focuses on friction losses in a pipe
    • Rayleigh flow focuses on heat addition or removal in a frictionless pipe.
  • One day:
    • change airfoils (Naca ?)
    • can change nozzles (choices?) Then self.mode.calculate(kwargs)

Where specifically: Isentropic gas flow is characterized by:

  • Viscous and heat conductivity effects are negligible.
  • No chemical or radioactive heat production.
  • p-p0 = Pressure ratio from Mach number. (array of each)
  • rho_rho0 = Density ratio from Mach number. (array of each)
  • T_T0 = Temperature ratio from Mach number. (array of each)
  • A_Astar = Area ratio from Mach number. (array of each)
    • Duct area divided by critial area given Mach number.
  • a_a0 = Speed of sound ratio from Mach number. (array of each)

PrandtlMeyerExpansion fan:

  • nu = Prandtl-Meyer angle for a given Mach number and gamma. (float)
    • must be supersonic
  • nu_1 = Upstream Prandtl-Meyer angle.
  • nu_2 = Downstream Prandtl-Meyer angle.
  • M_2 = Downstream Mach number.
  • mu_1 = Angle of forward Mach line.
  • mu_2 = Angle of rearward Mach line.
  • p2_p1 = Pressure ratio across the expansion fan.
  • T2_T1 = Temperature ratio across the expansion fan.
  • rho2_rho1 = Density ratio across the expansion fan.

Neon22 avatar Feb 14 '25 20:02 Neon22

Correct. Isentropic, expansion, normal shocks, obliques shocks are all different flow states with particular formulae.

The text book example is a flow through a shock tube.

  • Compressed air in stagnation condition (p0, rho0, T0) is released into a shock tube suddenly, accelerating the air into supersonic velocities, described by the Mach number.
  • As long as there are no losses and no sudden changes along the wall, the flow can be approximated to be isentropic.
  • The flow has to match with the outlet conditions. If it is subsonic at the outlet a normal shock may occur, decelerating the flow into subsonic velocities. M_2 is the downstream Mach number. Similarly other quantities with 2 suffix.
  • If the area contracts, an oblique shock is formed, also decelerating the flow
  • If the area expands an expansions fan is formed, accelerating the flow

ashwinvis avatar Feb 15 '25 12:02 ashwinvis