cequel: chemical equilibrium in excel

14
Cequel™: C hemical Equ ilibrium in Excel An Excel Add-In that provides all the functionality of NASA’s CEA code as an Excel spreadsheet function Jonathan French www.praqsys.com

Upload: jonathan-french

Post on 15-Jul-2015

152 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Cequel:  Chemical Equilibrium in Excel

Cequel™:Chemical Equilibrium in Excel

An Excel Add-In that provides all the functionality of NASA’s CEA code as

an Excel spreadsheet function

Jonathan French www.praqsys.com

Page 2: Cequel:  Chemical Equilibrium in Excel

“What If”

• Chemical equilibrium codes let us seek answers to a variety of question– What combination of reactants will produce the best Isp?

– What is the flame temperature? Will the reaction melt my device?

– How can I weigh engine performance vs the concentrations of pollutants generated?

• To get a proper grasp of the answer or the design space, multiple analyses need to be performed

• Having a quick and inexpensive means to perform analyses frees and encourages the engineer to consider ideas “outside the box”

Page 3: Cequel:  Chemical Equilibrium in Excel

Existing Chemical Equilibrium Tools

• Text based tools (CEA, CET, PEP)– Requires text based input, user has to extract results from output text files– Very user intensive

• Graphical interface tools (TEP, GUIPEP, RPA, PROPEP)– Allows for ease of use to set up problem– Resulting output based on what the developer anticipates is desired, or the

same text file generated by CEA

• Excel chemical equilibrium functions– The user can incorporate the analysis into their own model– Usually provides a specific set of inputs and outputs, tied to specific cells– Not user friendly and not commercially supported

• Text based and GUI results are often copied and pasted into Excel spreadsheets to document the results, or as part of a larger analysis– If the analysis changes, then the subsequent chemical equilibrium analyses

must be rerun, and the results copied and pasted again– The graphical interface approach makes it easier to modify the inputs– Excel functions allow for automatic updating of the results when input changes

Page 4: Cequel:  Chemical Equilibrium in Excel

Power vs Ease of Use

• The power of an Excel function– Uses cell references– Can be copied for parametric analyses– May be used with GoalSeek– Allows the user to determine how to solve the

problem– Established models may be modified and reused

• The ease of use of a GUI– Define the problem and select reactants

using menus– Choose the output parameters– VIew results of an analysis– Reduces potential for human error

These two approaches are combined in Cequel

Page 5: Cequel:  Chemical Equilibrium in Excel

Multiple Interfaces

• Cequel provides two ways to perform analyses– Cequel’s GUI (called a “Wizard”) helps the user identify the

desired inputs, and guides the insertion of the function into the spreadsheet

– The function CEQUEL() may be entered into cells to perform calculations• It may use existing cell information as part of it’s input• Values that it generates may be referenced by other cells

– Cequel provides a ribbon interface to access the GUI, as well as other menu items that make using Cequel easier

Page 6: Cequel:  Chemical Equilibrium in Excel

The Cequel “Equilibrium Wizard”

• Select the problem type, the reactants and their concentrations on a mass or molar basis

• Problem types:– Thermodynamic Point

Calculations:• Pressure-Temperature (TP)• Pressure-Enthalpy (HP)• Pressure-Entropy (SP)• Volume-Temperature (TV)• Volume-Internal Energy (UV)• Volume-Entropy (SV)

– Rocket, Shock and Detonation Analyses

Buttons provide option to use cell references that are laterused when inserting the function in the spreadsheet

Page 7: Cequel:  Chemical Equilibrium in Excel

The Cequel “Equilibrium Wizard”

• Reactant Database– CEA, PEP, TEP reactant

libraries merged together– Thermodynamic library’s

species are included as reactants (setting temperature sets the heat of formation)

– User defined reactants can be incorporated as additional library files, or as part of a spreadsheet for portability

Page 8: Cequel:  Chemical Equilibrium in Excel

The Cequel “Equilibrium Wizard”

• Point Type Problem– Specify two

thermodynamic values– Shows calculated results for

each output parameter– “Checking” a term will

indicate it is to be returned when inserting the function in the spreadsheet

Page 9: Cequel:  Chemical Equilibrium in Excel

The Cequel “Equilibrium Wizard”

• Rocket, Shock and Detonation Problems– Specify specific inputs for each

problem type– Multiple exit area or pressure

ratios can be specified– Select terms to be returned by

the function in the spreadsheet

– Holding down the control key allows several different items in a list to be chosen

Page 10: Cequel:  Chemical Equilibrium in Excel

The Cequel Function

• There are many possible inputs for a single function call – the wizard helps set up an instance that can be modified and copied

• Input order:– Problem type– Problem specific inputs– Reactants– Special options (LJP compressibility model

or altitude for the Isp, for example)– Output parameters (keywords)– Output species fractions (mass or molar

based)

• In this example, the each function just returns the flame temperature. Cell references are used to vary the tri-propellant mixture ratios to generate a surface plot

Single cell function call toreturn flame temperature

Page 11: Cequel:  Chemical Equilibrium in Excel

The Cequel Function

• Input can be specified by

– Comma delimited parameters

– A single range of cells containing input parameters (as in example on the right)

– A combination of parameters and ranges

• Excel functions are limited to 29 comma delimited parameters, so specifying a cell range that contains several inputs can help keep you under 29 parameters

• Cell references let the user specify the problem definition or desired outputs in cells that can be easily modified by just changing the cell value, rather than having to edit the function

• Array functions return multiple values over several cells with just one function call

• Example: Rocket problem

– Input is specified by a single range in the blue box to embed the entire input in the spreadsheet instead of being hidden in the function.

– All of the rocket problem outputs are calculated for multiple area ratios with a single array function

• As for output, Cequel can return one value, several values, or every value that CEA would yield

Para

met

er O

utp

ut

Key

wo

rds

Spec

ies

Problem DefinitionChamber PressureArea RatiosReactants and Mass FractionsSpecial Options

Single Array Function

Page 12: Cequel:  Chemical Equilibrium in Excel

Platforms

• Microsoft Windows XP, 7 and 8 with Excel 2010/2013

• Apple Macintosh (Yosemite) with Excel 2010

• In Development:

– MatLab (both as a function and an interactive GUI)

– Mobile and Web (only an interactive GUI)

Page 13: Cequel:  Chemical Equilibrium in Excel

Fully Functional Trial Version

• While Cequel is not for everyone...– Heavy CEA users quickly find it to be indispensable

– Ease of use makes it accessible for other engineers, as it reduces the learning curve for using CEA

• Praqsys provides a 30 day fully-functional trial version that engineers can use to evaluate the program’s capabilities

• It helps to get permission from IT departments to allow engineers to evaluate Cequel, although it can be installed without administrator privileges

Page 14: Cequel:  Chemical Equilibrium in Excel

Brief History

• In the late 1990’s, NASA JSC contracted the development of an Excel function that executes a chemical equilibrium code, and given two reactants returns specific values (Isp, C*, ratio of specific heats)

• The final project was an unholy mix of Excel Visual Basic for Applications (VBA) and Fortran

• Upon completion of the JSC work, an internal effort was made to expand the capabilities. The function was changed to include all possible I/O, and a graphical “Wizard” with reactant databases was developed to make it easier to place the function in the spreadsheet.

• The resulting product, “Cequel”, was marketed by Software and Engineering Associates, Inc (SEA) from about 2000-2013

• Microsoft modified Excel’s menu for Excel 2010, breaking Cequel in the process. SEA could no longer support Cequel, so they sold it to the original developer, Jonathan French

• Cequel now runs using Microsoft Excel 2010 and 2013 under Windows XP/7/8, and on the Apple Macintosh with Excel 2011