Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how the app works #11

Open
ashwinvis opened this issue Feb 10, 2025 · 2 comments
Open

Document how the app works #11

ashwinvis opened this issue Feb 10, 2025 · 2 comments

Comments

@ashwinvis
Copy link
Owner

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:

caeroc-app = "caeroc.cli:caeroc_app"

  1. launches the app

def caeroc_app():
import caeroc
try:
caeroc.launch()
except AttributeError:
app = caeroc.gui.CalcApp()
app.run()

  1. via this launch function

    def launch():
    from . import gui
    gui.CalcApp().run()

  2. via the run method

    class CalcApp:
    def __init__(self):
    try:
    self.app = _QtApp(sys.argv)
    except RuntimeError:
    self.app = _QtApp.instance() # if QApplication already exists
    self.dialog = runtime.CalcDialog()
    def run(self):
    self.dialog.show()
    sys.exit(self.app.exec_())

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 #10 (comment)

@Neon22
Copy link
Contributor

Neon22 commented Feb 14, 2025

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.

@ashwinvis
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants