Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of Linux wrapper #1

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open

Integration of Linux wrapper #1

wants to merge 59 commits into from

Conversation

jowr
Copy link

@jowr jowr commented Oct 24, 2012

Hi Henning,
I cleaned the code and removed the compilation of Refprop itself. I guess the Linux wrapper can now be included in your release.

I did not change the Modelica part except for the PATH settings.

You are welcome to comment on the changes or to only include parts of it.

Regards
Jorrit

jowr added 30 commits September 18, 2012 12:23
…e shared library librefprop.so can be accessed from both C++ and Fortran. IMPORTANT: The wrapper classes for Modelica do not work, yet.
…ary name to uppercase. Still no success with Dymola.
…nd mixtures. However, the C++ code in the wrapper could be a little cleaner...
…POCO framework. Now complete change yet because the Poco version is approximately 2.5 times slower. added a bash script to create function listings, just for convenience during development.
… now handled externally (check the readme), cleaned the makefile.
…on, remember to have all dependencies when compiling.
…rop wrapper. It seems to work with Dymola...
…5, added links to readme and a link to coolprop to the wrapper file
…fined. Unit conversion errors were removed as well.
…he "free" routines to enable parallel use, removed the tolerances in the state check
…n windows and linux, fixed array bug in flushing routines, updated description with link to Poco on GitHub.
…lpy at constant pressure and with respect to pressure at constant enthalpy to the wrapper.

Major rewrite of the interface and the Refprop package. Should be easier to use now.
…see differences in numerical derivatives...
Included Henning's hint regarding the windows compiler console
Updated some instructions for Windows.
Removed Poco dependency and added instructions for Windows users.
added dummy bin folder to avoid compile-time issues
Included an ammonia/water example for thomas and anish
compiling from source is now default setting
Added link to releases
More description.
jowr and others added 29 commits July 25, 2013 10:46
removed outdated folder references
Included Anish's suggestions
Small fixes
This reverts commit 368df8a.
Some testing.. (reverted from commit 368df8a)
Wrapper: Outcommented partial derivative and transport functions for speed testing..
(good in windows if old dll's are in environment variables :-)
…essure. Still missing density derivative wrt mass fraction...

I have reduced the number of variables in ders[].

I also uploaded a Modelica Model that compares the analytical derivative and numerical ones...
…X, that includes dew and bubble properties. In C wrapper all sat variables are accompanied with sat in the variable name..

Made 2 choices on two-phase partial derivatives. Note that the numerical ones uses only one additional state, and that the more correct method would be to use 2 points, but increases CPU time. Also the analytical ones at constant concentration are pseudo, so they do not include the fact that liquid and vapor properties also depend on concentration. This should however be more quick.

Made a choice on calculation of transport properties.
For setSat_pX I added an additional temperature input, if zero then sigma is zero, otherwise computed..
…t to computing partial derivatives, determined by "partialDersInputChoice":

1: none

2: partial derivatives of d wrt p,h,X
In two-phase region: numerical differentiation for all derivatives
In single phase region: dddX is numerical and others are analytical

3: partial derivatives of d wrt p,h,X
In two-phase region: pseudo analytical (similar procedure as pure fluid - they give almost same result but with less CPU effort)
In single phase region: dddX is numerical and others are analytical

4: partial derivatives of d and h wrt p,T,X
In two-phase region: numerical differentiation for all derivatives
In single phase region: dddX is numerical and others are analytical

The fourth method is the only one that compares exactly with stepping forward in u,d,X (the baseline with most CPU effort) It is quicker in two-phase region compared to method 2, because T and P are equilibrium quantities..

Note that the dddX derivative is the difference in dddX1|X2=const-dddX2|X1=const
…tialDersInputChoice", an input the setState_phX and setState_pTX functions:

1: none (default)

2: partial derivatives of d wrt p,h,X
In two-phase region: numerical differentiation for all derivatives
In single phase region: dddX is numerical and others are analytical

3: partial derivatives of d wrt p,h,X
In two-phase region: pseudo analytical (similar procedure as pure fluid - they give almost same result as method 2, and with less CPU effort).
In single phase region: dddX is numerical and others are analytical

4: partial derivatives of d and h wrt p,T,X
In two-phase region: numerical differentiation for all derivatives
In single phase region: dddX is numerical and others are analytical

The second and fourth methods compare exactly with stepping forward in u,d,X (the baseline with most CPU effort, due to tedious iteration in property functions at every time step, u,d,X -> T,p,h etc.).
Method 4 is guicker in the two-phase region compared to method 2, because T and P are equilibrium quantities, and thus the most typical flash function..
Method 3 is fastest, but does not give correct dynamics and will cause mass convervation to fail.

Note that the dddX derivative is the difference in dddX1|X2=const-dddX2|X1=const

The partials have only been tested for binary mixtures..
…er than that of gas..

included a saturation state to the setState calls, so all props are essentially output..
1. partial derivative,
2. transport properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants