Can't use "GetProp" to get the "totalFlow" based on "mass"

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

Can't use "GetProp" to get the "totalFlow" based on "mass"

Post by bcbooo »

There is a "CAPEOPENMixerSplitterExamples.1.0.1" writed by AmsterCHEM, included "VB6 Source", "CPP Source", "CPP Source Documentation", "VB Binaries" and "CPP Binaries". You could get the "CPP Source" from CO-LAN or from the attachments below.

Recently I'm researching on the "CPP Source" example, but I encounter some questions. My simulation environment is Aspen Plus 2006.5, and I'm succeed to add the "CPP Mixer Splitter Example" into Aspen Plus User Interface, I used water as the component, and it runs very good. Then I edited it and changed the source code "material.GetOverallProperty(L"totalFlow",L"mole",value,error)" into "material.GetOverallProperty(L"totalFlow",L"mass",value,error)", the result of totalFlow was 0! I found that Aspen Plus 2006.5 support "Thermodynamics and Physical Properties Interface Specification 1.0", so I tried changed "mat->GetProp(CBSTR(L"totalFlow"),CBSTR(L"overall"),compIds,NULL,CBSTR(L"mole"),&v)" into ""mat->GetProp(CBSTR(L"totalFlow"),CBSTR(L"overall"),compIds,NULL,CBSTR(L"mass"),&v)"" in the file "MaterialObject10Wrapper.h",but the totalFlow based on mass is zero too, I don't know why.
Attachments
CPP Mixer Splitter example.zip
(78.95 KiB) Downloaded 1659 times
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Can't use "GetProp" to get the "totalFlow" based on "mas

Post by jasper »

This appears to be a problem with AspenPlus. I would stick to mole based properties, and do the mass/mole conversion yourself. You can obtain the compound molecular weights by using GetComponentConstant, and passing MolecularWeight as compound identifier. Calculate the mixture molar weight and apply the conversion (note the 1e-3 kg/g to go from g/mol to kg/mol).
bcbooo
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: Can't use "GetProp" to get the "totalFlow" based on "mas

Post by bcbooo »

jasper wrote:This appears to be a problem with AspenPlus. I would stick to mole based properties, and do the mass/mole conversion yourself. You can obtain the compound molecular weights by using GetComponentConstant, and passing MolecularWeight as compound identifier. Calculate the mixture molar weight and apply the conversion (note the 1e-3 kg/g to go from g/mol to kg/mol).
Thank you jasper! I tried it under Aspen Plus V7.2 again, it runs very good. Maybe there is something unperfect with Aspen Plus 2006.5 version.
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Can't use "GetProp" to get the "totalFlow" based on "mas

Post by jasper »

Good to hear that it has been fixed.
User avatar
colancto
Administrateur
Posts: 92
Joined: 23 October 2012, 11:46
Contact:

Re: Can't use "GetProp" to get the "totalFlow" based on "mas

Post by colancto »

As with most pieces of software I recommend using the latest version available after checking that no regression has taken place. This is true for the CAPE-OPEN interfaces as well with all other pieces making up a code.
Post Reply

Return to “Thermodynamic components”