I'm wondering if anyone here might be able to help me with adding
support for calculation of saturation curves using a Helmholtz function
combined with the Maxwell phase equilibrium condition/criterion.
This criterion is described in the IAPWS-95 document, see the following
URL. Basically, an small and efficient iterative algorithm is required,
but I have not had any immediate success with my current attempts. The
algorithm has to work without any additional correlation data; only the
pure Helmholtz a(T,rho) function can be used as input, together perhaps
with the acentric factor and critical point location.
http://www.iapws.org/relguide/IAPWS95.pdf
This work is part of my new open-source high-accuracy fluid properties
library, FPROPS, which I hope eventually will be of use to many people
on this list. It currently supports just a handful of fluids including
hydrogen, nitrogen, water, ammonia, is written in plain C, and in a way
that will hopefully permit more fluids to be added, providing data has
been published in a suitable form.
http://ascendwiki.cheme.cmu.edu/FPROPS
If anyone has any suggestions on how to write an efficient routine for
evaluation of the saturation curve in this situation, please let me
know. Any suggestions would be welcome.
Cheers
JP
--
John Pye
Dept of Engineering
Australian National University
http://pye.dyndns.org
OK I will try a proper multivariable newton solver, rather than my
current ad hoc approach. You mentioned using IAPWS-84 for your initial
guess; this isn't an option, because I need a method that works for all
Helmholtz-function-defined fluids, not just steam.
BTW I didn't see your code for this in your proph2o package -- is your
implementation something you actually have released?
Cheers
JP
As a follow-up to this thread, I note that we developed some nice new
code for solving phase equilibrium for pure substances as part of
FPROPS, you might want to have a look at it. We used a method given in a
paper by Akasaka.
http://ascendwiki.cheme.cmu.edu/FPROPS
Cheers
JP
--
Dr John Pye
Dept of Engineering
Australian National University
I don't do any work with .NET, but it shouldn't be very hard, as far as
I can tell.
Starting with the code that exposes FPROPS to Python, you could modify
the SWIG wrappings to make it accessible to C#/.NET, as described here:
http://www.swig.org/Doc1.3/CSharp.html
Alternatively, if you are able to access C functions from arbitrary
DLLs, as is possible for example in Python, then you might just be able
to create a plain DLL file and access it directly from .NET:
http://docs.python.org/library/ctypes.html
I'm quite keen (in the context of my ASCEND work) to work on adding
support in FPROPS for calculation of mixture properties... that's
something you've implemented already in DWSIM, but would you have any
interest in being able to access fast C routines for performing these
same calculations in an outside DLL?
Hope that helps
Cheers
JP