Coder Social home page Coder Social logo

nasa / t-mats Goto Github PK

View Code? Open in Web Editor NEW
242.0 57.0 120.0 16.1 MB

An open source thermodynamic modeling package completed on behalf of NASA. The Toolbox for the Modeling and Analysis of Thermodynamic Systems (T-MATS) package offers a MATLAB/Simulink toolbox that gives a developer the ability to create simulations of such thermodynamic systems as turbomachinery and gas turbines. Keywords: TMATS, Control System, Numerical Methods, Newton-Raphson, Jacobian Calculation, Propulsion, Aircraft Engine, Jet, Turbofan, Turbojet, Compressor, Turbine, Nozzle, Inlet, open source

License: Apache License 2.0

HTML 42.97% MATLAB 32.55% C 20.12% M 0.02% PLSQL 4.09% CSS 0.26%

t-mats's Introduction

T-MATS

Toolbox for the Modeling and Analysis of Thermodynamic Systems
Click Here for stable release download
For questions, comments, and general support see the T-MATS user's forum.
Please take a moment and fill out our Survey, user interest and feedback allows us to continue working on this package.

Introduction
The Toolbox for the Modeling and Analysis of Thermodynamic Systems (T-MATS) is a Simulink toolbox intended for use in the modeling and simulation of thermodynamic systems and their controls. T-MATS contains generic thermodynamic and controls components that may be combined with a variable input iterative solver and optimization algorithm to create complex systems to meet the needs of a developer. Development of this tool was initiated on behalf of the NASA Aviation Safety Program's Vehicle Systems Safety Technologies (VSST) project.

Description
The T-MATS software provides a toolbox for the development of thermodynamic system models; it contains a simulation framework, multi-loop solver techniques, and modular thermodynamic simulation blocks. While much of the capability in T-MATS is in transient thermodynamic simulation, the developers' main interests are in aero-thermal applications; as such, one highlight of the T-MATS software package is the turbomachinery block set. This set of Simulink blocks gives a developer the tools required to create virtually any steady state or dynamic turbomachinery simulation, e.g., a gas turbine simulation. In systems where the control or other related systems are modeled in MATLAB/Simulink, the T-MATS developer has the ability to create the complete system in a single tool.

T-MATS is written in MATLAB/Simulink (The Mathworks, Inc.), is open source, and is intended for use by industry, government, and academia. All T-MATS equations were developed from public sources and all default maps and constants provided in the T-MATS software package are nonproprietary and available to the public. The software is released under the Apache V2.0 license agreement.

Getting Started
Stable releases of T-MATS are located under the releases tab. It is encouraged that a user download the most up to date version using the appropriate software download button (green button). Installation instructions are detailed in the user's manual which is included within the package.

T-MATS encourages open collaboration and if a user wishes to become a developer the software may be forked at any time via the main page link.

t-mats's People

Contributors

chapman178 avatar cheesie67 avatar georgelthomas avatar grc-rhc-sim avatar jasonwhit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

t-mats's Issues

Create Emperical conversion blocks

Create a Enthalpy to Temperature and Temperature to Enthalpy blocks that utilize the current c code t2hc.c and h2tc.c. These script utilize the empirical c models

Along with these two blocks, each thermodyanmic conversion script should be looked at with the possibility of making a stand alone block. This includes, but is not limited to pt2sc and sp2tc.

Temp2Enth_TMATS is already a part of the ambient block, however it should be created as an individual block for general use.

Update map scalars to have similar format

Currently scalars are for multiplying with a map value or a performance value to transform it to the other one. Mask definitions do not specify what the scalar is being used for.

Update all scalars to do the same thing. In this case transform from map value to Performance value
ie.
Nc = NcMap * C_Nc
Wc = WcMap * C_Wc
(PR - 1) = C_PR * (PRMap - 1)
Eff = C_Eff * EffMap

define constants

change constants.h to use macros in defining constants for general use.

This will allow the .h file to be called from every file and will get rid of the issue with double defining variables.

Update PcalcStat to use the new header file.

Cantera Help files

Add help files for each cantera TMATS block, as well as the SFC block.

Transient Conduction blocks

Add blocks to calculate 0-D and 1-D transient conduction problem.
0-D should use the lumped capacitance method
1-D should use the finite difference method (explicit) and there should be the capability to have at least 2 material types.

A new library called "Heat Transfer" should be created to contain the new blocks.

StaticCalc NaN values with Ath

Occasionally the Static Calc block will produce NaN values for Ts and Ps when calculating with Ath. If the block is changed to MN it seems to work.

Investigate why this is happening and add an error message to warn a user this has happened. The input that produced the NaN values was:
Input:
W = 6.166, ht = 112.3, Tt = 469.9, Pt = 5.651, and FAR = 0
Ath = 941.1
The remainder of inputs can be set to default.

General Thermo Block using Cantera

Create Thermo conversion blocks that may be used in Simulink. These blocks should call the T-MATS Cantera functions and they allow a user to create Cantera enabled algorithms using Simulink.

Add error term to mixer

Mixer should have a dependent term.

Look into which characteristic should contribute. Pressure is a possibility or perhaps flow error btwn calc and sum of inputs, based on pressure.

Validate with test case, TBD.

Cantera alternate fuel table generator

Currently T-MATS w/o cantera uses certain gas parameter (ht, S, etc.) look up tables that are determined empirically based on the assumption of certain gases.

Create a cantera based tool that will generate these tables for given gas combinations.

Create Normalized Error Generation block

Create a simple block to create a normalized error quickly

NErr = (Input - Const)/Input

This will allow a user to more quickly create Variables to drive the system to a certain point.

For example to drive a system to a certain shaft speed
Independent: fuel flow
Dependent: normalized shaft speed error - user would input the desired shaft speed as a Const

T-MATS cantera cleanup

Clean up T-MATS cantera modules.

  • extra variables, especially globals should be removed.
  • variable naming conventions should be updated to reflect T-MATS.
  • Additional comments should be added, including units for each input and descriptions of major operations.
  • JT9D example should be cleaned up
    -->remove all warnings while running
    -->clean up naming conventions and labels

Add a pause to the solvers

Add a solver pause input to the solver. This input should stop the JC and NR from acting as well as reset all timers (JC counter and JC reset counter).

Cv in nozzle, update to coefficient of velocity

Cv is Coefficient of Velocity, which takes into account nozzle thrust loss due to vectoring. It is not a gas property and should be moved from the gas properties tab of the Simulink block and placed into the general tab.

FAR check

Add check for FAR > FAR,stoich that will warn user when enthalpy table is invalid.

Nozzle Matlab crash

When hs > ht the nozzle module will crash the simulation. Add code to prevent Ts > Tt, hs > ht, Ps > Pt when performing the iterations.

This may be done in the PcalcStat_TMATS.c code which would carry over to other modules with iterations.

StaticCalc Block supersonic update

Update the StaticCalc block to allow for super sonic values with a known Area.

Essentially the table lookup has two valid answers, one that is subsonic and one that is supersonic. By default the internal algorithm begins searching for a solution at MN = 0.4, which guarantees a subsonic solution. A new initial condition should be added with a supersonic starting point for the search algorithm, which will force the algorithm to find a supersonic solution. Selection of starting point will be selected in the mask.

Ambient block super sonic update

The current equations located in the ambient block are not valid for super sonic applications as gamma begins to change. Update to iterative method of determining parameters.

Bus Object Autogen

Current default bus object names being used in T-MATS turbomachinery blocks so not work with the MATLAB bus object autogen feature. This is because they have spaces and odd characters, such as ; or ]. Remove all odd characters from bus object names.

Generally this will simplify the object names, there will be no units or long descriptive names. Details about the outputs will be found in the block help menu and understanding about where the output is coming from will need to be set by the bus object higher in the bus hierarchy.

Linearization block

Create a linearization block to determine the ABCD matrices for the following equations:

(xdot - xdot_0) = A_(x - x0) + B_(u - u0)
(y - y0) = C_(x - x0) + D_(u - u0)

where:
x - system state
u - system input
y - system output

Update Jacobian Calculator to allow multiple perturbation directions and magnitudes

Currently the Jacobian Calculator has handles to perturb the system independents only once. Add in handles to allow the calculator to perturb as many times as a user would like, then average the non-zero entries together. This is a similar task to the Linearization block update 67c7de2

This can be done by updating the delay functions to allow for more values (number of independents * number of perturbation sets) , sorting the values into perturbation sets and averaging the sets within the MATLAB function block, and then performing the jacobian calculation once the final average perturbations results have been gathered, as done in the linearization block.

Data Output sampling time

Data Output block isn't working when the block is nested in a model call or a while loop. An error mentioning sampling time of the code call stops operation.

Code Gen

Currently there are issues generating code with the Simulink Coder.
Make updates necessary to make Coding with T-MATS as seamless as possible. (Includes running rapid acceleration mode.

Note: there are a few posts on the user's forum about this.

v2014b install

Updates in MATLAB version 2014b have caused T-MATS to unsuccessfully load the T-MATS blocks into the Simulink library browser.

Make updates to correct this issue.

Add gear box

Add gear box based on gear ratio to convert speed and torque across the box.

Static Pressure and Temperature

Add block to compute the static pressure and temperature from a typical gas flow vector. This block requires either the throat area or MN to be assumed. and will use equations similar to the Nozzle and Mixer.

CD nozzle update

Look into issues with thrust correction. Determine required updates and implement schemes dealing with Cfg, Cv, and CD.

robust IDes. with module layout

Ides on/off wont work if the user is not in the subsystem with the blocks. Make the tool work no matter where the user is in the Simulink hierarchy.

Make IDes consistent

Cantera version and baseline version use the IDes differently. This needs to be corrected.

NPSS Turbine block

Create a Turbine block which does not require additional updates to be used with NPSS maps and data. Specifically re-define Wc to be WcIn only (in default block it Wc = WcIn + Wcbleed1) and remove standard temperature term from the corrected shaft speed (Nc).

As documented in:
Chapman, J.W., Lavelle, T.M., Litt, J.S., Guo, T-H., โ€œA Process for the Creation of T-MATS Propulsion System Models from NPSS Data,โ€ 2014 AIAA Joint Propulsion Conference, Cleveland, OH, Jul 28-30, 2014.

TLC option removal

A user was attempting to build code with T-MATS and was having issues with the ssSetOptions being set. (Use of Code building was not tested for the current version of T-MATS)

Determine what effect removing each of the ssSetOption flags has on current T-MATS operation.

If there is no discernible effect, remove them from each block. They appear to only be useful when using Target Language Compiler (TLC) from real-time workshop. Currently, T-MATS has not been designed for use with real-time workshop or any sort of code generation.

If integration with real-time workshop is added in future versions the ssSetOptions will be addressed at that time.

Code Gen in model Calls, in rapid accel mode

There is an issue when T-MATS blocks that use the DataOutput Block are used in a model Call, when building in rapid accel mode. Investigate why this happens and fix if possible.

Review making solver into atomic subsystem

Users have been having issues with faults that occur with the solver and have been attributed to the MATLAB builder breaking up the solver block when building the model.

Re-create the mentioned issue.

Possible solutions: Making the solver into an atomic subsystem, which will force the total solver to run at the same time every time. This may require additional samples for each Jacobian perturbation due to uncertainty in the operational placement of the solver block.

Memory leak

When running the dynamic simulation example for 10x the current simulation time, it was noticed that small amounts of memory usage was being added by MATLAB after some runs. This memory usage would not go away run to run and appears to be a memory leak. This leak was also noticed in the Steady state example, but not in the NR solver example.

Find the cause of the memory leak and eliminate it.

Update JT9D for compatibility of Wc

Update JT9D simulation to use the Turbine NPSS block. This will correct how the flow errors are calculated.

The LPT and HPT Nc scalars must also be updated to remove the Tstandard component, per how the Turbine_NPSS block is created.

R-line map translator

In certain situations maps used by T-MATS may be taken from NPSS.

Create a tool that will convert an NPSS formatted R-line map to a T-MATS formatted map. This tool will reduce simulation development time as a user will not have to do this manually.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.