A Python tool for meanline turbomachinery design and analysis.
Project description
TurboFlow: Axial Turbine Mean-line Modelling
Meanline Axial is a tool for mean-line modelling of axial turbines. It provides a systematic approach to analyze and optimize axial turbines based on specified requirements.
Core Features
- Performance Analysis Mode:
- Evaluate single operating points
- Produce performance maps
- Design Optimization Mode:
- Single point optimization
- Multi-point optimization
- Problem formulation and solution
- Equation-oriented problem formulation for performance analysis and design optimization
- Consistency between both calculation modes is guaranteed by design
- Efficient solution with gradient-based root-finding and optimization solvers
- Multi-start strategies or derivative-free optimizers for global optimization
- Fluid Property Analysis:
- Use CoolProp to determine real gas fluid properties.
- Design Flexibility:
- Supports modelling with any number of turbine stages.
- Specify turbine geometry using main geometric parameters.
- Choking Calculations:
- General computational strategy to evaluate cascade choking.
- Formulation autonomously identifies choked cascades for a set of operating conditions
- Loss Models:
- Kacker Okapuu model.
- Benner model.
Installation Instructions
-
Install Conda:
Before proceeding, ensure you have Conda installed on your system.
-
Create a virtual environment with dependencies:
Run the following command in Bash to set up a new virtual environment with all the required dependencies:
conda env create --file environment.yaml
This command will create a virtual environment named
meanline_env
and will install all the packages specified in theenvironment.yaml
file. -
Activate the virtual environment:
conda activate meanline_env
-
Installing additional packages (optional):
If you need any additional packages, they can be installed using:
conda install <name of the package>
Alternatively, you can add package names directly to the
environment.yaml
file and then update the environment:conda env update --file environment.yaml --prune
-
Setting up for local development
To ensure that you can import the package for local development, you need to add the package directory to the
PYTHONPATH
variable. We have provided a convenient script namedinstall_local.py
to do this for you.Just run:
python install_local.py
This will append the current working directory (which should be the root of this repository) to your
PYTHONPATH
by adding a line to your~/.bashrc
file.Note: This is a temporary development solution. In the future the package will be installed via pip/conda.
To-do list
-
Verify torque and efficiency deviation match
-
Check if the correlation for incidence losses from Moustapha 1990 is better
-
Check if baseline kacker-okapuu + moustapha 1990 is better
-
Create clean dataset including torque/efficiency/flow angle for each pressure ration/speed
-
Extend validation Kofskey1972 to exit flow angle
-
Add x=y comparison plots for the validation
-
Verify the displacement thickness value for kofskey1974
-
Try to extract the shock loss at the inlet fromm the profile loss to have a more clear split of the losses
-
Add better smoother for Mach number constraint
-
Add generic smoothing functions for min/max/abs/piecewise
-
Replace all non-differentiable functions of the code (specially in the loss models)
-
Improve initial guess computation for supersonic case (call the function
initialize()
) -
Validate model with experimental data
-
Add automatic testing (pytest) to ensure that new code pushes do not introduce breaking changes
-
Make function to plot performance maps more general
-
Add functionality to export/import all the parameters corresponding to a calculated operating point
-
Make the plotting of performance maps more general and add functionality to save figures
-
Add environment.yaml file to install all dependencies at once
-
Add Sphinx documentation structure
-
Implement design optimization
- Single-point
- Multi-point
-
Add CI/CD pipeline to run tests and update documentation on new pushes to main branch
-
Think of a nice catchy name for the project
- MeanFlow?
- MeanStream?
- MeanTurbo
- MeanTurboPy
- TurboCompuCore
- TurboCore
- Meanpy
- Others?
- TurboFlow?
To-do list 10.11.2023
- Residuals and independent variables should be dictionaries
- Improve initial guess functionality (Lasse)
- Move initial guess generation into the CascadesNonlinearSystemProblem() class
- Move the solution scaling into the CascadesNonlinearSystemProblem() class [how to re-use scaling for optimization?]
- Generation within CascadesNonlinearSystemProblem() class
- Initial guess should be a dictionary with keys
- Initial guess specification in YAML file (this will be used for the first operation point)
- Improve initial guess calculation and extend to multistage
- 1D correlation for Ma_crit as a function of the loss coefficient of the cascade
- Geometry processing (Roberto)
- Clean up code
- Improve docstrings
- Discuss and improve the throat area calculation (Roberto/Lasse)
- Update PySolverView to solve root finding problems with the optimization solver.
- Add computation time in solver report
- Improve robustness with random generation of initial guesses
- Specify the number of initial guesses that will be tried, e.g., 50
- Specify the ranges of variables to be sampled from (enthalpy frac distribution, efficiency ts and tt)
- Use a sampling techniques like latin hypercube, montecarlo, or orthogonal sampling'
- https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html
- Add regression tests
TODO 17.11.2023
- Add validation of configuration file
- Add configuration file options to documentation (automated process)
- Add logger object to the performance analysis and optimization functions
- Log errors and warnings during model evaluation (print after convergence history?)
- Improve geometry generation functionality to create full geometry from design optimization variables
- Improve printing/logging with imporve control over verbosity
- Solver improvements
- Unify optimization problem so that it can be solver with root finding and optimization methods
- Add pygmo solvers to the pysolverview interface (IPOPT/SNOPT)
- Improve deviation modeling to cover cases when:
- Area changes from throat to exit
- Radius changes from throat to exit
- There is an additional blockage factor at the throat
- Add plotting functionality
- Plot velocity triangles
- Plot blade to plade plane
- Plot meridional view
- Plot h-s or T-s diagrams of the expansion
- Nice validation plotting against experimental data
TODO 06.12.2023
- Use gauge and and not opening-to-pitch in deviation model functions
- Make sure opening is only used for the critical mass flow rate calculation and blockage factor
- Do not use ordinary compute_cascade_exit function to determine the flow conditions at the throat
- Have the option to calculate the state at the throat for the actual condition? Probably not
- Remove option of choking condition
- Deviation model new structure:
- low_speed_limit: aungier | ainley-methieson | zero-deviation
- interpolation: aungier | ainley-methieson | borg
- blending_parmaters: n: m: slope:
- We improve slope so that it works when A_th=A_exit and in other cases (slope zero or one)
- Improve initialization / initial guess generation
- Write down notes explaining the behavior of the deviation model when the area is the same and when it changes
- Write down notes explaining the equations for the blending
- check the throat area calculation i nthe geometyr.py script and clean it
- add option to calculate throat loasses without trailing edge losses
TODO 16.01.2024
- Improve solver to not converge for low residual, and converge for satisfactory residuals
- Implement the blender such that it is only used for zero deviation
- Improve initial guess function
Guidelines/instructions for the deviation model
Subsonic deviation according to ainley-mathieson or aungier, or zero-deviation critical mach number according to out calculation critical flow angle equal to metal_angle_out
interpolation can be:
- ainley-methieson (linear)
- aungier (5th order polynomial for delta)
- third order polynomial with controller end-point slope (parameter to have slope 1 or slope 0)
slope should be zero for cases when Mach_crit_throat = Mach_crit_exit slope should be close to one for cases when Mach_crit_throat > Mach_crit_exit
sigmoid blending between subsonic interpolated function and the supersonic solution (in the subsonic regime) we have to expend the supersonic branch into the subsonic to calculate the flow angle to ensure that we have a smooth flow angle transition
CI/CD
Improvements from Marta
- Change loader and dumper to recognize numpy (custom tags)
- Use pedantic for validation instead of custom function (JSON schema)
- Follow up gitlab pages
- Dynamic generation of function mapping dictionary
- Add logger with errors, info and warnings
- FASTApi - open API (swagger)
Installation
To create virtual environment to isolate installation
conda env create -f environment.yaml
conda activate turboflow_env pip install poetry
poetry init
Developer installation
Clone the repository
conda env create -f environment.yaml
conda activate turboflow_env pip install poetry
poetry install
Additional optimizers
optionally install pygmo optimizers
conda install pygmo pygmo_plugins_nonfree
Additionally, in order to use snopt you have to define the environmental variables for the license file and the xx.
You can do this in windows following this tutorial, or by addtion these lines to you bashrc file in linux or if using gitbash in windows
instructions for snopt DLLs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for turboflow-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10c708654e3a5f79092aa708363a7acb84ebc9468851298e70803ea7668d30dc |
|
MD5 | a7a983d017b2395cb634308caa122a54 |
|
BLAKE2b-256 | 8c1291fe4b2c13cd30f9835e31df96a7fa0e829d84c867122d87275d444d4af0 |