turboflow.axial_turbine.choking_criterion module
- turboflow.axial_turbine.choking_criterion.compute_critical_jacobian(x, inlet_plane, fluid, geometry, angular_speed, critical_state, model_options, reference_values, f0)[source]
Compute the Jacobian matrix of the compute_critical_values function using finite differences.
This function approximates the Jacobian of a combined function that includes the mass flow rate value, mass balance residual, and loss model evaluation residual at the critical point. It uses forward finite difference to approximate the partial derivatives of the Jacobian matrix.
- Parameters:
- xnumpy.ndarray
Array of input variables for the compute_critical_values function.
- inlet_planedict
Dictionary containing data on the inlet plane for the actual cascade operating condition.
- fluidobject
A fluid object with methods for thermodynamic property calculations.
- geometrydict
Geometric parameters of the cascade.
- angular_speedfloat
Angular speed of the cascade.
- critical_statedict
Dictionary to store the critical state information.
- model_optionsdict
Options for the model used in the critical condition evaluation.
- reference_valuesdict
Reference values used in the calculations, including mass flow reference and other parameters.
- f0numpy.ndarray
The function value at x, used for finite difference approximation.
- Returns:
- numpy.ndarray
The approximated Jacobian matrix of the compute_critical_values function.
- turboflow.axial_turbine.choking_criterion.compute_critical_values(x_crit, inlet_plane, fluid, geometry, angular_speed, critical_state, model_options, reference_values)[source]
Compute cascade performance at the critical conditions
This function evaluates the performance of a cascade at its critical operating point defined by:
Critical inlet absolute velocity,
Critical throat relative velocity,
Critical throat entropy.
Using these variables, the function calculates the critical mass flow rate and residuals of the mass balance and the loss model equations.
- Parameters:
- x_critnumpy.ndarray
Array containing scaled critical variables [v_in*, w_throat*, s_throat*].
- inlet_planedict
Dictionary containing data on the inlet plane for the actual cascade operating condition.
- fluidobject
A fluid object with methods for thermodynamic property calculations.
- geometrydict
Geometric parameters of the cascade.
- angular_speedfloat
Angular speed of the cascade.
- critical_statedict
Dictionary to store the critical state information.
- model_optionsdict
Options for the model used in the critical condition evaluation.
- reference_valuesdict
Reference values used in the calculations, including mass flow reference and other parameters.
- Returns:
- numpy.ndarray
An array containing the computed mass flow at the throat plane at critical state and the residuals for mass conservation and loss coefficient error.
- turboflow.axial_turbine.choking_criterion.critical_isentropic_throat(choking_input, inlet_plane, exit_plane, fluid, geometry, angular_speed, model_options, reference_values)[source]
Calculate condition for choking and evaluate wheter or not the cascade is choked, based on the critical_isentropic_throat choking model.
This choking model evaluates the cascade throat and checks if the throat mach number exceed unity. The throat is isentropic from inlet to throat. The exit flow angle is determined by ensuring that the mach at throat mach number equals the exit for subconic condition, and unity for supersonic conditions.
- Parameters:
- choking_inputdict
Dictionary containing scaled input parameters required for selected choking model. Required items are:
w_crit_throat : throat velocity.
- inlet_planedict
Dictionary containing data on the inlet plane for the actual cascade operating condition.
- exit_planedict
Dictionary containing data on the exit plane for the actual cascade operating condition.
- fluidobject
A fluid object with methods for thermodynamic property calculations.
- geometrydict
Geometric parameters of the cascade.
- angular_speedfloat
Angular speed of the cascade.
- model_optionsdict
Options for the model used to evaluate choking.
- reference_valuesdict
Reference values used in the calculation, including the reference mass flow rate.
- Returns:
- dict
Dictionary containing the residuals of choking model:
m*: Mass flow rate residual.
choking: Choking residual.
- dict
Dictionary satisfying the required elements for critical state dict.
- turboflow.axial_turbine.choking_criterion.critical_mach_number(choking_input, inlet_plane, exit_plane, fluid, geometry, angular_speed, model_options, reference_values)[source]
Calculate condition for choking and evaluate wheter or not the cascade is choked, based on the critical_mach_number choking model.
This choking model evaluates the cascade throat and checks if the throat mach number exceed the critical. The critical mach number is calculated from a correlation depending on the throat loss coefficient. The exit flow angle is calculated by the selected deviation model at subsonic condition, and by ensuring that the mach at the throat equals the critical at supercritical conditions.
- Parameters:
- choking_inputdict
Dictionary containing scaled input parameters required for selected choking model. Required items are:
w_crit_throat : throat velocity.
s_crit_throat : throat entropy.
beta_crit_throat : throat relative flow angle.
- inlet_planedict
Dictionary containing data on the inlet plane for the actual cascade operating condition.
- exit_planedict
Dictionary containing data on the exit plane for the actual cascade operating condition.
- fluidobject
A fluid object with methods for thermodynamic property calculations.
- geometrydict
Geometric parameters of the cascade.
- angular_speedfloat
Angular speed of the cascade.
- model_optionsdict
Options for the model used to evaluate choking.
- reference_valuesdict
Reference values used in the calculation, including the reference mass flow rate.
- Returns:
- dict
Dictionary containing the residuals of choking model:
m*: Mass flow rate residual.
Y*: Loss error residual.
beta*: Residual of the flow angle.
choking: Choking residual.
- dict
Dictionary containing relevant information on the critical state and throat plane.
- turboflow.axial_turbine.choking_criterion.critical_mass_flow_rate(choking_input, inlet_plane, exit_plane, fluid, geometry, angular_speed, model_options, reference_values)[source]
Calculate condition for choking and evaluate wheter or not the cascade is choked, based on the critical_mass_flow_rate choking model.
This choking model evaluate the critical state by optimizing the mass flow rate at the throat through the method of lagrange multipliers, and checks if the throat mach number exceed the critical. The exit flow angle is calculated by the selected devaition model at subsonic condition, and from the critical mass flow rate at supersonic conditions.
Compute the gradient of the Lagrange function of the critical mass flow rate and the residuals of mass conservation and loss computation equations at the throat.
The constrained optimization problem to maximize the mass flow rate can be converted to a set of equations through the method of lagrange multipliers. The method utlize that at the optimal point, the gradient of the constraints are proportional to the gradient fo the objective function. Thus the solution to the optimization problem eaulas the solution as the following set of equations:
\[\begin{split}\nabla L = \begin{bmatrix} \frac{\partial f}{\partial x_1} + \lambda_1 \cdot \frac{\partial g_1}{\partial x_1} + \lambda_2 \cdot \frac{\partial g_2}{\partial x_1} \\ \frac{\partial f}{\partial x_2} + \lambda_1 \cdot \frac{\partial g_1}{\partial x_2} + \lambda_2 \cdot \frac{\partial g_2}{\partial x_2} \\ \frac{\partial f}{\partial x_3} + \lambda_1 \cdot \frac{\partial g_1}{\partial x_3} + \lambda_2 \cdot \frac{\partial g_2}{\partial x_3} \\ g_1(x_1, x_2, x_3) \\ g_2(x_1, x_2, x_3) \\ \end{bmatrix} = 0\end{split}\]This function returns the value of the three last equations in the set above, while the two first equations are used to explicitly calculate the lagrange multipliers.
\[\begin{split}\lambda_1 = \frac{\frac{\partial g_2}{\partial x_2}\cdot\frac{-\partial f}{\partial x_1} - \frac{\partial g_2}{\partial x_1}\cdot-\frac{\partial f}{\partial x_2}} {\frac{\partial g_1}{\partial x_1}\cdot\frac{\partial g_2}{\partial x_2} - \frac{\partial g_2}{\partial x_1}\cdot\frac{\partial g_1}{\partial x_2}} \\ \lambda_2 = \frac{\frac{\partial g_1}{\partial x_1}\cdot\frac{-\partial f}{\partial x_2} - \frac{\partial g_1}{\partial x_2}\cdot-\frac{\partial f}{\partial x_1}} {\frac{\partial g_1}{\partial x_1}\cdot\frac{\partial g_2}{\partial x_2} - \frac{\partial g_2}{\partial x_1}\cdot\frac{\partial g_1}{\partial x_2}} \end{split}\]By transforming the problem into a system of equations, this approach allows the evaluation of the critical point without directly solving an optimization problem. One significant advantage of this equation-oriented method is that it enables the coupling of these critical condition equations with the other modeling equations. This integrated system of equations can then be efficiently solved using gradient-based root finding algorithms (e.g., Newton-Raphson solvers).
Such a coupled solution strategy, as opposed to segregated approaches where nested systems are solved sequentially and iteratively, offers superior computational efficiency. This method thus provides a more direct and computationally effective way of determining the critical conditions in a cascade.
- Parameters:
- critical_cascade_inputdict
Dictionary containing scaled input parameters required for selected choking model. Required items are:
v_crit_in : inlet velocity at critical state.
w_crit_throat : throat velocity at critical state.
s_crit_throat : throat entropy at critical state.
- inlet_planedict
Dictionary containing data on the inlet plane for the actual cascade operating condition.
- exit_planedict
Dictionary containing data on the exit plane for the actual cascade operating condition.
- fluidobject
A fluid object with methods for thermodynamic property calculations.
- geometrydict
Geometric parameters of the cascade.
- angular_speedfloat
Angular speed of the cascade.
- model_optionsdict
Options for the model used in the critical condition evaluation.
- reference_valuesdict
Reference values used in the calculation, including the reference mass flow rate.
- Returns:
- dict
Dictionary containing the residuals of choking model:
m*: Mass flow rate residual.
Y*: Loss error residual.
L*: Residual of the lagrange function.
choking: Choking residual.
- dict
Dictionary containing state information on the critical conditions at inlet and throat plane.
- turboflow.axial_turbine.choking_criterion.evaluate_choking(choking_input, inlet_plane, exit_plane, fluid, geometry, angular_speed, model_options, reference_values)[source]
Calculate condition for choking and evaluate wheter or not the cascade is choked, based on selected choking model.
- Parameters:
- choking_inputdict
Dictionary containing necessary input parameters required for selected choking model. See each models documentation for specifics.
- inlet_planedict
Dictionary containing data on the inlet plane for the actual cascade operating condition.
- exit_planedict
Dictionary containing data on the exit plane for the actual cascade operating condition.
- fluidobject
A fluid object with methods for thermodynamic property calculations.
- geometrydict
Geometric parameters of the cascade.
- angular_speedfloat
Angular speed of the cascade.
- model_optionsdict
Options for the model used to evaluate choking.
- reference_valuesdict
Reference values used in the calculation, including the reference mass flow rate.
- Returns:
- dict
Dictionary containing the residuals of choking model
- dict
Dictionary containing state information on the critical conditions.
- Raises:
- ValueError
If an invalid choking model is provided.
- turboflow.axial_turbine.choking_criterion.get_flow_capacity(Ma, gamma, eta)[source]
Compute dimensionless mass flow rate for non-isentropic flow in a nozzle.
This function calculates the dimensionless mass flow rate (\(\Phi\)) using the given Mach number (\(\text{Ma}\)), specific heat ratio (\(\gamma\)), and efficiency (\(\eta\)).
\[\Phi = \left(\frac{\dot{m} \sqrt{R T_{0}}}{p_{0} A}\right) = \left(\frac{2 \gamma}{\gamma-1}\right)^{1 / 2} \cdot \frac{\sqrt{1-\hat{T}}}{\hat{T}} \left[1-\frac{1}{\eta}(1-\hat{T})\right]^{\frac{\gamma}{\gamma-1}}\]where:
\[\hat{T} = \left(\frac{T}{T_{0}}\right)\]and
\[\eta = 1 - \Delta \phi^2\]Here, \(\Delta \phi^2\) is the kinetic energy loss coefficient.
- Parameters:
- Mafloat
Mach number of the flow.
- gammafloat
Specific heat ratio of the gas.
- etafloat
Nozzle efficiency, related to the kinetic energy loss coefficient.
- Returns:
- float
Dimensionless mass flow rate.
- turboflow.axial_turbine.choking_criterion.get_mach_crit(gamma, eta)[source]
Compute the critical Mach number for non-isentropic flow in a nozzle.
This function calculates the critical Mach number (\(\text{Ma}_\text{crit}\)) using the given specific heat ratio (\(\gamma\)) and nozzle efficiency (\(\eta\)).
\[\text{Ma}_\text{crit}^{2} = \left(\frac{2}{\gamma-1}\right)\left(\frac{1}{\hat{T}_\text{crit}}-1\right) = \left(\frac{2}{\gamma-1}\right)\left[\frac{4 \alpha-2}{(2 \alpha+\eta-3) + \sqrt{(1+\eta)^{2}+4 \alpha(1+\alpha-3 \eta)}} - 1\right]\]where:
\[\alpha = \frac{\gamma}{\gamma-1}\]and
\[\eta = 1 - \Delta \phi^2\]Here, \(\Delta \phi^2\) is the kinetic energy loss coefficient.
- Parameters:
- gammafloat
Specific heat ratio of the gas.
- etafloat
Nozzle efficiency, related to the kinetic energy loss coefficient.
- Returns:
- float
Critical Mach number.