Thermo export property packages

Topics which are not specific to any given application

Moderator: jasper

Re: Thermo export property packages

Postby tauha35 » 30 July 2021, 09:17

The liquid-vapor and liquid-liquid phase equilibria (no solids in my application at the moment) can be calculated from Antoine equation and activity coefficient model such as NRTL or e-NRTL respectively. The Redlich-Kister equation is only to utilize excess property concept for mixture properties of interest relevant to heat exchanger design.
tauha35
 
Posts: 8
Joined: 16 July 2021, 00:53

Re: Thermo export property packages

Postby jasper » 30 July 2021, 09:27

I do not think many softwares deliver e-NRTL. If this is a requirement of your system, you choices rapidly diminish. Indeed AspenProperties comes to mind.
User avatar
jasper
 
Posts: 1056
Joined: 24 October 2012, 15:33
Location: Spain

Re: Thermo export property packages

Postby tauha35 » 01 August 2021, 03:34

e-NRTL although a better representation is not a requirement. actually, NRTL should be sufficient for modeling purposes for the type of analysis i am after. It will be great if the simple or temperature corrected Redlich-Kister mixing model can be incorporated as a selectable option for main thermophysical properties (rho, eta, cp, k, sigma) in "Configure TEA" as part of a planned update.
tauha35
 
Posts: 8
Joined: 16 July 2021, 00:53

Re: Thermo export property packages

Postby jasper » 03 August 2021, 11:06

I am not sure what the best setup would be for this as the number of parameters that is required seems to be rather variable. In addition there should be some sort of GUI to enter these parameters presumably.

I can provide example code for a property calculation routine, but via this route you cannot easily add the pure component values in CAPE-OPEN v1.1. Some back ground, CAPE-OPEN 1.0 had a 'pure' vs 'mixture' calculation type, which was largely unused. Additional confusion arose because quite often the pure calculations would be ideal, e.g. some sort of correlation, whereas the mixture calculations are not, and with the mixture calculations being a different model than pure calculations, pure calculations gave a different result that mixture calculations at pure composition, e.g. X = [ 0, 1, 0, 0, ...]. But in this context that might be exactly what you want, provide a mixture model for which you can issue a pure calculation that will get just correlated values for the pure compound.

However, I presume your compound list is rather limited and you could also simply provide the pure compound data internally to your calculation routine.

Would you like me to provide example code (COBIA based) for a Property Routine that does a mixture calculation for a particular property?
User avatar
jasper
 
Posts: 1056
Joined: 24 October 2012, 15:33
Location: Spain

Re: Thermo export property packages

Postby tauha35 » 07 August 2021, 05:10

The redlich-kister model for liquid thermophysical properties can be implemented similar to enthalpy ideal+excess model with ideal coming for molar or mass mixing rule. The empricial parameters can be supplied implemented in a way similar to NRTL or other models requiring parameters for computing mixture properties under the interaction parameters tab. A maximum of six or seven constants can be defined with N/A indicating unused constants and the dimension indicating the relevant excess property. This will avoid need of a separate GUI for specifying the inputs of the Redlich-Kister model. The model can be expanded for multi-component solutions utilizing the interaction parameter concept (table 1 in https://link.springer.com/article/10.1007/BF02648364).

Yes, the mixture model would be the reference for both pure and mixture compositions since the excess model parameters will be obtained utilizing mixture data while specifying a suitable pure component model in the regression model.

Regarding COBIA code, i assume it would be in either VB or C++ both of which i am now not familiar with. however, Would this subroutine be accepted in the external subroutine tab of "Configure TEA"?
tauha35
 
Posts: 8
Joined: 16 July 2021, 00:53

Re: Thermo export property packages

Postby jasper » 28 October 2021, 07:52

As to follow up in our conversation at the AGM yesterday, here are some pointers towards creation of a property calculation routine. Property calculation routines are a type of CAPE-OPEN software components that can, in principle, be used by any PME to allow a custom property calculation routine, without the need to implement an entire property package. A property package implementation requires more than just property calculations. A property package should provide the compound definitions, the phase definitions, the phase equilibrium (flash) calculator, etc.

Although a property calculation routine is therefore much easier to write, currently there is not much support for property calculation routines as stand-alone CAPE-OPEN objects. Nevertheless, COCO's TEA does support such routines.

To write a property calculation routine, you need to write a CAPE-OPEN object that is a Primary PMC object, and is registered with the following category ID: "CAPE-OPEN 1.1 Physical Property Calculator" (CF51E385-0110-4ed8-ACB7-B50CFDE6908E); this is described in the CAPE-OPEN 1.1 thermodynamic standard specification document.

Such a software component needs to implement the following interfaces:

  • ICapeIdentification - required by all CAPE-OPEN components and provides the name of the component
  • ICapeUtilities - required by all Primary PMC CAPE-OPEN objects
  • ICapeThermoPropertyRoutine - this actually implements the property routine functionality
  • IcapeThermoMaterialContext - this allows the object to receive the material object on which the calculations are performed

In addition, the component may implement the following CAPE-OPEN interfaces:

  • ICapePerist (CAPE-OPEN 1.2, or for CAPE-OPEN 1.1, any of the persistence interface): only needed if the component can be configured and the configuration must be saved
  • ICapeThermoPhases: only needed in case the property calculation applies to specific phases only. ICapeThermoPhases identifies these phases
  • ICapeThermoCompounds: only needed in case the property calculation applies only to specific compounds. ICapeThermoCompounds identifies these compounds.

For more information, see the CAPE-OPEN 1.1 specification:

https://www.colan.org/specifications/thermodynamics-and-physical-properties-interface-specification-v1-1/
https://www.colan.org/wp-content/uploads/2015/05/CO_Thermo_1.1_Specification_311.pdf

particularly section 5.5: Physical Property Calculator component responsibilities

To implement such an object, one can either make a COM component (an explanation of how to do that is a bit out of the scope of this post, let me know if you need more information), or you can use COBIA. The latter route makes things a bit simpler, but requires some C++ programming. If you have access to Visual Studio (2017, 2019, the free community edition will do), I would suggest checking out the COBIA CAPE-OPEN Wizard visual studio add-in:

https://marketplace.visualstudio.com/items?itemName=AmsterCHEM.COBIAWizard

After installing this, you will find that the help ("Help on COBIA Wizard" from the Visual Studio help menu) will provide a step-by-step walk through on how to create a CAPE-OPEN Unit Operation. The work flow for creating a Property Calculator is not much different, except you will have to implement a different set of CAPE-OPEN interfaces, as outlined above.

In COCO/TEA you can use such Property Calculation routine, by editing the TEA package configuration. After registration your routine should show up on the External Routines tab, if you click Add (note that TEA can also use any CAPE-OPEN 1.1 compliant property package as external calculation routine, as a property package implements a superset of a Property Routine's functionality):

extrouitine1.png
extrouitine1.png (21.4 KiB) Viewed 9493 times


Then, after adding the routine, you can go to the Properties tab, and change the routine that is used for an individual property:

extrouitine2.png
extrouitine2.png (20.71 KiB) Viewed 9493 times


Please be aware that your property calculation may be requested for a list of compounds that differs (may be a sub set, may be in different order) from the compounds in the package. You should get the list of compounds from the material object that was set through SetMaterial (the material on which the calculations are done) prior to doing the calculations. You can assume that the list of compounds on the Material Object will not have changed in the next calculation, unless SetMaterial was called again (perhaps with a different material object, or perhaps with a reconfigured material object).

Hope that helps. I am available for questions.
User avatar
jasper
 
Posts: 1056
Joined: 24 October 2012, 15:33
Location: Spain

Re: Thermo export property packages

Postby colancto » 14 November 2021, 17:22

You may want to make contact with the team at Technische Universität Berlin that develops MOSAICmodelling. In a not so recent PhD thesis, the capabilility of MOSAICmodelling to automatically generate derivatives was thought (see section 7) as a possible way to generate CAPE-OPEN Property Packages starting from a equation of state (Z as a function of P, T,...) and deriving the properties of interest in process simulation from there. Dr Erik ESCHE should be contacted on that, to figure out if this idea has been put in action.
MOSAICmodelling has been used to automatically create CAPE-OPEN Unit Operations from the description through equations of the calculation method of the Unit Operation.
User avatar
colancto
Administrateur
 
Posts: 92
Joined: 23 October 2012, 11:46

Previous

Return to Process modelling and simulation

Who is online

Users browsing this forum: No registered users and 1 guest

cron