Skip to content

Commit

Permalink
update power
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Dec 12, 2023
1 parent ea578a3 commit 1cef9e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -682,15 +682,11 @@ public void runTransient(double dt, UUID id) {
}
runController(dt, id);

thermoSystem = inStream.getThermoSystem().clone();
thermoSystem.init(3);
thermoSystem.initPhysicalProperties("density");

inStream.getThermoSystem().init(3);
outStream.getThermoSystem().init(3);
double head = (outStream.getThermoSystem().getEnthalpy("kJ/kg")
- inStream.getThermoSystem().getEnthalpy("kJ/kg"));
double guessFlow = thermoSystem.getFlowRate("m3/hr");
double guessFlow = inStream.getFluid().getFlowRate("m3/hr");
double actualFlowRateNew = getCompressorChart().getFlow(head, getSpeed(), guessFlow);

try {
Expand All @@ -710,6 +706,10 @@ public void runTransient(double dt, UUID id) {
logger.error(e.getMessage());
}

inletEnthalpy = inStream.getFluid().getEnthalpy();
thermoSystem = outStream.getThermoSystem().clone();
thermoSystem.initPhysicalProperties("density");

polytropicEfficiency =
compressorChart.getPolytropicEfficiency(inStream.getFlowRate("m3/hr"), speed) / 100.0;
polytropicFluidHead = head * polytropicEfficiency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ public void testAntiSurgeControl() {
Compressor compressor1 = new Compressor(separator1.getGasOutStream());
compressor1.setCalculateSteadyState(false);
compressor1.setOutletPressure(100.0);

CompressorMonitor surgemonitor = new CompressorMonitor(compressor1);
surgemonitor.setMaximumValue(5.0);
surgemonitor.setMinimumValue(-5.0);
Expand Down Expand Up @@ -628,7 +627,7 @@ public void testAntiSurgeControl() {
valve2.setPercentValveOpening(50);
valve2.setCalculateSteadyState(false);
valve2.setMinimumValveOpening(1.0);
valve2.setCv(20.0);

ControllerDeviceInterface surgeController = new ControllerDeviceBaseClass();
surgeController.setReverseActing(true);
surgeController.setTransmitter(surgemonitor);
Expand Down Expand Up @@ -680,7 +679,7 @@ public void testAntiSurgeControl() {
+ surgemonitor.getMeasuredValue("distance to surge") + " antisurgeflow "
+ recycleValve.getOutletStream().getFlowRate("kg/hr") + " antisurgevalveopening "
+ recycleValve.getPercentValveOpening() + " compressorouttemperature "
+ compressor1.getOutStream().getTemperature("C"));
+ compressor1.getOutStream().getTemperature("C") + " power " + compressor1.getPower("kW"));

System.out.println("speed " + compressor1.getSpeed());
p.setTimeStep(1.0);
Expand All @@ -704,7 +703,8 @@ public void testAntiSurgeControl() {
+ compressor1.getCompressorChart().getSurgeCurve()
.getSurgeFlow(compressor1.getPolytropicFluidHead())
+ " compressor flow rate " + compressor1.getInletStream().getFlowRate("m3/hr")
+ " fluid head " + compressor1.getPolytropicFluidHead());
+ " fluid head " + compressor1.getPolytropicFluidHead() + " power "
+ compressor1.getPower("kW"));
p.runTransient();
}

Expand All @@ -728,7 +728,8 @@ public void testAntiSurgeControl() {
+ compressor1.getCompressorChart().getSurgeCurve()
.getSurgeFlow(compressor1.getPolytropicFluidHead())
+ " compressor flow rate " + compressor1.getInletStream().getFlowRate("m3/hr")
+ " fluid head " + compressor1.getPolytropicFluidHead());
+ " fluid head " + compressor1.getPolytropicFluidHead() + " power "
+ compressor1.getPower("kW"));
p.runTransient();
}

Expand All @@ -751,7 +752,8 @@ public void testAntiSurgeControl() {
+ compressor1.getCompressorChart().getSurgeCurve()
.getSurgeFlow(compressor1.getPolytropicFluidHead())
+ " compressor flow rate " + compressor1.getInletStream().getFlowRate("m3/hr")
+ " fluid head " + compressor1.getPolytropicFluidHead());
+ " fluid head " + compressor1.getPolytropicFluidHead() + " power "
+ compressor1.getPower("kW"));

p.runTransient();
}
Expand Down

0 comments on commit 1cef9e2

Please sign in to comment.