Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Nov 19, 2024
1 parent 9531058 commit bc4ee0e
Showing 1 changed file with 18 additions and 27 deletions.
45 changes: 18 additions & 27 deletions src/main/java/neqsim/process/processmodel/ProcessSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ public ProcessSystem(String name) {
* Add to end.
* </p>
*
* @param operation a {@link neqsim.process.equipment.ProcessEquipmentInterface}
* object
* @param operation a {@link neqsim.process.equipment.ProcessEquipmentInterface} object
*/
public void add(ProcessEquipmentInterface operation) {
// Add to end
Expand All @@ -82,8 +81,7 @@ public void add(ProcessEquipmentInterface operation) {
* </p>
*
* @param position 0-based position
* @param operation a {@link neqsim.process.equipment.ProcessEquipmentInterface}
* object
* @param operation a {@link neqsim.process.equipment.ProcessEquipmentInterface} object
*/
public void add(int position, ProcessEquipmentInterface operation) {
ArrayList<ProcessEquipmentInterface> units = this.getUnitOperations();
Expand Down Expand Up @@ -114,8 +112,8 @@ public void add(int position, ProcessEquipmentInterface operation) {
* Add measurementdevice.
* </p>
*
* @param measurementDevice a
* {@link neqsim.process.measurementdevice.MeasurementDeviceInterface} object
* @param measurementDevice a {@link neqsim.process.measurementdevice.MeasurementDeviceInterface}
* object
*/
public void add(MeasurementDeviceInterface measurementDevice) {
measurementDevices.add(measurementDevice);
Expand All @@ -126,8 +124,8 @@ public void add(MeasurementDeviceInterface measurementDevice) {
* Add multiple process equipment to end.
* </p>
*
* @param operations an array of
* {@link neqsim.process.equipment.ProcessEquipmentInterface} objects
* @param operations an array of {@link neqsim.process.equipment.ProcessEquipmentInterface}
* objects
*/
public void add(ProcessEquipmentInterface[] operations) {
getUnitOperations().addAll(Arrays.asList(operations));
Expand Down Expand Up @@ -223,8 +221,7 @@ public int getUnitNumber(String name) {
* </p>
*
* @param unitName a {@link java.lang.String} object
* @param operation a {@link neqsim.process.equipment.ProcessEquipmentBaseClass}
* object
* @param operation a {@link neqsim.process.equipment.ProcessEquipmentBaseClass} object
*/
public void replaceObject(String unitName, ProcessEquipmentBaseClass operation) {
unitOperations.set(getUnitNumber(name), operation);
Expand Down Expand Up @@ -441,8 +438,7 @@ public void run(UUID id) {

for (int i = 0; i < unitOperations.size(); i++) {
if (unitOperations.get(i).getClass().getSimpleName().equals("Adjuster")) {
if (!((neqsim.process.equipment.util.Adjuster) unitOperations.get(i))
.solved()) {
if (!((neqsim.process.equipment.util.Adjuster) unitOperations.get(i)).solved()) {
isConverged = false;
break;
}
Expand All @@ -460,7 +456,7 @@ public void run(UUID id) {
* signalDB[timeStepNumber][3 * i + 3] = ((MeasurementDeviceInterface)
* measurementDevices.get(i)) .getUnit(); }
*/
} while (((!isConverged || (iter < 2 && hasRecycle)) && iter < 100) && runStep);
} while (((!isConverged || (iter < 2 && hasRecycle)) && iter < 100) && !runStep);

for (int i = 0; i < unitOperations.size(); i++) {
unitOperations.get(i).setCalculationIdentifier(id);
Expand Down Expand Up @@ -747,10 +743,10 @@ public void setRunStep(boolean runStep) {
}

/**
* Getter for the field <code>runStep</code>.
*
* @return A <code>boolean</code> value if run only one iteration
*/
* Getter for the field <code>runStep</code>.
*
* @return A <code>boolean</code> value if run only one iteration
*/
public boolean isRunStep() {
return runStep;
}
Expand Down Expand Up @@ -803,11 +799,10 @@ public double getPower(String unit) {
double power = 0.0;
for (int i = 0; i < unitOperations.size(); i++) {
if (unitOperations.get(i).getClass().getSimpleName().equals("Compressor")) {
power += ((neqsim.process.equipment.compressor.Compressor) unitOperations
.get(i)).getPower();
power +=
((neqsim.process.equipment.compressor.Compressor) unitOperations.get(i)).getPower();
} else if (unitOperations.get(i).getClass().getSimpleName().equals("Pump")) {
power += ((neqsim.process.equipment.pump.Pump) unitOperations.get(i))
.getPower();
power += ((neqsim.process.equipment.pump.Pump) unitOperations.get(i)).getPower();
}
}
if (unit.equals("MW")) {
Expand All @@ -831,9 +826,7 @@ public double getCoolerDuty(String unit) {
double heat = 0.0;
for (int i = 0; i < unitOperations.size(); i++) {
if (unitOperations.get(i).getClass().getSimpleName().equals("Cooler")) {
heat +=
((neqsim.process.equipment.heatexchanger.Cooler) unitOperations.get(i))
.getDuty();
heat += ((neqsim.process.equipment.heatexchanger.Cooler) unitOperations.get(i)).getDuty();
}
}
if (unit.equals("MW")) {
Expand All @@ -857,9 +850,7 @@ public double getHeaterDuty(String unit) {
double heat = 0.0;
for (int i = 0; i < unitOperations.size(); i++) {
if (unitOperations.get(i).getClass().getSimpleName().equals("Heater")) {
heat +=
((neqsim.process.equipment.heatexchanger.Heater) unitOperations.get(i))
.getDuty();
heat += ((neqsim.process.equipment.heatexchanger.Heater) unitOperations.get(i)).getDuty();
}
}
if (unit.equals("MW")) {
Expand Down

0 comments on commit bc4ee0e

Please sign in to comment.