I finally solved the problem by changing the models of the
thermodynamics library.
I declared the pure component in the basic phase_partials model, and
replaced the pure - declarations in each phase_partials refinement
(ideal_vapor_mixture, UNIFAC_liquid_mixture, etc.) by
(for ideal_vapor_mixture)
FOR i IN components CREATE
pure[i] IS_REFINED_TO ideal_vapor_component(P,T,cd.data[i]);
END FOR;
I think this makes sense, since everyone of the models that refine the
phase_partials model actually defines such a pure component.
I also had to add the VP variable to the pure_component model, but I
think that is not generally a good thing to do. What I was missing is
something like the dynamic_cast capability of C++ for ASCEND models,
but I suppose that does not exist?
Hans
On Wed, Jan 6, 2010 at 6:31 PM, <[email protected]> wrote:
> I don't quite understand what you mean by "cannot see" - About other
> components: Using ethanol and water yields the same problem:
>
> (* This is supposed to be the model for a pervaporation membrane *)
> MODEL pervap_membrane;
> cd IS_A components_data(['ethanol','water'],'ethanol');
>
> (* L-stream *)
> highP_pd IS_A phases_data ('L','none','UNIFAC_liquid_mixture','none');
> highP_eq IS_A boolean;
> L_stream IS_A stream(cd,highP_pd, highP_eq);
>
> FOR i IN cd.components CREATE
> VP[i] ALIASES
> L_stream.phase[L_stream.pd.reference_phase].pure[i].VP;
> END FOR;
>
> END pervap_membrane;
>
> Output:
> Impossible RHS of ALIASES
> (* ERROR *) VP[i] ALIASES
> L_stream.phase[L_stream.pd.reference_phase].pure[i].VP;
>
> On Wed, Jan 6, 2010 at 6:13 PM, Krishnan Chittur <[email protected]> wrote:
>> Hans ... I cannot "see" it ... Does it work with any of the other
>> components??
>> (I imagine so, since the error seems to be about semantics) -
>>
>> On Wed, Jan 6, 2010 at 11:08 AM, <[email protected]> wrote:
>>>
>>> Krishnan, thanks for the quick response!
>>>
>>> An illustration of what I would like to do would be
>>>
>>> (* This is supposed to be the model for a pervaporation membrane *)
>>> MODEL pervap_membrane;
>>>
>>> (* The components we are dealing with:
>>> I added component data for tert_butyl_methyl_ether myself *)
>>> cd IS_A
>>> components_data(['methanol','tert_butyl_methyl_ether','butene_1'],'methanol');
>>>
>>> (* L-stream: Stream on *)
>>> highP_pd IS_A phases_data
>>> ('L','none','UNIFAC_liquid_mixture','none');
>>> highP_eq IS_A boolean;
>>> L_stream IS_A stream(cd,highP_pd, highP_eq);
>>>
>>> FOR i IN cd.components CREATE
>>> VP[i] ALIASES
>>> L_stream.phase[L_stream.pd.reference_phase].pure[i].VP;
>>> END FOR;
>>>
>>> *** equation involving VP[i] explicitly ****
>>>
>>> END pervap_membrane;
>>>
>>> but this fails due to "impossible RHS of ALIASES".
>>>
>>> Hans
>>>
>>> On Wed, Jan 6, 2010 at 5:48 PM, Krishnan Chittur <[email protected]>
>>> wrote:
>>> > Hans ... It could help if you include the models ... I (or someone else)
>>> > can
>>> > then try and debug that
>>> >
>>> > Krishnan
>>> >
>>> > On Wed, Jan 6, 2010 at 10:27 AM, <[email protected]> wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> I am new to ASCEND, so please excuse if this question is a bit dumb.
>>> >>
>>> >> I am trying to implement a model where I have a stream model, and a
>>> >> set of additional equations, some of which include the vapor pressure
>>> >> explictly.
>>> >>
>>> >> I am, however, unable to get the values of the vapor pressure from the
>>> >> model. When I load it into the graphical interface, I can see the
>>> >> values for component i in the tree as
>>> >>
>>> >> L_stream.phase[L_stream.pd.reference_phase].pure[i].VP
>>> >>
>>> >> If I try to access them in the same way in my model I get an error
>>> >> that this value does not exist. I suppose that this is because of the
>>> >> hierarchy of the objects, and the stream only knows that what he has
>>> >> there is a phase_partial, which does not have a VP variable, but I am
>>> >> actually using a derived class.
>>> >>
>>> >> My question: Is there an easy way to extract the value for the vapor
>>> >> pressures from a stream?
>>> >>
>>> >> Thanks!
>>> >>
>>> >> Hans
>>> >>
>>> >>
>>> >>
>>> >> ------------------------------------------------------------------------------
>>> >> This SF.Net email is sponsored by the Verizon Developer Community
>>> >> Take advantage of Verizon's best-in-class app development support
>>> >> A streamlined, 14 day to market process makes app distribution fast and
>>> >> easy
>>> >> Join now and get one step closer to millions of Verizon customers
>>> >> http://p.sf.net/sfu/verizon-dev2dev
>>> >> _______________________________________________
>>> >> Ascend-sim-users mailing list
>>> >> [email protected]
>>> >> https://lists.sourceforge.net/lists/listinfo/ascend-sim-users
>>> >
>>> >
>>
>>
>
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ascend-sim-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ascend-sim-users