[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
[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
[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 - Is the "ICapeThermoMaterialContext" useful?

Is the "ICapeThermoMaterialContext" useful?

Is the "ICapeThermoMaterialContext" useful?

Postby bcbooo » 27 March 2014, 06:40

The "CO_Thermo_1.1_Specification_311.pdf" says that :

"ICapeThermoMaterialContext should be implemented by all Thermodynamic and Physical Properties components that need an ICapeThermoMaterial interface in order to set and get a Material's property values. "

ICapeThermoMaterialContext has two functions "SetMaterial" & "UnsetMaterial", and the "SetMaterial" is used for:

"The SetMaterial method allows a Thermodynamic and Physical Properties component, such as a Property Package, to be given the ICapeThermoMaterial interface of a Material Object. This interface gives the component access to the descript ion of the Material for which Property Calculations or Equilibrium Calculat ions are required. The component can access property values directly using this interface. A client can also use the ICapeThermoMaterial interface to query a Material Object for its ICapeThermoCompounds and ICapeThermoPhases interfaces, which provide access to Compound and Phase information, respectively. "

***------------***-------------***

But the "ICapeThermoMaterialContext" makes me puzzled, I compose the code like the following:

////code start
class ATL_NO_VTABLE CPropertyPackage :
public CAPEOPENBaseObject,
public CComCoClass<CPropertyPackage, &CLSID_PropertyPackage>,
public IDispatchImpl<ICapeThermoCompounds, &__uuidof(ICapeThermoCompounds), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoEquilibriumRoutine, &__uuidof(ICapeThermoEquilibriumRoutine), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoMaterialContext, &__uuidof(ICapeThermoMaterialContext), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoPhases, &__uuidof(ICapeThermoPhases), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoPropertyRoutine, &__uuidof(ICapeThermoPropertyRoutine), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoUniversalConstant, &__uuidof(ICapeThermoUniversalConstant), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoMaterial, &__uuidof(ICapeThermoMaterial), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeUtilities, &__uuidof(ICapeUtilities), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IPersistStream
////code end

Here I combine the "ICapeThermoMaterial" interface with all other interfaces. The "ICapeThermoMaterial" of a Material Object will be created when the "CPropertyPackage" is initialized.

So it's meaningless to use "SetMaterial" function to set the "ICapeThermoMaterial" interface, my code has create the "ICapeThermoMaterial" interface automaticly.

Is there something wrong with my thought, or should not I combine "ICapeThermoMaterial" with other interfaces?
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: Is the "ICapeThermoMaterialContext" useful?

Postby jasper » 27 March 2014, 09:02

Why would you implement a property package and a material object on one component? Typically the property package is implemented by the component that delivers the thermodynamic calculations and the material object is implemented by the component that request the thermodynamic property calculations.

The calculation conditions are set on the material object; the material object is set as the context material of the property package; the property package is requested to - say - calculate a property; the property package retrieves the calculation conditions (e.g T, P, X) from the material object; the property package performs the calculation; the property package stores the result on the material object; the property package returns control to the caller; the caller gets the results of the material object.

In which scenarario would you want a component to implement both the material object and the property package that the material object talks to? This scenario would imply that a component is asking itself to perform thermodynamic property calculations (fair enough, but why do so via CAPE-OPEN?)
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Is the "ICapeThermoMaterialContext" useful?

Postby jasper » 27 March 2014, 10:01

If your intent is to create a material object to use in combination with unit operations, then it makes sense for the thermodynamics to be implemented by the material object itself if no external property package is used. In this case "Material Object" is probably a better name for the object than "Property Package", and indeed in this case no Material Context is needed.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Is the "ICapeThermoMaterialContext" useful?

Postby bcbooo » 27 March 2014, 12:12

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

Re: Is the "ICapeThermoMaterialContext" useful?

Postby jasper » 27 March 2014, 12:28

Yes, a 1.1 material object implements all the interfaces that a 1.1 property package does. Except the material context.

What is in 1.0 GetProp, translates in 1.1 to GetSinglePhaseProp, GetTwoPhaseProp and GetOverallProp; notice that there is no Pure or Mixture anymore, all of these assume Mixture; support for the pure properties has been replaced by GetTemperatureDependentProperty / GetPressureDependentProperty, which does not require storage on the MO. Also there is a shortcut for lnFugacityCoefficient calculations that does not require the properties to be stored on the MO.

What was CalcProp is therefore now CalcSinglePhaseProp, CalcTwoPhaseProp (plus GetTemperatureDependentProperty / GetPressureDependentProperty / CalcAndGetLnFugacityCoefficients); there is no direct support for calculation of overall properties in 1.1; you will have to loop over the phases and add it up.

So the strategy is the same for mixture properties:

Calculate a single phase property:
1.0: set T,P,X on the MO for the phase, CalcProp for the phase, set result on the MO
1.1: set T,P,X on the MO for the phase (SetSinglePhaseProp), CalcSinglePhaseProp, set the result on the MO

Similar for a two-phase property

Not similar for T- and P-dependent properties: that is just one call, no storage on the MO

No support for overall property calculations in 1.1; in 1.1 the overall properties represent in- and output for flash calculations only

Do check the comments in the specification regarding CalcEquilibrium; this works in conjuction with Set/GetPresentPhases (both upon input and output)
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Is the "ICapeThermoMaterialContext" useful?

Postby jasper » 27 March 2014, 12:29

The CalcSinglePhaseProp / CalcTwoPhaseProp functions live on ICapeThermoPropertyRoutine
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Is the "ICapeThermoMaterialContext" useful?

Postby bcbooo » 27 March 2014, 13:15

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

Re: Is the "ICapeThermoMaterialContext" useful?

Postby jasper » 27 March 2014, 13:25

User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Is the "ICapeThermoMaterialContext" useful?

Postby bcbooo » 28 March 2014, 00:44

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

Re: Is the "ICapeThermoMaterialContext" useful?

Postby bcbooo » 28 March 2014, 01:08

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

Next

Return to Thermodynamic components

Who is online

Users browsing this forum: No registered users and 4 guests

cron