[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
CAPE-OPEN • View topic - how to get the ICapeThermoMaterialTemplate Interface

how to get the ICapeThermoMaterialTemplate Interface

how to get the ICapeThermoMaterialTemplate Interface

Postby bcbooo » 31 May 2013, 15:20

In the CO Thermo Version 1.0, I have finished use ICapeThermoSystem's ResolvePropertyPackage() to get the ICapeThermoPackage. Then I find if I want to set the material's temperature, pressure, totalflow ,and so on, I need to get the ICapeThermoMaterialObject interface.But I can't make it, here I want to know use which function I could get the ICapeThermoMaterialTemplate interface? Could anyone show me the way to use a CO 1.0 Property Package ?

Thanks!
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: how to get the ICapeThermoMaterialTemplate Interface

Postby jasper » 31 May 2013, 20:25

If you want to use a property package, you should implement the material object.

Effectively you are writing a PME (Process Modeling Environment) that uses a PMC (Process Modeling Client) which is the Property Package. The Material Object is implemented by the PME.

To do so, create a new COM object and implement ICapeIdentification, the error common interfaces and ICapeThermoMaterialObject. Note that as you own the material object, you do not need to call SetProp on the material object to set T, P and X before a property calculation; the Property Package will call GetProp to get T, P and X, and will call SetProp to set the result. You do not need to call GetProp to get the result, as you can directly access whatever space you have stored the result in, in your SetProp implementation.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: how to get the ICapeThermoMaterialTemplate Interface

Postby bcbooo » 01 June 2013, 00:56

bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: how to get the ICapeThermoMaterialTemplate Interface

Postby jasper » 01 June 2013, 06:16

You cannot use a Property Package as a Material Object. Many functions of the Property Package take a Material Object as argument. So you pass a Material Object to the Property Package. This means that you will have to implement a Material Object.

A Material Object implements functionality to set and get property values, so it serves as a storage container. It has several tasks

- It defines which components are present in the mixture. This can be all components of the Property Package or a subset thereof (*)
- It gets passed to a Property Package for property or equilibrium calculations. It contains the calculation conditions, and the Property Package will set the results of the calculation on the Material Object (*)
- In flowsheet simulations it also represents a material stream, so it gets connected to material ports of Unit Operations.
- Therefore it serves as a means for the Unit Operation to perform property and equilibrium calculations
- The Property Package may set values in one basis (e.g. enthalpy in J/mol) and the Unit Operation may want to obtain it in another (e.g. J/kg). The Material Object has the responsibility to perform the basis conversions. For most properties this is rather straight forward using the compound molecular weights or the mixture molecular weight. However for composition derivatives you should take into account the effect of the composition change on the molecular weight as well, so the chain rule applies and conversion of, say, enthalpy.DmolFraction also requires to have the value of enthalpy.

If you are not making a flowsheet environment but if you are only interested in creating a property package to perform property and equilibrium calculations, only a subset of the functionality of a Material Object needs to be implemented. In particular, those with a (*) marked above.

I do not have a code example for a Material Object implementation at hand. It requires creation of a COM object that implements the appropriate interfaces (ICapeIdentification, error interfaces and ICapeThermoMaterialObject). You create the COM object from your own code, so it will not be created by other applications using CoCreateInstance. Hence, the COM object does not need to be registered in the Windows registry.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: how to get the ICapeThermoMaterialTemplate Interface

Postby bcbooo » 01 June 2013, 08:37

oh, thank you jasper, I have got it. Recently I tried to use Aspen Plus' physical property database,but I find the aspen plus only supply the CAPE-OPEN 1.0 property package. I find the CO 1.1 has a big difference with CO 1.0, CO 1.1 is easier for PME (Process Modeling Environment) to use.
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: how to get the ICapeThermoMaterialTemplate Interface

Postby jasper » 01 June 2013, 09:05

Yes, version 1.1 is much more pleasant in use. It also allows for more efficient implementations, in particular because checking which compounds are on the material object can be comparatively expensive with respect to property calculations (even more so for naive implementations that only use string comparisons to determine which compounds are present), and a version 1.0 PP needs to do this pretty much at every call whereas in version 1.1 you can do this at most once for each SetMaterial. So you can ask a version 1.1 PP to do multiple property or equilibrium calculations without re-obtaining the compound list.

Version 1.0 has a few other shortcomings that have been fixed in 1.1 such as poor support for multi-phase properties, multiple liquid phases, and the lack of ability to determine which flash calculations are supported.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: how to get the ICapeThermoMaterialTemplate Interface

Postby bcbooo » 27 June 2013, 03:31

bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: how to get the ICapeThermoMaterialTemplate Interface

Postby jasper » 28 June 2013, 07:15

Best to not pass any properties on to the CalcEquilibrium call. What should be done with these is not entirely clear (not all arguments that are passed to CalcProp are passed to CalcEquilibrium, such as the CalcType argument). Better to ask for the phases, loop over the phases, and calculate the required property for all phases (or ask for an overall property calculation, if supported).

Without further information it is hard to say what the reason for the failure in AspenProps 7.2 is.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: how to get the ICapeThermoMaterialTemplate Interface

Postby colancto » 01 July 2013, 11:48

I am kind of puzzled. Aspen Plus v7.2 is not that recent but not such an old version either. I would however recommend switching to a more recent version of Aspen Plus.

From the discussion I understand that a simple CalcEquilibrium request on an Aspen Properties Property Package fails. I would need the bkp file used to export the Property Package out of Aspen Plus as well as the conditions of equilibrium. Having the log file obtained with COLTT would help too understand what is going on.
User avatar
colancto
Administrateur
 
Posts: 92
Joined: 23 October 2012, 11:46

Re: how to get the ICapeThermoMaterialTemplate Interface

Postby jasper » 02 July 2013, 13:02

Agreed, more information would help.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Next

Return to Thermodynamic components

Who is online

Users browsing this forum: No registered users and 2 guests