Built-in Thermodynamic (and other) Tables

Built-in Thermodynamic (and other) Tables - Internal function to return thermodynamic properties - Messages

#1 Posted: 4/23/2013 6:29:07 PM
Danilo Monteiro

Danilo Monteiro

0 likes in 14 posts.

Group: User

Hello,

would be very useful to me, and maybe for most mechanical, chemical, civil (e other) engineers (and students, of course) to have internal material data inside Smath (maybe, as a plugin).
This feature, with some nonlinear system solver with units support, would turn Smath into a nice alternative to EES (http://www.fchart.com/ees/)

For small calculations, you can put some table data in a matrix, and use submatrix and cols functions to extract the vectors to be interpolated, but it may be very time consuming, and you have to be very careful about units.

A workaround is to create various snippets, one for each Property and Material (SuperHeatedSteam_Enthalpy, Air_density...) with internal function, similar to the attachment, or create a complicated snippet with all data about a material, with the bult-in functions for properties (this would be probably the closest to the plugin code, but would turn the smallest calculation into a huge worksheet)..

The problem is that some tables are more complicated to interpolate, like this: http://server.fst.uga.edu/kerr/FDST%204060/Tables%20and%20Charts/Superheated%20Steam%20Table.jpg (what if I want Enthalpy for lets say, 45kPa and 156ºC? It's just an example, anyway)..

Also, not all users may want to spend time to create so many snippets, or know which internal functions to use to achieve his goal, so a plugin like this would help a lot (and probably bring lots and lots of users :d ).

Sorry about my english, it's getting rust,

Danilo Monteiro

Example.sm (16 KiB) downloaded 171 time(s).
#2 Posted: 4/23/2013 7:20:17 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

You may have a look at the following topic.
The plugin does not work for me, but you may be more successful (the plugin seems to be x64-incompatible)
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 4/23/2013 7:44:46 PM
Danilo Monteiro

Danilo Monteiro

0 likes in 14 posts.

Group: User

Oh, that may help.
But we could not extend it (add tables for other fluids, etc.)
Anyway, if this work, will be one less snippet to create, thanks!

__________________________________________________________________

It didn't work
#4 Posted: 4/23/2013 8:23:01 PM
kilele

kilele

133 likes in 397 posts.

Group: User

I don't know what happened to xsteam at www.x-eng.com (seems offline), it had dll files, excel files and other components.
Anyway I've found this code which might be useful in the future to make a plugin.
http://www.mathworks.com/matlabcentral/fileexchange/9817
The DataExchange plugin could be used in a smath snippet to import data from the xsteam excel sheet.
#5 Posted: 4/23/2013 9:12:59 PM
Danilo Monteiro

Danilo Monteiro

0 likes in 14 posts.

Group: User

I found these sources about xsteam:

https://sourceforge.net/projects/xsteam/
http://xsteam.sourceforge.net/

But the download links are directing to the offline site
#6 Posted: 4/24/2013 9:11:21 AM
kilele

kilele

133 likes in 397 posts.

Group: User

I found XSteam in excel, odf, matlab and dll versions:
XSteam_v2.6_excel_ods_matlab_dll.zip
An there you have a couple of derivatives based on xsteam:
http://www.me.ua.edu/ExcelinME/thermo.htm
http://www.chemsof.com/spreadsheet.htm

The University of Alabama's derivative of XSteam looks sweet (see youtube video), don't know if it'd be possible grab their excel macros code to make a SMath plugin (if permission is granted of course)
#7 Posted: 4/25/2013 11:31:25 PM
Danilo Monteiro

Danilo Monteiro

0 likes in 14 posts.

Group: User

This implementation look way more complicated than table interpolation
http://www.iapws.org/relguide/IF97-Rev.pdf

Also, is only for water/steam..
#8 Posted: 4/26/2013 4:03:59 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Quote

don't know if it'd be possible grab their excel macros code to make a SMath plugin


Yes, it is possible through a VB.Net plugin.
Russia ☭ forever, Viacheslav N. Mezentsev
#9 Posted: 4/26/2013 1:10:21 PM
kilele

kilele

133 likes in 397 posts.

Group: User

Wrote

This implementation look way more complicated than table interpolation
http://www.iapws.org/relguide/IF97-Rev.pdf

Also, is only for water/steam..


Well it is different from your interpolating approach and just for water but it could be extended with other resources. It would be a nice occasion to see SMath handling units, maybe the NonlinearSolvers plugin would come in handy.
XSteam is a well regarded resource in some universities from USA, Spain and Italy (I found the ods version in a engineering department from Italy).
It is only for water yet useful in lots of energy/exergy efficiency analysis like this one in excel:
http://personales.upv.es/carguaga/CT/T4/SCE1_2012res.xls
The derivative work from the University of Alabama includes also a couple of refrigerants, which could show us the direction to consider more substances, either by using correlations or interpolating tabular data as you suggested.

Wrote

Quote

don't know if it'd be possible grab their excel macros code to make a SMath plugin


Yes, it is possible through a VB.Net plugin.


Fine, I meant the possibility of porting the actual macros into C# code.
For now I lack coding skills ^^ but this reference could be useful in the future:

"VSTO, visual studio tools for office","convert vba to vb.net"
Migrating an Excel VBA Add-in to a VB.Net XLL with Excel-Dna
#10 Posted: 4/26/2013 10:58:05 PM
Danilo Monteiro

Danilo Monteiro

0 likes in 14 posts.

Group: User

Wrote

Wrote

This implementation look way more complicated than table interpolation
http://www.iapws.org/relguide/IF97-Rev.pdf

Also, is only for water/steam..



Well it is different from your interpolating approach and just for water but it could be extended with other resources. It would be a nice occasion to see SMath handling units, maybe the NonlinearSolvers plugin would come in handy.
XSteam is a well regarded resource in some universities from USA, Spain and Italy (I found the ods version in a engineering department from Italy).
It is only for water yet useful in lots of energy/exergy efficiency analysis like this one in excel:
http://personales.upv.es/carguaga/CT/T4/SCE1_2012res.xls
The derivative work from the University of Alabama includes also a couple of refrigerants, which could show us the direction to consider more substances, either by using correlations or interpolating tabular data as you suggested.

Wrote

Quote

don't know if it'd be possible grab their excel macros code to make a SMath plugin


Yes, it is possible through a VB.Net plugin.



Fine, I meant the possibility of porting the actual macros into C# code.
For now I lack coding skills ^^ but this reference could be useful in the future:

"VSTO, visual studio tools for office","convert vba to vb.net"

Migrating an Excel VBA Add-in to a VB.Net XLL with Excel-Dna

Edit:

There was a dll version but can't find it.



I agree with you, interpolation it's just the easiest way (for me) to do. Another thing to take account of is that a lot of data tables would make this plugin use too much of disk space and system memory. Interpolation is more suitable for code snippets, I think.
Probably EES (the software I mentioned before) uses only correlations, it's a small install package and have lots and lots of features.


My coding skills are limited to some numeric calculations (mainly scilab), I can't help much in this plugin's development besides testing....
#11 Posted: 4/27/2013 6:53:29 AM
kilele

kilele

133 likes in 397 posts.

Group: User

I found XSteam dll version!
Updated download link.
#12 Posted: 4/27/2013 10:20:03 PM
kilele

kilele

133 likes in 397 posts.

Group: User

Wrote


Probably EES (the software I mentioned before) uses only correlations, it's a small install package and have lots and lots of features.



I've just read that EES supports hundreds of fluids..well we could prepare some table data and compare it with that software. I think it would be possible to make such tables by digitizing thermodynamics graphs with this software:
Engauge Digitizer
Engauge Digitizer tutorial
Then you could interpolate between values stored in each table or obtain spline functions.
#13 Posted: 5/2/2013 8:38:22 PM
kilele

kilele

133 likes in 397 posts.

Group: User

I've found these libraries for computing water properties using IAPWS-IF97 formulation :
Properties of water DLL coded in C#
Freesteam

And these are other .net libraries which might be useful:
CoolProp Property database that includes pure fluids, pseudo-pure fluids, and humid air properties.
Nature. API for computing physical properties of complex gas mixtures.
2 users liked this post
Davide Carpi 5/3/2013 11:43:00 AM, Dham 5/3/2013 1:28:00 PM
  • New Posts New Posts
  • No New Posts No New Posts