Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style, needs to verify inherited comments in Component.java #635

Merged
merged 6 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 37 additions & 71 deletions src/main/java/neqsim/thermo/component/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,7 @@ public double getLiquidConductivityParameter(int i) {
}

/**
* {@inheritDoc}
*
* Units in m*e10
* {@inheritDoc} Units in m*e10
*/
@Override
public double getLennardJonesMolecularDiameter() {
Expand All @@ -855,11 +853,9 @@ public double getHsub() {
}

/**
* {@inheritDoc}
*
* Calculates the pure comonent solid vapor pressure (bar) with the C-C equation, based on Hsub
* Should only be used in the valid temperature range below the triple point (specified in
* component database).
* {@inheritDoc} Calculates the pure comonent solid vapor pressure (bar) with the C-C equation,
* based on Hsub Should only be used in the valid temperature range below the triple point
* (specified in component database).
*/
@Override
public double getCCsolidVaporPressure(double temperature) {
Expand All @@ -868,11 +864,9 @@ public double getCCsolidVaporPressure(double temperature) {
}

/**
* {@inheritDoc}
*
* Calculates the DT of pure comonent solid vapor pressure (bar) with the C-C equation, based on
* Hsub Should only be used in the valid temperature range below the triple point (specified in
* component database).
* {@inheritDoc} Calculates the DT of pure comonent solid vapor pressure (bar) with the C-C
* equation, based on Hsub Should only be used in the valid temperature range below the triple
* point (specified in component database).
*/
@Override
public double getCCsolidVaporPressuredT(double temperature) {
Expand All @@ -881,10 +875,8 @@ public double getCCsolidVaporPressuredT(double temperature) {
}

/**
* {@inheritDoc}
*
* Calculates the pure component solid density in kg/liter Should only be used in the valid
* temperature range (specified in component database).
* {@inheritDoc} Calculates the pure component solid density in kg/liter Should only be used in
* the valid temperature range (specified in component database).
*/
@Override
public double getPureComponentSolidDensity(double temperature) {
Expand All @@ -896,11 +888,9 @@ public double getPureComponentSolidDensity(double temperature) {
}

/**
* {@inheritDoc}
*
* Calculates the pure component liquid density in kg/liter Should only be used in the valid
* temperature range (specified in component database). This method seems to give bad results at
* the moment
* {@inheritDoc} Calculates the pure component liquid density in kg/liter Should only be used in
* the valid temperature range (specified in component database). This method seems to give bad
* results at the moment
*/
@Override
public double getPureComponentLiquidDensity(double temperature) {
Expand Down Expand Up @@ -1158,18 +1148,6 @@ public final double getChemicalPotentialdP() {
return voli;
}

/** {@inheritDoc} */
@Override
public final double getChemicalPotentialdT(PhaseInterface phase) {
return -getEntropy(phase.getTemperature(), phase.getPressure()) / numberOfMolesInPhase;
}

/** {@inheritDoc} */
@Override
public final double getChemicalPotentialdV(PhaseInterface phase) {
return getChemicalPotentialdP() * phase.getdPdVTn();
}

/**
* <p>
* getChemicalPotentialdP.
Expand All @@ -1183,6 +1161,18 @@ public final double getChemicalPotentialdP(int i, PhaseInterface phase) {
return R * phase.getTemperature() * getFugacitydN(i, phase);
}

/** {@inheritDoc} */
@Override
public final double getChemicalPotentialdT(PhaseInterface phase) {
return -getEntropy(phase.getTemperature(), phase.getPressure()) / numberOfMolesInPhase;
}

/** {@inheritDoc} */
@Override
public final double getChemicalPotentialdV(PhaseInterface phase) {
return getChemicalPotentialdP() * phase.getdPdVTn();
}

/** {@inheritDoc} */
@Override
public void setComponentNumber(int numb) {
Expand All @@ -1193,33 +1183,14 @@ public void setComponentNumber(int numb) {
@Override
public double getAntoineVaporPressure(double temp) {
if (antoineLiqVapPresType.equals("pow10")) {
return Math.pow(10.0, AntoineA - (AntoineB / (temp + AntoineC - 273.15))); // equation
// and
// parameter
// from
// properties
// o liquids
// and
// gases
// (poling
// 5th ed)
// equation and parameter from properties o and gases (poling 5th ed)
return Math.pow(10.0, AntoineA - (AntoineB / (temp + AntoineC - 273.15)));
} else if (antoineLiqVapPresType.equals("pow10KPa")) {
return Math.pow(10.0, AntoineA - (AntoineB / (temp + AntoineC)))/1.0e5; // equation
// and
// parameter
// from
// properties
// o liquids
// and
// gases
// (poling
// 5th ed)
}
else if (antoineLiqVapPresType.equals("exp") || antoineLiqVapPresType.equals("log")) {
return Math.exp(AntoineA - (AntoineB / (temp + AntoineC))); // equation and parameter
// from properties o
// liquids and gases (poling
// 5th ed)
// equation and parameter from properties o and gases (poling 5th ed)
return Math.pow(10.0, AntoineA - (AntoineB / (temp + AntoineC))) / 1.0e5;
} else if (antoineLiqVapPresType.equals("exp") || antoineLiqVapPresType.equals("log")) {
// equation and parameter from properties o and gases (poling 5th ed)
return Math.exp(AntoineA - (AntoineB / (temp + AntoineC)));
} else if (Math.abs(AntoineE) > 1e-12) {
return Math.exp(AntoineA + AntoineB / temp + AntoineC * Math.log(temp)
+ AntoineD * Math.pow(temp, AntoineE)) / 100000;
Expand Down Expand Up @@ -1879,9 +1850,8 @@ public java.lang.String getComponentType() {
}

/**
* {@inheritDoc}
*
* Getter for property Henrys Coefficient. Unit is bar. ln H = C1 + C2/T + C3lnT + C4*T
* {@inheritDoc} Getter for property Henrys Coefficient. Unit is bar. ln H = C1 + C2/T + C3lnT +
* C4*T
*/
@Override
public double getHenryCoef(double temperature) {
Expand Down Expand Up @@ -2310,11 +2280,9 @@ public double getFlowRate(String flowunit) {
return numberOfMolesInPhase * getMolarMass() * 60.0;
} else if (flowunit.equals("kg/hr")) {
return numberOfMolesInPhase * getMolarMass() * 3600.0;
}
else if (flowunit.equals("tonnes/year")){
return numberOfMolesInPhase * getMolarMass()*3600.0*24.0*365.0/1000.0;
}
else if (flowunit.equals("m3/hr")) {
} else if (flowunit.equals("tonnes/year")) {
return numberOfMolesInPhase * getMolarMass() * 3600.0 * 24.0 * 365.0 / 1000.0;
} else if (flowunit.equals("m3/hr")) {
return getVoli() / 1.0e5 * 3600.0;
} else if (flowunit.equals("m3/min")) {
return getVoli() / 1.0e5 * 60.0;
Expand All @@ -2331,8 +2299,6 @@ else if (flowunit.equals("m3/hr")) {
}
}



/** {@inheritDoc} */
@Override
public double getTotalFlowRate(String flowunit) {
Expand All @@ -2352,7 +2318,7 @@ public double getTotalFlowRate(String flowunit) {
throw new RuntimeException("failed.. unit: " + flowunit + " not supported");
}
}


/**
* Indexed getter for property matiascopemanParamsUMRPRU.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ public void runProcessTEG() throws InterruptedException {
dryFeedGas.setTemperature(32.48975904520211, "C");
dryFeedGas.setPressure(40.1205259689988, "bara");

StreamSaturatorUtil saturatedFeedGas = new StreamSaturatorUtil(dryFeedGas);
saturatedFeedGas.setName("water saturator Smøbukk");
StreamSaturatorUtil saturatedFeedGas =
new StreamSaturatorUtil("water saturator Smøbukk", dryFeedGas);
saturatedFeedGas.setApprachToSaturation(0.93);

Heater feedTPsetterToAbsorber = new Heater("TP of gas to absorber", saturatedFeedGas.getOutStream());
Heater feedTPsetterToAbsorber =
new Heater("TP of gas to absorber", saturatedFeedGas.getOutletStream());
feedTPsetterToAbsorber.setOutPressure(39.67967207899729, "bara");
feedTPsetterToAbsorber.setOutTemperature(31.40346842493481, "C");

Expand Down Expand Up @@ -80,12 +81,9 @@ public void runProcessTEG() throws InterruptedException {
absorber.setStageEfficiency(1);
absorber.setInternalDiameter(3.65);

Stream dehydratedGas = new Stream(absorber.getGasOutStream());
dehydratedGas.setName("dry gas from absorber");

Stream richTEG = new Stream(absorber.getLiquidOutStream());
richTEG.setName("rich TEG from absorber");
Stream dehydratedGas = new Stream("dry gas from absorber", absorber.getGasOutStream());

Stream richTEG = new Stream("rich TEG from absorber", absorber.getLiquidOutStream());
HydrateEquilibriumTemperatureAnalyser waterDewPointAnalyser = new HydrateEquilibriumTemperatureAnalyser(
dehydratedGas);
waterDewPointAnalyser.setReferencePressure(70.0);
Expand All @@ -95,15 +93,14 @@ public void runProcessTEG() throws InterruptedException {
waterDewPointAnalyser2.setReferencePressure(70.0);
waterDewPointAnalyser2.setName("water dew point analyser");

Heater condHeat = new Heater(richTEG);
condHeat.setName("Condenser heat exchanger");
Heater condHeat = new Heater("Condenser heat exchanger", richTEG);

ThrottlingValve glycol_flash_valve = new ThrottlingValve("Flash valve", condHeat.getOutStream());
ThrottlingValve glycol_flash_valve =
new ThrottlingValve("Flash valve", condHeat.getOutletStream());
glycol_flash_valve.setName("Rich TEG HP flash valve");
glycol_flash_valve.setOutletPressure(7.513533287063168);

Heater heatEx2 = new Heater(glycol_flash_valve.getOutStream());
heatEx2.setName("rich TEG heat exchanger 1");
Heater heatEx2 = new Heater("rich TEG heat exchanger 1", glycol_flash_valve.getOutletStream());
heatEx2.setOutTemperature(273.15 + 90);

neqsim.thermo.system.SystemInterface feedWater = (neqsim.thermo.system.SystemInterface) feedGas.clone();
Expand All @@ -114,25 +111,22 @@ public void runProcessTEG() throws InterruptedException {
waterFeed.setTemperature(90, "C");
waterFeed.setPressure(7.513533287063168, "bara");

Separator flashSep = new Separator(heatEx2.getOutStream());
flashSep.setName("degasing separator");
Separator flashSep = new Separator("degasing separator", heatEx2.getOutletStream());
flashSep.setInternalDiameter(1.2);

Stream flashGas = new Stream(flashSep.getGasOutStream());
flashGas.setName("gas from degasing separator");
Stream flashGas = new Stream("gas from degasing separator", flashSep.getGasOutStream());

Stream flashLiquid = new Stream(flashSep.getLiquidOutStream());
flashLiquid.setName("liquid from degasing separator");
Stream flashLiquid =
new Stream("liquid from degasing separator", flashSep.getLiquidOutStream());

Filter filter = new Filter(flashLiquid);
filter.setName("TEG fine filter");
Filter filter = new Filter("TEG fine filter", flashLiquid);
filter.setDeltaP(0.0, "bara");

Heater heatEx = new Heater(filter.getOutStream());
heatEx.setName("lean/rich TEG heat-exchanger");
Heater heatEx = new Heater("lean/rich TEG heat-exchanger", filter.getOutletStream());
heatEx.setOutTemperature(273.15 + 105.0);

ThrottlingValve glycol_flash_valve2 = new ThrottlingValve("LP flash valve", heatEx.getOutStream());
ThrottlingValve glycol_flash_valve2 =
new ThrottlingValve("LP flash valve", heatEx.getOutletStream());
glycol_flash_valve2.setName("Rich TEG LP flash valve");
glycol_flash_valve2.setOutletPressure(1.1714901511485545);

Expand All @@ -143,29 +137,25 @@ public void runProcessTEG() throws InterruptedException {
strippingGas.setTemperature(185.4402968739743, "C");
strippingGas.setPressure(1.1714901511485545, "bara");


Stream gasToReboiler = (Stream) (strippingGas).clone();
gasToReboiler.setName("gas to reboiler");

DistillationColumn column = new DistillationColumn(1, true, true);
column.setName("TEG regeneration column");
column.addFeedStream(glycol_flash_valve2.getOutStream(), 1);
column.addFeedStream(glycol_flash_valve2.getOutletStream(), 1);
column.getReboiler().setOutTemperature(273.15 + 201.86991706268591);
column.getCondenser().setOutTemperature(273.15 + 102.80145109927442);
column.getTray(1).addStream(gasToReboiler);
column.setTopPressure(1.1582401511485543);
column.setBottomPressure(1.1714901511485545);
column.setInternalDiameter(0.56);

Heater coolerRegenGas = new Heater(column.getGasOutStream());
coolerRegenGas.setName("regen gas cooler");
Heater coolerRegenGas = new Heater("regen gas cooler", column.getGasOutStream());
coolerRegenGas.setOutTemperature(273.15 + 17.685590621935702);

Separator sepregenGas = new Separator(coolerRegenGas.getOutStream());
sepregenGas.setName("regen gas separator");
Separator sepregenGas = new Separator("regen gas separator", coolerRegenGas.getOutletStream());

Stream gasToFlare = new Stream(sepregenGas.getGasOutStream());
gasToFlare.setName("gas to flare");
Stream gasToFlare = new Stream("gas to flare", sepregenGas.getGasOutStream());

Splitter splitterGasToFlare = new Splitter("splitter GasToFlare", gasToFlare);
splitterGasToFlare.setSplitNumber(2);
Expand All @@ -175,10 +165,7 @@ public void runProcessTEG() throws InterruptedException {
strippingFlareGasTPsetter.setOutPressure(1.1714901511485545, "bara");
strippingFlareGasTPsetter.setOutTemperature(185.4402968739743, "C");


Stream liquidToTrreatment = new Stream(sepregenGas.getLiquidOutStream());
liquidToTrreatment.setName("water to treatment");

Stream liquidToTrreatment = new Stream("water to treatment", sepregenGas.getLiquidOutStream());

WaterStripperColumn stripper = new WaterStripperColumn("TEG stripper");
stripper.addSolventInStream(column.getLiquidOutStream());
Expand All @@ -195,7 +182,6 @@ public void runProcessTEG() throws InterruptedException {
recycleFlareGas.setOutletStream(strippingGas);
recycleFlareGas.setPriority(1000);


neqsim.thermo.system.SystemInterface pureTEG = (neqsim.thermo.system.SystemInterface) feedGas.clone();
pureTEG.setMolarComposition(new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,0.0,0.0,0.0, 1.0 });

Expand All @@ -216,19 +202,16 @@ public void runProcessTEG() throws InterruptedException {
makeupMixer.addStream(makeupTEG);


Pump hotLeanTEGPump = new Pump(makeupMixer.getOutStream());
hotLeanTEGPump.setName("lean TEG LP pump");
Pump hotLeanTEGPump = new Pump("lean TEG LP pump", makeupMixer.getOutletStream());
hotLeanTEGPump.setOutletPressure(39.67967207899729);
hotLeanTEGPump.setIsentropicEfficiency(0.9);

Heater coolerhOTteg3 = new Heater(hotLeanTEGPump.getOutStream());
coolerhOTteg3.setName("lean TEG cooler");
Heater coolerhOTteg3 = new Heater("lean TEG cooler", hotLeanTEGPump.getOutletStream());
coolerhOTteg3.setOutTemperature(273.15 + 35.009563114341454);

condHeat.setEnergyStream(column.getCondenser().getEnergyStream());

Stream leanTEGtoabs = new Stream(coolerhOTteg3.getOutStream());
leanTEGtoabs.setName("lean TEG to absorber");
Stream leanTEGtoabs = new Stream("lean TEG to absorber", coolerhOTteg3.getOutletStream());

Recycle resycleLeanTEG = new Recycle("lean TEG resycle");
resycleLeanTEG.addStream(leanTEGtoabs);
Expand Down Expand Up @@ -292,8 +275,6 @@ public void runProcessTEG() throws InterruptedException {
operations5.add(waterDewPointAnalyser);
operations5.add(waterDewPointAnalyser2);



neqsim.processSimulation.processSystem.ProcessModule module1 = new neqsim.processSimulation.processSystem.ProcessModule("Start process");
module1.add(operations1);
module1.add(operations2);
Expand Down