Skip to content

Commit

Permalink
set max out pressure compressors new version (#1091)
Browse files Browse the repository at this point in the history
* set max out pressure compressors new version

* added actualCompressionRatio
  • Loading branch information
EvenSol authored Sep 7, 2024
1 parent 7209fcd commit ff49e52
Showing 1 changed file with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ public class Compressor extends TwoPortEquipment implements CompressorInterface
private double outTemperature = 298.15;
private boolean useOutTemperature = false;
private double compressionRatio = 2.0;
private double actualCompressionRatio = 2.0;
private boolean useCompressionRatio = false;
private double maxOutletPressure = 10000.0;

private boolean isSetMaxOutletPressure = false;
private CompressorPropertyProfile propertyProfile = new CompressorPropertyProfile();
public double dH = 0.0;
public double inletEnthalpy = 0;
Expand Down Expand Up @@ -349,7 +353,11 @@ public void run(UUID id) {
double fractionAntiSurge = 0.0;
double kappa = 0.0;
if (useCompressionRatio) {
setOutletPressure(presinn * compressionRatio);
double outpres = presinn * compressionRatio;
if (isSetMaxOutletPressure && outpres > maxOutletPressure) {
outpres = maxOutletPressure;
}
setOutletPressure(outpres);
}
if (useOutTemperature) {
if (useRigorousPolytropicMethod) {
Expand Down Expand Up @@ -659,7 +667,7 @@ public void run(UUID id) {
polytropicFluidHead =
getPower() / getThermoSystem().getFlowRate("kg/sec") / 1000.0 * getPolytropicEfficiency();
polytropicHeadMeter = polytropicFluidHead * 1000.0 / 9.81;
compressionRatio = getOutletPressure() / presinn;
actualCompressionRatio = getOutletPressure() / presinn;
setCalculationIdentifier(id);
}

Expand Down Expand Up @@ -1431,4 +1439,26 @@ public double getCompressionRatio() {
public String toJson() {
return new GsonBuilder().create().toJson(new CompressorResponse(this));
}

public double getMaxOutletPressure() {
return maxOutletPressure;
}

public void setMaxOutletPressure(double maxOutletPressure) {
this.maxOutletPressure = maxOutletPressure;
this.isSetMaxOutletPressure = true;
}

public boolean isSetMaxOutletPressure() {
return isSetMaxOutletPressure;
}

public void setSetMaxOutletPressure(boolean isSetMaxOutletPressure) {
this.isSetMaxOutletPressure = isSetMaxOutletPressure;
}

public double getActualCompressionRatio() {
return actualCompressionRatio;
}

}

0 comments on commit ff49e52

Please sign in to comment.