Skip to content

Commit

Permalink
update delta T HX
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Aug 4, 2024
1 parent c676263 commit 2b1d5bb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ public class HeatExchanger extends Heater implements HeatExchangerInterface {
private String flowArrangement = "concentric tube counterflow";
private boolean useDeltaT = false;

public void setUseDeltaT(boolean useDeltaT) {
this.useDeltaT = useDeltaT;
}

private double deltaT = 1.0;

/**
* <p>
* Constructor for HeatExchanger.
Expand Down Expand Up @@ -349,6 +343,9 @@ public void runDeltaT(UUID id) {
}
duty = dEntalphy;
hotColdDutyBalance = 1.0;

UAvalue = dEntalphy / (outStream[streamToSet].getThermoSystem().getTemperature()
- inStream[streamToSet].getThermoSystem().getTemperature());
}

setCalculationIdentifier(id);
Expand Down Expand Up @@ -743,4 +740,21 @@ public String toJson() {
return new GsonBuilder().serializeSpecialFloatingPointValues().create()
.toJson(new HXResponse(this));
}


public void setUseDeltaT(boolean useDeltaT) {
this.useDeltaT = useDeltaT;
}

private double deltaT = 1.0;

public double getDeltaT() {
return deltaT;
}

public void setDeltaT(double deltaT) {
useDeltaT = true;
this.deltaT = deltaT;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ void testRun1() {
// resyc.getOutStream().displayResult();
}

private void assertEqualse(double duty, double d, double e) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'assertEqualse'");
}

@Test
void testRun2() {
Stream stream_Hot = new Stream("Stream1", testSystem);
Expand Down Expand Up @@ -107,18 +102,18 @@ void testRun2() {

operations.run();
assertEquals(heatExchanger1.getDuty(), -9674.051890272862, 1e-1);
// heatExchanger1.setDe
heatExchanger1.setUseDeltaT(true);

heatExchanger1.setDeltaT(1.0);
heatExchanger1.run();
heatExchanger1.getInStream(0).getFluid().prettyPrint();
heatExchanger1.getInStream(1).getFluid().prettyPrint();
heatExchanger1.getOutStream(0).getFluid().prettyPrint();
heatExchanger1.getOutStream(1).getFluid().prettyPrint();
// operations.displayResult();
// heatExchanger1.getOutStream(0).displayResult();
// heatExchanger1.getOutStream(1).displayResult();

// heatExchanger1

assertEquals(15780.77130, heatExchanger1.getUAvalue(), 1e-3);

heatExchanger1 = new neqsim.processSimulation.processEquipment.heatExchanger.HeatExchanger(
"heatEx", stream_Hot, stream_Cold);
heatExchanger1.setDeltaT(1.0);
heatExchanger1.run();

assertEquals(15780.77130, heatExchanger1.getUAvalue(), 1e-3);

}
}

0 comments on commit 2b1d5bb

Please sign in to comment.