File size: 3,633 Bytes
b1b3bae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
'    DWSIM Interface definitions
'    Copyright 2010-2017 Daniel Wagner O. de Medeiros
'
'    This file is part of DWSIM.
'
'    DWSIM is free software: you can redistribute it and/or modify
'    it under the terms of the GNU General Public License as published by
'    the Free Software Foundation, either version 3 of the License, or
'    (at your option) any later version.
'
'    DWSIM is distributed in the hope that it will be useful,
'    but WITHOUT ANY WARRANTY; without even the implied warranty of
'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'    GNU General Public License for more details.
'
'    You should have received a copy of the GNU General Public License
'    along with DWSIM.  If not, see <http://www.gnu.org/licenses/>.

''' <summary>
''' This interface defines the basic properties of a flash algorithm, including an instance of the class which contains its current settings.
''' </summary>
<InterfaceType(ComInterfaceType.InterfaceIsIDispatch)>
Public Interface IFlashAlgorithm

    Property FlashSettings As Dictionary(Of Enums.FlashSetting, String)

    Function Clone() As IFlashAlgorithm

    Function GetNewInstance() As IFlashAlgorithm

    ReadOnly Property AlgoType As Enums.FlashMethod

    ReadOnly Property Name As String

    ReadOnly Property Description As String

    Property Tag As String

    ReadOnly Property InternalUseOnly As Boolean

    ReadOnly Property MobileCompatible As Boolean

    Property Order As Integer

End Interface

''' <summary>
''' This interface defines the parameters of a flash calculation result.
''' </summary>
<InterfaceType(ComInterfaceType.InterfaceIsIDispatch)>
Public Interface IFlashCalculationResult

    Property BaseMoleAmount As Double
    Property Kvalues As List(Of Double)
    Property MixtureMoleAmounts As List(Of Double)
    Property VaporPhaseMoleAmounts As List(Of Double)
    Property LiquidPhase1MoleAmounts As List(Of Double)
    Property LiquidPhase2MoleAmounts As List(Of Double)
    Property SolidPhaseMoleAmounts As List(Of Double)
    Property CalculatedTemperature As Nullable(Of Double)
    Property CalculatedPressure As Nullable(Of Double)
    Property CalculatedEnthalpy As Nullable(Of Double)
    Property CalculatedEntropy As Nullable(Of Double)
    Property CompoundProperties As List(Of ICompoundConstantProperties)
    Property FlashAlgorithmType As String
    Property ResultException As Exception
    Property IterationsTaken As Integer
    Property TimeTaken As TimeSpan

    Function GetVaporPhaseMoleFractions() As Double()

    Function GetLiquidPhase1MoleFractions() As Double()

    Function GetLiquidPhase2MoleFractions() As Double()

    Function GetSolidPhaseMoleFractions() As Double()

    Function GetVaporPhaseMoleFraction() As Double

    Function GetLiquidPhase1MoleFraction() As Double

    Function GetLiquidPhase2MoleFraction() As Double

    Function GetSolidPhaseMoleFraction() As Double

    Function GetVaporPhaseMassFractions() As Double()

    Function GetLiquidPhase1MassFractions() As Double()

    Function GetLiquidPhase2MassFractions() As Double()

    Function GetSolidPhaseMassFractions() As Double()

    Function ConvertToMassFractions(ByVal Vz As Double()) As Double()

    Function CalcMolarWeight(ByVal Vz() As Double) As Double

    Function GetVaporPhaseMassFraction() As Double

    Function GetLiquidPhase1MassFraction() As Double

    Function GetLiquidPhase2MassFraction() As Double

    Function GetSolidPhaseMassFraction() As Double

End Interface