Skip to content

Commit

Permalink
Merge branch 'master' into physicalpropertytypes
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 28, 2024
2 parents a7491b5 + 5cc8177 commit e1fedfc
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ public SimpleAbsorber(String name, StreamInterface inStream1) {
outStream[1].run();
}

/** {@inheritDoc} */
@Override
public AbsorberMechanicalDesign getMechanicalDesign() {
return new AbsorberMechanicalDesign(this);
}

/** {@inheritDoc} */
@Override
public void setName(String name) {
Expand Down Expand Up @@ -160,24 +154,26 @@ public void setOutTemperature(double temperature) {

/**
* <p>
* getOutTemperature.
* Get temperature of outstream i.
* </p>
*
* @param i a int
* @return a double
*/
public void getOutTemperature(int i) {
outStream[i].getThermoSystem().getTemperature();
public double getOutTemperature(int i) {
return outStream[i].getThermoSystem().getTemperature();
}

/**
* <p>
* getInTemperature.
* * Get temperature of instream i.
* </p>
*
* @param i a int
* @return a double
*/
public void getInTemperature(int i) {
inStream[i].getThermoSystem().getTemperature();
public double getInTemperature(int i) {
return inStream[i].getThermoSystem().getTemperature();
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -371,4 +367,10 @@ public double getWettingRate() {
double intArea = 3.14 * getInternalDiameter() * getInternalDiameter() / 4.0;
return getLiquidOutStream().getThermoSystem().getFlowRate("m3/hr") / intArea;
}

/** {@inheritDoc} */
@Override
public AbsorberMechanicalDesign getMechanicalDesign() {
return new AbsorberMechanicalDesign(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ public SimpleAdsorber(String name, StreamInterface inStream1) {
outStream[1].run();
}

/** {@inheritDoc} */
@Override
public AdsorberMechanicalDesign getMechanicalDesign() {
return new AdsorberMechanicalDesign(this);
}

/** {@inheritDoc} */
@Override
public void setName(String name) {
Expand Down Expand Up @@ -125,24 +119,24 @@ public void setOutTemperature(double temperature) {

/**
* <p>
* getOutTemperature.
* Get temperature of outstream i.
* </p>
*
* @param i a int
*/
public void getOutTemperature(int i) {
outStream[i].getThermoSystem().getTemperature();
public double getOutTemperature(int i) {
return outStream[i].getThermoSystem().getTemperature();
}

/**
* <p>
* getInTemperature.
* Get temperature of instream i.
* </p>
*
* @param i a int
*/
public void getInTemperature(int i) {
inStream[i].getThermoSystem().getTemperature();
public double getInTemperature(int i) {
return inStream[i].getThermoSystem().getTemperature();
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -316,4 +310,10 @@ public double getNTU() {
public void setNTU(double NTU) {
this.NTU = NTU;
}

/** {@inheritDoc} */
@Override
public AdsorberMechanicalDesign getMechanicalDesign() {
return new AdsorberMechanicalDesign(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class HeatExchanger extends Heater implements HeatExchangerInterface {
public double thermalEffectiveness = 0.0;
private String flowArrangement = "concentric tube counterflow";
private boolean useDeltaT = false;
private double deltaT = 1.0;

/**
* Constructor for HeatExchanger.
Expand All @@ -64,11 +65,7 @@ public HeatExchanger(String name) {
* @param inStream1 input stream
*/
public HeatExchanger(String name, StreamInterface inStream1) {
this(name);
this.inStream[0] = inStream1;
this.inStream[1] = inStream1;
outStream[0] = inStream1.clone();
outStream[1] = inStream1.clone();
this(name, inStream1, inStream1);
}

/**
Expand All @@ -84,23 +81,26 @@ public HeatExchanger(String name, StreamInterface inStream1, StreamInterface inS
this.inStream[1] = inStream2;
outStream[0] = inStream1.clone();
outStream[1] = inStream2.clone();
setName(name);
}

/**
* <p>
* addInStream.
* Add inlet stream.
* </p>
*
* @param inStream a {@link neqsim.processsimulation.processequipment.stream.StreamInterface}
* object
*/
public void addInStream(StreamInterface inStream) {
// todo: this is probably intended to specifically set the second stream. should be deprecated
// and replaced by setFeedStream?
this.inStream[1] = inStream;
}

/**
* <p>
* setFeedStream.
* setFeedStream. Will also set name of outstreams.
* </p>
*
* @param number a int
Expand All @@ -110,6 +110,7 @@ public void addInStream(StreamInterface inStream) {
public void setFeedStream(int number, StreamInterface inStream) {
this.inStream[number] = inStream;
outStream[number] = inStream.clone();
setName(getName());
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -152,24 +153,26 @@ public void setOutTemperature(double temperature) {

/**
* <p>
* getOutTemperature.
* Get temperature of outstream i.
* </p>
*
* @param i a int
* @return a double
*/
public void getOutTemperature(int i) {
outStream[i].getThermoSystem().getTemperature();
public double getOutTemperature(int i) {
return outStream[i].getThermoSystem().getTemperature();
}

/**
* <p>
* getInTemperature.
* Get temperature of instream i.
* </p>
*
* @param i a int
* @return a double
*/
public void getInTemperature(int i) {
inStream[i].getThermoSystem().getTemperature();
public double getInTemperature(int i) {
return inStream[i].getThermoSystem().getTemperature();
}

/**
Expand Down Expand Up @@ -225,13 +228,12 @@ public void runSpecifiedStream(UUID id) {

/**
* <p>
* runSpecifiedStream.
* runDeltaT.
* </p>
*
* @param id UUID of run
*/
public void runDeltaT(UUID id) {

if (getSpecification().equals("out stream")) {
runSpecifiedStream(id);
} else if (firstTime) {
Expand Down Expand Up @@ -704,18 +706,20 @@ public String toJson() {
}

/**
* <p>Setter for the field <code>useDeltaT</code>.</p>
* <p>
* Setter for the field <code>useDeltaT</code>.
* </p>
*
* @param useDeltaT a boolean
*/
public void setUseDeltaT(boolean useDeltaT) {
this.useDeltaT = useDeltaT;
}

private double deltaT = 1.0;

/**
* <p>Getter for the field <code>deltaT</code>.</p>
* <p>
* Getter for the field <code>deltaT</code>.
* </p>
*
* @return a double
*/
Expand All @@ -724,7 +728,9 @@ public double getDeltaT() {
}

/**
* <p>Setter for the field <code>deltaT</code>.</p>
* <p>
* Setter for the field <code>deltaT</code>.
* </p>
*
* @param deltaT a double
*/
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/neqsim/thermo/system/SystemThermo.java
Original file line number Diff line number Diff line change
Expand Up @@ -915,11 +915,18 @@ public void addTBPfraction(String componentName, double numberOfMoles, double mo
// //refSystem.initPhysicalProperties();
// // APIdens - refSystem.getPhase(1).getPhysicalProperties().getDensity();
// sammenligne med API-standard for tetthet - og sette Penloux dt
} catch (RuntimeException ex) {
// todo: Should not swallow notimplementedexception
/*
* if (ex.getCause().getClass().equals(NotImplementedException.class)) { throw ex; }
*/
logger.error(ex.getMessage());
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
}

double critVol = characterization.getTBPModel().calcCriticalVolume(molarMass * 1000, density);

// 0.2918-0.0928*acs)*ThermodynamicConstantsInterface.R*TC/PC*10.0;
addComponent(componentName, numberOfMoles, TC, PC, acs);
double Kwatson = Math.pow(TB * 1.8, 1.0 / 3.0) / density;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ public static void setComposition(SystemInterface fluid, String inputFile) {
fluid.addComponent(name + pseudoName, ZI.get(counter));
}
}
} catch (RuntimeException ex) {
logger.error(ex.getMessage());
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
logger.error(ex.getMessage());
}
}

Expand Down

0 comments on commit e1fedfc

Please sign in to comment.