-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: main
Are you sure you want to change the base?
Improve nozzle continuity equations #3
Conversation
- Defined new test on NozzleAero to fit thermodynamics equations defined in other codes - Defined another definition for nozzle aero to help clarify equations
…ow calculation at the outlet
…test_run_once_shaft (wasn't running before)
…et or due to the new way of calculating the nozzle's performance (need a reference nozzle)
There was a problem hiding this 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
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script has been removed
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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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") |
There was a problem hiding this comment.
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
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
self.add_inward("S_inlet", value=3.14159) | ||
self.add_inward("S_outlet", value=2.0) | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
… "simple_nozzle.py"
…also pythermo lib functions in compute
…converging diverging architecture or solo converging
…ring a new inward
…at throat intialization
… one to test a system swap in the turbo fan, more thermo library function were used
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 |
There was a problem hiding this 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 !
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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
pyturbo/thermo/ideal_gas.py
Outdated
def pcrit_f_pt(self, pt: float, ts: float) -> float: | ||
gamma = self.gamma(ts) | ||
pcrit = pt * (2 / (gamma + 1)) ** (gamma / (gamma - 1)) | ||
return pcrit | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is it ?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Louis !
Improve nozzle modelling to ensure continuity in the equations between subsonic and sonic state in convergent nozzles