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

Improve nozzle continuity equations #3

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

LouisFonteneauMarcel
Copy link

Improve nozzle modelling to ensure continuity in the equations between subsonic and sonic state in convergent nozzles

- Defined new test on NozzleAero to fit thermodynamics equations defined in other codes
- Defined another definition for nozzle aero to help clarify equations
…et or due to the new way of calculating the nozzle's performance (need a reference nozzle)
Copy link
Contributor

@GuyDSP GuyDSP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for PR. mainly comments to respect from the begining the good practices

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you avoid scrypt and use tests instead ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script has been removed

Comment on lines 78 to 87
self.add_outward("Ps1", 0.0, unit="pa", desc="static pressure at inlet")
self.add_outward("Ps2", 0.0, unit="pa", desc="static pressure at outlet")
self.add_outward("Ps_crit", 0.0, unit="pa", desc="critical static pressure at throat")
self.add_outward("Ts1", 0.0, unit="pa", desc="static pressure at inlet")
self.add_outward("Ts2", 0.0, unit="pa", desc="static pressure at outlet")
self.add_outward("M1", 0.0, unit="", desc="mach at inlet")
self.add_outward("M2", 0.0, unit="", desc="mach at outlet")
self.add_outward("mach", 0.0, unit="", desc="mach at outlet")
self.add_outward("rho_2", 1.2, unit="kg/m**3", desc="Fluid density at outlet")
self.add_outward("speed", 0.0, unit="m/s", desc="fluid flow speed at outlet")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not add outwards unless they are necessary (mainly, used for postprocessing or for connections).
please also respect the conventional case

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary outwards have been removed and conventional case has been applied

Comment on lines 74 to 75
self.add_inward("gamma", 1.4, unit="", desc="Heat capacity ratio")
self.add_inward("rho_1", 1.2, unit="kg/m**3", desc="Fluid density at inlet")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should be calculated from fluid lfow inputs

Comment on lines 101 to 103
self.Ps_crit = ((2 / (self.gamma + 1)) ** (self.gamma / (self.gamma - 1))) * self.fl_out.Pt
self.Ps1 = self.fl_in.Pt - 0.5 * ((self.fl_in.W**2) / (self.rho_1 * (self.area_in**2)))
self.Ps2 = max(self.Ps_crit, self.pamb)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see gas thermo librairy each time it is possible

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code has been modified to use thermo library functions are used whe possible

self.Ps1 = self.fl_in.Pt - 0.5 * ((self.fl_in.W**2) / (self.rho_1 * (self.area_in**2)))
self.Ps2 = max(self.Ps_crit, self.pamb)

self.rho_2 = self.rho_1 * ((self.Ps2 / self.Ps1) ** (-self.gamma))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isentropic expension ? use thermo library

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach is different now, hence this expansion is no longer calculated and the thermo library has been use

Comment on lines 13 to 15
self.add_inward("S_inlet", value=3.14159)
self.add_inward("S_outlet", value=2.0)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

respect conventional name when ever possible

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Component has been removed as it was useless

…static pressure at the outlet, equality of flow inlet and outlet to calulate the flow's state at the outlet of a fixed geometry nozzle)
…, the mach number in a convergent nozzle should not exceed 1. However density may not be considered constant anymore as we study compressible flows (M>0.3)
…converging diverging architecture or solo converging
… one to test a system swap in the turbo fan, more thermo library function were used
@LouisFonteneauMarcel
Copy link
Author

The critical pressure calculation from static temperature and total pressure has been added as function in the "thermo" module of pyturbo:

def pcrit_f_pt(self, pt: float, ts: float) -> float:
        gamma = self.gamma(ts)
        pcrit = pt * (2 / (gamma + 1)) ** (gamma / (gamma - 1))
        return pcrit

Copy link
Contributor

@GuyDSP GuyDSP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few minor comments, thank you Louis !

Comment on lines 70 to 72
self.add_inward("area_in", 0.0625 * np.pi, unit="m**2", desc="inlet aero section")
self.add_inward("area_exit", 0.0225 * np.pi, unit="m**2", desc="exit aero section")
self.add_inward("area", 0.0225 * np.pi, unit="m**2", desc="choked/exit area")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange value. radius square ? specific ? should have more explicite data.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed those values are already squared, the definition is modified in regards to this lack of clarity

Comment on lines 139 to 143
def pcrit_f_pt(self, pt: float, ts: float) -> float:
gamma = self.gamma(ts)
pcrit = pt * (2 / (gamma + 1)) ** (gamma / (gamma - 1))
return pcrit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is it ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a recalculation of critical static pressure, it has been removed because it is useless, the static_p function calculates the same thing when Mach=1

- Removed recalculation of critical pressure as it can be defined with static_p with mach argument equal to 1
Copy link
Contributor

@GuyDSP GuyDSP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Louis !

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

Successfully merging this pull request may close these issues.

2 participants