@@ -24,6 +24,34 @@ public class Condenser extends SimpleTray {
24
24
double duty = 0.0 ;
25
25
boolean totalCondenser = false ;
26
26
Splitter mixedStreamSplitter = null ;
27
+ private boolean separation_with_liquid_reflux = false ;
28
+ private double reflux_value ;
29
+ private String reflux_unit ;
30
+
31
+ /**
32
+ * Checks if the separation process involves liquid reflux.
33
+ *
34
+ * @return {@code true} if the separation process involves liquid reflux, {@code false} otherwise.
35
+ */
36
+ public boolean isSeparation_with_liquid_reflux () {
37
+ return separation_with_liquid_reflux ;
38
+ }
39
+
40
+ /**
41
+ * Sets the separation with liquid reflux parameters.
42
+ *
43
+ * @param separation_with_liquid_reflux a boolean indicating if separation with liquid reflux is
44
+ * set
45
+ * @param value the value of the reflux
46
+ * @param unit the unit of the reflux value
47
+ */
48
+ public void setSeparation_with_liquid_reflux (boolean separation_with_liquid_reflux , double value ,
49
+ String unit ) {
50
+ this .refluxIsSet = separation_with_liquid_reflux ;
51
+ this .separation_with_liquid_reflux = separation_with_liquid_reflux ;
52
+ this .reflux_value = value ;
53
+ this .reflux_unit = unit ;
54
+ }
27
55
28
56
/**
29
57
* <p>
@@ -110,13 +138,29 @@ public StreamInterface getProductOutStream() {
110
138
*/
111
139
@ Override
112
140
public StreamInterface getLiquidOutStream () {
113
- if (totalCondenser ) {
114
- return new Stream ( "" , mixedStreamSplitter .getSplitStream (0 ) );
141
+ if (totalCondenser || separation_with_liquid_reflux ) {
142
+ return mixedStreamSplitter .getSplitStream (0 );
115
143
} else {
116
144
return super .getLiquidOutStream ();
117
145
}
118
146
}
119
147
148
+ /**
149
+ * {@inheritDoc}
150
+ *
151
+ * <p>
152
+ * getLiquidOutStream.
153
+ * </p>
154
+ */
155
+ public StreamInterface getLiquidProductStream () {
156
+ if (separation_with_liquid_reflux ) {
157
+ return mixedStreamSplitter .getSplitStream (1 );
158
+ } else {
159
+ return null ;
160
+ }
161
+ }
162
+
163
+
120
164
/** {@inheritDoc} */
121
165
@ Override
122
166
public void run (UUID id ) {
@@ -147,6 +191,17 @@ public void run(UUID id) {
147
191
UUID oldID = getCalculationIdentifier ();
148
192
super .run (id );
149
193
setCalculationIdentifier (oldID );
194
+ } else if (separation_with_liquid_reflux ) {
195
+ super .run (id );
196
+ Stream liquidstream = new Stream ("temp liq stream" , mixedStream .getFluid ().phaseToSystem (1 ));
197
+ liquidstream .run ();
198
+ if (liquidstream .getFlowRate ("kg/hr" ) < this .reflux_value ) {
199
+ liquidstream .setFlowRate (this .reflux_value + 1 , this .reflux_unit );
200
+ liquidstream .run ();
201
+ }
202
+ mixedStreamSplitter = new Splitter ("splitter" , liquidstream , 2 );
203
+ mixedStreamSplitter .setFlowRates (new double [] {this .reflux_value , -1 }, this .reflux_unit );
204
+ mixedStreamSplitter .run ();
150
205
} else {
151
206
SystemInterface thermoSystem2 = streams .get (0 ).getThermoSystem ().clone ();
152
207
// System.out.println("total number of moles " +
0 commit comments