Jump to content



Featured Articles

Check out the latest featured articles.

File Library

Check out the latest downloads available in the File Library.

New Article

Product Viscosity vs. Shear

Featured File

Vertical Tank Selection

New Blog Entry

Low Flow in Pipes- posted in Ankur's blog

Parameters Of Conversion Reactor With Excel Vba?

conversion reactor vba excel vba hysys

This topic has been archived. This means that you cannot reply to this topic.
14 replies to this topic
Share this topic:
| More

#1 Bamboo

Bamboo

    Brand New Member

  • Members
  • 8 posts

Posted 11 July 2016 - 02:54 AM

hi everyone! 

i want to get the conversion parameters of a reaction in a conversion reactor with Excel VBA. the parameter named C0, C1 C2 and in the following equation. " conversion(%) = C0 + C1 * T + C2 * T^2"  

any suggestion was welcome!

thank you !



#2 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 11 July 2016 - 08:40 AM

Try the Object Explorer. Visit the Aspen Tech support site.

 

Bobby



#3 Francisco Angel

Francisco Angel

    Gold Member

  • Members
  • 88 posts

Posted 11 July 2016 - 06:06 PM

Dear bamboo:

In this simple case, you can use the linear estimation function in excel to determine the parameters you are looking for:

https://support.offi...7a-fa7abf772b6d

 

Best regards.



#4 Bamboo

Bamboo

    Brand New Member

  • Members
  • 8 posts

Posted 12 July 2016 - 01:51 AM

Try the Object Explorer. Visit the Aspen Tech support site.

 

Bobby

thank you Bobby, I am sorry, I use the aspen HYSYS software. 



#5 Bamboo

Bamboo

    Brand New Member

  • Members
  • 8 posts

Posted 12 July 2016 - 02:07 AM

Dear bamboo:

In this simple case, you can use the linear estimation function in excel to determine the parameters you are looking for:

https://support.offi...7a-fa7abf772b6d

 

Best regards.

thank you Francisco Angel, i was trying to "catch" the values in aspen hysys. your information is useful to my VBA program work. than you again!



#6 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 12 July 2016 - 08:53 AM

 

Try the Object Explorer. Visit the Aspen Tech support site.

 

Bobby

thank you Bobby, I am sorry, I use the aspen HYSYS software. 

 

The site provides support for your software. They own it.



#7 Bamboo

Bamboo

    Brand New Member

  • Members
  • 8 posts

Posted 12 July 2016 - 09:10 AM

Try the Object Explorer. Visit the Aspen Tech support site.

 

Bobby

Dear Bobby,

in hysys object, the conversioncoefficientsvalue defined as variant which was found in  the class named "ConversionReaction" and also was in class named "ConversionReactor".

i defined a variable (reactor) as ConversionReactor, and a other variant variable named parameters.

then i set the reactor = hycase.flowsheet.operator.item("CRV_100")

and the variable "parameters = reactor.ConversionCoefficientValue"

but the error occurs!

thank you for your attention!



#8 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 12 July 2016 - 09:34 AM

hycase.flowsheet.operations.item("CRV_100")

 

Syntax and spelling are everything!

 

Bobby



#9 Bamboo

Bamboo

    Brand New Member

  • Members
  • 8 posts

Posted 13 July 2016 - 06:02 AM

hycase.flowsheet.operations.item("CRV_100")

 

Syntax and spelling are everything!

 

Bobby

Dear Bobby,

the "operations" is right. and there was no "operator" in the HYSYS object.

here i defined two variables:

' --------------------------------------------------------------

 Dim React_Operator As ConversionReactor

 Dim varConCoeffValue As Variant

 Set React_Operator = hyCase.Flowsheet.Operation.Item("CRV_100")

 varConCoeffValue = React_Operator.ConversionCoefficientsValue

' -----------------------------------------------------------------------

all of this was right. and i want i get the values of "varConCoeffvalue" , How can I get it?

thank you for your reply!


Edited by Bamboo, 13 July 2016 - 06:30 AM.


#10 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 13 July 2016 - 09:07 AM

I don't have a specific answer for you. Maybe another member can give you specific information. But you should visit the Aspen Tech support site and search. There is something called HYSYS Stream Reporter among the VBA workbooks that have lots of code. Try to find a solution that addresses your need for reactor information.

 

Bobby


Edited by Bobby Strain, 13 July 2016 - 10:50 AM.


#11 Bamboo

Bamboo

    Brand New Member

  • Members
  • 8 posts

Posted 14 July 2016 - 01:55 AM

I don't have a specific answer for you. Maybe another member can give you specific information. But you should visit the Aspen Tech support site and search. There is something called HYSYS Stream Reporter among the VBA workbooks that have lots of code. Try to find a solution that addresses your need for reactor information.

 

Bobby

thank you Bobby! I am going to find some similar code from "HSR", and also waiting for a specific information.



#12 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 14 July 2016 - 11:21 AM

I found this on the support site using the search engine. Return the first conversion coefficient value thus:

ConvCoeffs = TheRxn.ConversionCoefficientsValue.ConvCoeffs(0).Value

The Value returned is in HYSYS default units. And I don't know what they are for temperature. You will need to check. In any event, what you are retrieving is input, so you can easily check the values in your simulation. And, since it is input, why are you fetching it?

 

Variables and parameters as as per definitions in the attachment. Consult the customize guide in the user manual to be sure that I have the right names, etc. Or use the object explorer now that you know where to look.

 

 

 

 

 

 

 

 

Attached File  Can I access HYSYS Reactions using OLE.htm   80.44KB   15 downloads


Edited by Bobby Strain, 14 July 2016 - 11:38 AM.


#13 Bamboo

Bamboo

    Brand New Member

  • Members
  • 8 posts

Posted 15 July 2016 - 01:37 AM

I found this on the support site using the search engine. Return the first conversion coefficient value thus:

ConvCoeffs = TheRxn.ConversionCoefficientsValue.ConvCoeffs(0).Value

The Value returned is in HYSYS default units. And I don't know what they are for temperature. You will need to check. In any event, what you are retrieving is input, so you can easily check the values in your simulation. And, since it is input, why are you fetching it?

 

Variables and parameters as as per definitions in the attachment. Consult the customize guide in the user manual to be sure that I have the right names, etc. Or use the object explorer now that you know where to look.

 

 

 

thank you Bobby!  Actually I want "give"  values to the conversion use my equation.

because when i "get" the value easily, then I can "send value" to the variable easily.

 

 

 

 

attachicon.gifCan I access HYSYS Reactions using OLE.htm



#14 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 15 July 2016 - 09:45 AM

You should ask questions directly, stating what you want to do.  In this case, the attachment has all that you need, and answers the question you did not ask. You need to look carefully at how to get and set things. Reactions are a bit different than stream properties when sending values. Or getting values. And the code above to get the value probably isn't quite right. Maybe you can let me know how to do that.

 

Bobby



#15 Bamboo

Bamboo

    Brand New Member

  • Members
  • 8 posts

Posted 30 August 2016 - 02:36 AM

You should ask questions directly, stating what you want to do.  In this case, the attachment has all that you need, and answers the question you did not ask. You need to look carefully at how to get and set things. Reactions are a bit different than stream properties when sending values. Or getting values. And the code above to get the value probably isn't quite right. Maybe you can let me know how to do that.

 

Bobby

thank you Bobby, the attachment is vary helpful to me.






Similar Topics