150 likes | 284 Views
Thermodynamic and Physical Properties interface specification 1.1. Michel PONS (TOTAL) Richard SZCZEPANSKI (Infochem Computer Services Ltd) Chouaib BENQLILOU (UPC) For Thermo SIG. Outline. Why revising the Thermo specification?
E N D
Thermodynamic and Physical Properties interface specification 1.1 Michel PONS (TOTAL) Richard SZCZEPANSKI (Infochem Computer Services Ltd) Chouaib BENQLILOU (UPC) For Thermo SIG
Outline • Why revising the Thermo specification? • Experience of implementing the new standard in the Thermo 1.1 prototypes • Changes to the 1.1 spec • Summary
Thermo specification status • Version 0.9.3 • Has been implemented commercially in Aspen Plus, HYSYS.Process, gPROMS,…. • Version 1.0 • Does not involve any design changes • Some clarifications brought up in documentation • Implemented in Aspen Plus, HYSYS.Process, gPROMS, Multiflash, …
Thermo 1.1 objectives • Enhance functionality • Phases • Any number of phases • Any types of phases (previously liquid-vapour mostly) • Properties • Constants (pure compounds) • T/P-dependent properties (pure compounds) • Single-phase mixture properties • 2-phase mixture properties • Generalise flash specifications • Enable/support efficient implementations
Thermo 1.1 objectives • Enhance design logic • Enquiry methods (eg. GetSinglePhasePropList) • Check methods (eg. CheckSinglePhasePropSpec) • Calculate methods (eg. CalcSinglePhaseProp)
Objectives of Thermo 1.1 prototyping • Check the overall design for deficiencies • Make the specification a useful working document for developers • Clarity • Explain the purpose of each method • Indicate how it is supposed to work • Detailed description of arguments • List of exceptions
Implementing the 1.1 Standard • Prototype components • CO Tester (UPC) • Property Package (Infochem) • Property Calculator (Infochem) • Strategy • VB code to implement the interfaces/methods • Calculation engine implemented as separate dll • PP and PC do not contain any compound, phase or model-specific code • Models in prototypes • RKS eos, viscosity from mixing rule • Vapour, Liquid and AqueousLiquid phases • 11 compounds • PT and PH flashes
Implementing the 1.1 Standard • The good… • Started with the Multiflash 1.0 CO Property Package • Relatively straightforward to adapt and extend an existing 1.0 PP for 1.1 • Existing code for many methods, eg. CalcProp, can be reused and greatly simplified • The difficulties • Understanding how to create and use a COM component with lots of interfaces • Implementing the CO Error interfaces • The CO Error document is largely a list of interfaces and methods and does not help with how to implement them • Obscure VB errors when type libraries changed
Implementing the 1.1 Standard • Issues raised by CO Tester development • What are the mandatory interfaces for each component? • Property Package • ICapeThermoContext • ICapeThermoCompounds • ICapeThermoPhases • ICapeThermoPropertyRoutine • ICapeThermoEquilibriumRoutine ? • ICapeThermoUniversalConstant ? • ECape … ? • This is now clarified in the textual specification.
Issues raised by CO Tester development • Interpretation of argument types • UNDEFINED: is an empty Variant (was initially treated as a character string) • CapeArrayType This is a Variant containing an array of variables of the specified type not an array of Variants containing variables of the typeEg. CapeArrayString is a Variant containing an array of strings • All identifiers are must be treated as case-insensitive • When is a phase ‘present’ ? • How are the GetPresentPhases and SetPresentPhases methods used? • CATIDs (in Windows registry) for version 1.1 Thermo components • Do we need new CATIDs? No is the answer.
Issues raised by CO Tester development • SetMaterial method (ICapeThermoContext) • How is it intended to be used? • The effects of calling this method are persistent • Do we need a way to remove a material (interface) once it has been set? • Which interfaces/methods need to have a valid MO defined before they can be used? • ICapeThermoCompounds – does not need MO • ICapeThermoPropertyRoutine/EquilibriumRoutine do need a MO
Changes to the 1.1 Spec • Added to and clarified conditions for raising exceptions • Mainly to do with whether a MO has been defined and is valid • Changed descriptions of ICapeThermoCompounds methods to remove references to MO • GetCompoundConstant, GetPDependentProperty, GetTDependentProperty • New properties • diffusionCoefficient (mixture) • idealGasEntropy (T-dependent part)
Changes to the 1.1 Spec • Clarifications • CalcEquilibrium • SetMaterial • UNDEFINED • CapeArray • Set/GetPresentPhases • Phase order for 2-phase properties • Note on properties of non-existent phases • …
Summary • No fundamental problems implementing Thermo 1.1 prototypes. • Relatively simple to implement. • Offers scope for efficient implementations. • Clarifications of specification document done. • Pending a small installation problem for prototypes, will be made available on the web site (v2.4.6)