|
6 | 6 |
|
7 | 7 | package neqsim.processSimulation.processEquipment.stream;
|
8 | 8 |
|
| 9 | +import java.util.ArrayList; |
| 10 | +import java.util.HashMap; |
9 | 11 | import java.util.UUID;
|
10 | 12 | import org.apache.logging.log4j.LogManager;
|
11 | 13 | import org.apache.logging.log4j.Logger;
|
| 14 | +import com.google.gson.GsonBuilder; |
12 | 15 | import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
|
| 16 | +import neqsim.processSimulation.util.monitor.StreamResponse; |
13 | 17 | import neqsim.standards.gasQuality.Standard_ISO6976;
|
14 | 18 | import neqsim.thermo.system.SystemInterface;
|
15 | 19 | import neqsim.thermodynamicOperations.ThermodynamicOperations;
|
@@ -436,9 +440,11 @@ public void displayResult() {
|
436 | 440 | */
|
437 | 441 | @Override
|
438 | 442 | public String[][] getResultTable() {
|
439 |
| - return getFluid().getResultTable(); |
| 443 | + return getFluid().calcResultTable(); |
440 | 444 | }
|
441 | 445 |
|
| 446 | + |
| 447 | + |
442 | 448 | /** {@inheritDoc} */
|
443 | 449 | @Override
|
444 | 450 | public void runTransient(double dt, UUID id) {
|
@@ -607,4 +613,55 @@ public SystemInterface getFluid() {
|
607 | 613 | return thermoSystem;
|
608 | 614 | }
|
609 | 615 | }
|
| 616 | + |
| 617 | + /** |
| 618 | + * <p> |
| 619 | + * getReport. |
| 620 | + * </p> |
| 621 | + * |
| 622 | + * @return a String object |
| 623 | + */ |
| 624 | + public ArrayList<String[]> getReport() { |
| 625 | + ArrayList<String[]> report = new ArrayList<String[]>(); |
| 626 | + HashMap<String, String> gasprops = new HashMap<String, String>(); |
| 627 | + ArrayList<String> phases = new ArrayList<String>(); |
| 628 | + |
| 629 | + phases.add("Total"); |
| 630 | + if (getFluid().hasPhaseType("gas")) { |
| 631 | + phases.add("Gas"); |
| 632 | + gasprops.put("temperature", |
| 633 | + Double.toString(getTemperature(neqsim.util.unit.Units.getSymbol("temperature")))); |
| 634 | + } |
| 635 | + if (getFluid().hasPhaseType("oil")) { |
| 636 | + phases.add("oil"); |
| 637 | + } |
| 638 | + if (getFluid().hasPhaseType("aqueous")) { |
| 639 | + phases.add("aqueous"); |
| 640 | + } |
| 641 | + |
| 642 | + report.add(phases.toArray(new String[0])); |
| 643 | + |
| 644 | + report.add(new String[] {"temperature", |
| 645 | + Double.toString(getTemperature(neqsim.util.unit.Units.getSymbol("temperature"))), |
| 646 | + neqsim.util.unit.Units.getSymbol("temperature")}); |
| 647 | + report.add(new String[] {"pressure", |
| 648 | + Double.toString(getPressure(neqsim.util.unit.Units.getSymbol("pressure"))), |
| 649 | + neqsim.util.unit.Units.getSymbol("pressure")}); |
| 650 | + report.add(new String[] {"mass flow", |
| 651 | + Double.toString(getFlowRate(neqsim.util.unit.Units.getSymbol("mass flow"))), |
| 652 | + neqsim.util.unit.Units.getSymbol("mass flow")}); |
| 653 | + report.add(new String[] {"molar flow", |
| 654 | + Double.toString(getFlowRate(neqsim.util.unit.Units.getSymbol("molar flow"))), |
| 655 | + neqsim.util.unit.Units.getSymbol("molar flow")}); |
| 656 | + report.add(new String[] {"volume flow", |
| 657 | + Double.toString(getFlowRate(neqsim.util.unit.Units.getSymbol("volume flow"))), |
| 658 | + neqsim.util.unit.Units.getSymbol("volume flow")}); |
| 659 | + return report; |
| 660 | + } |
| 661 | + |
| 662 | + /** {@inheritDoc} */ |
| 663 | + @Override |
| 664 | + public String toJson() { |
| 665 | + return new GsonBuilder().create().toJson(new StreamResponse(this)); |
| 666 | + } |
610 | 667 | }
|
0 commit comments