Unicode debug, new folder
added a cpp file to use the wrapper
Some testing..
Revert "Some testing.."

This reverts commit 368df8a142cc335d59294aee095138904a564f3f.
Revert "Revert "Some testing..""

This reverts commit b4a03bbc05985a368cd8faf841b0663a7de463c3.
Trying to learn things..
Some testing.. (reverted from commit 368df8a142cc335d59294aee095138904a564f3f)
Modelica: Included setBubbleState and setDewState...
Wrapper: Outcommented partial derivative and transport functions for speed testing..
Some more playing araound
New test routine
started to add some c functions
Modelica path now used to load dll..
(good in windows if old dll's are in environment variables :-)
I have included analytical derivatives of density wrt enthalpy and pressure. 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...
Made setSat function for saturation properties setSat_pX and setSat_TX, 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.
I added surface tension computation for setSat_TX
For setSat_pX I added an additional temperature input, if zero then sigma is zero, otherwise computed..
I will put this work on the self now. There are four ways with respect 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
There are four ways to compute partial derivatives determined by "partialDersInputChoice", 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..
Some models that test partial derivatives, and compare state transformations against d,u, states..
ready to roll back
Merge branch 'refs/heads/debug'