From 0622462f221c83e54246f0899f01dc066896d646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Sat, 11 Jan 2025 08:50:29 +0100 Subject: [PATCH] ref + docfix --- .../NonEquilibriumFluidBoundary.java | 3 -- .../equipment/ProcessEquipmentInterface.java | 10 +++--- .../neqsim/process/equipment/tank/Tank.java | 33 +++++++++++++++---- .../neqsim/thermo/component/Component.java | 5 +-- .../java/neqsim/thermo/phase/PhaseEos.java | 3 +- .../neqsim/thermo/phase/PhaseInterface.java | 23 +++++++------ .../neqsim/thermo/system/SystemInterface.java | 12 ++++--- .../util/readwrite/EclipseFluidReadWrite.java | 3 -- .../ThermodynamicOperations.java | 3 +- .../process/measurementdevice/nmVOCTest.java | 2 +- .../processmodel/LargeCombinedModelsTest.java | 2 +- .../SalesGasAndStableOilTest.java | 5 ++- 12 files changed, 60 insertions(+), 44 deletions(-) diff --git a/src/main/java/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/NonEquilibriumFluidBoundary.java b/src/main/java/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/NonEquilibriumFluidBoundary.java index 1b2c764b93..acfbfabdd5 100644 --- a/src/main/java/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/NonEquilibriumFluidBoundary.java +++ b/src/main/java/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/NonEquilibriumFluidBoundary.java @@ -628,8 +628,5 @@ public void solve() { } while (Math.abs((oldHeatFlux - heatFlux) / heatFlux) > 1e-6 && heatTransferCalc && iterInner < 50); init(); - // System.out.println("iterInner " +iterInner + " temp gas " + - // interphaseSystem.getTemperature(0)+ " temp liq " + - // interphaseSystem.getTemperature(1)); } } diff --git a/src/main/java/neqsim/process/equipment/ProcessEquipmentInterface.java b/src/main/java/neqsim/process/equipment/ProcessEquipmentInterface.java index ee6b796da8..e72c55f64e 100644 --- a/src/main/java/neqsim/process/equipment/ProcessEquipmentInterface.java +++ b/src/main/java/neqsim/process/equipment/ProcessEquipmentInterface.java @@ -89,8 +89,7 @@ public default boolean needRecalculation() { * setController. *
* - * @param controller a {@link neqsim.process.controllerdevice.ControllerDeviceInterface} - * object + * @param controller a {@link neqsim.process.controllerdevice.ControllerDeviceInterface} object */ public void setController(ControllerDeviceInterface controller); @@ -166,8 +165,7 @@ public default SystemInterface getFluid() { * runConditionAnalysis. * * - * @param refExchanger a - * {@link neqsim.process.equipment.ProcessEquipmentInterface} object + * @param refExchanger a {@link neqsim.process.equipment.ProcessEquipmentInterface} object */ public void runConditionAnalysis(ProcessEquipmentInterface refExchanger); @@ -216,10 +214,10 @@ public default SystemInterface getFluid() { /** *- * toJson. + * Serializes the Process Equipment along with its state to a JSON string. *
* - * @return a String + * @return json string. */ public String toJson(); diff --git a/src/main/java/neqsim/process/equipment/tank/Tank.java b/src/main/java/neqsim/process/equipment/tank/Tank.java index ae6012ba03..a0b76e7c9f 100644 --- a/src/main/java/neqsim/process/equipment/tank/Tank.java +++ b/src/main/java/neqsim/process/equipment/tank/Tank.java @@ -1,6 +1,8 @@ package neqsim.process.equipment.tank; import java.util.UUID; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import neqsim.process.equipment.ProcessEquipmentBaseClass; import neqsim.process.equipment.mixer.Mixer; import neqsim.process.equipment.stream.Stream; @@ -20,6 +22,8 @@ public class Tank extends ProcessEquipmentBaseClass { /** Serialization version UID. */ private static final long serialVersionUID = 1000; + /** Logger object for class. */ + static Logger logger = LogManager.getLogger(Tank.class); SystemInterface thermoSystem; SystemInterface gasSystem; @@ -148,14 +152,29 @@ public StreamInterface getLiquid() { return getLiquidOutStream(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + *+ * Calculates the following properties: + *
thermoSystem
including propertiesnumberOfMoles = totalNumberOfMoles * z
.
+ * Number of moles of Component in System. Ideally
+ * numberOfMoles = totalNumberOfMoles * z
.
*/
protected double numberOfMoles = 0.0;
- /** Number of moles of Component in Phase. totalNumberOfMoles * x * beta
. */
+ /** Number of moles of Component in Phase. Ideally totalNumberOfMoles * x * beta
. */
protected double numberOfMolesInPhase = 0.0;
protected double K;
diff --git a/src/main/java/neqsim/thermo/phase/PhaseEos.java b/src/main/java/neqsim/thermo/phase/PhaseEos.java
index 3bfac0e232..eb4a8598e7 100644
--- a/src/main/java/neqsim/thermo/phase/PhaseEos.java
+++ b/src/main/java/neqsim/thermo/phase/PhaseEos.java
@@ -36,7 +36,7 @@ public abstract class PhaseEos extends Phase implements PhaseEosInterface {
public double delta1 = 0;
public double delta2 = 0;
- protected EosMixingRules mixSelect = null;
+ protected EosMixingRules mixSelect = new EosMixingRules();
protected EosMixingRulesInterface mixRule = null;
double uEOS = 0;
double wEOS = 0;
@@ -63,7 +63,6 @@ public PhaseEos clone() {
*
*/
public PhaseEos() {
- mixSelect = new EosMixingRules();
componentArray = new ComponentEosInterface[ThermodynamicModelSettings.MAX_NUMBER_OF_COMPONENTS];
mixRule = mixSelect.getMixingRule(1);
// solver = new newtonRhapson();
diff --git a/src/main/java/neqsim/thermo/phase/PhaseInterface.java b/src/main/java/neqsim/thermo/phase/PhaseInterface.java
index 9372762d79..0f7423039c 100644
--- a/src/main/java/neqsim/thermo/phase/PhaseInterface.java
+++ b/src/main/java/neqsim/thermo/phase/PhaseInterface.java
@@ -39,10 +39,10 @@ public interface PhaseInterface extends ThermodynamicConstantsInterface, Cloneab
/**
*
- * setMoleFractions.
+ * Set x
and normalize for all Components in phase.
*
x
.
+ *
*
- * normalize.
+ * Property x
is the mole fraction of a component in a specific phase. Normalizing,
+ * means that the sum of x
for all Components in a phase equal 1.0.
*
- * getNumberOfMolesInPhase. + * Get the number of moles the phase contains. *
* - * @return a double + * @return The number of moles in the phase. */ public double getNumberOfMolesInPhase(); @@ -1723,7 +1726,7 @@ public default void setMixingRule(int mr) { /** *- * dFdT. + * Calculate derivative of F per Temperature, i.e., dF/dT. *
* * @return a double @@ -1732,7 +1735,7 @@ public default void setMixingRule(int mr) { /** *- * dFdV. + * Calculate derivative of F per Volume, i.e., dF/dV. *
* * @return a double @@ -1741,7 +1744,7 @@ public default void setMixingRule(int mr) { /** *- * dFdTdV. + * Calculate derivative of F per Temperature and Volume, i.e., dF/dT * 1/dV. *
* * @return a double @@ -1818,8 +1821,8 @@ public default void setMixingRule(int mr) { public double getLogInfiniteDiluteFugacity(int k); /** - * Get mixing rule - * + * Get mixing rule. + * * @return a MixingRulesInterface */ public MixingRulesInterface getMixingRule(); diff --git a/src/main/java/neqsim/thermo/system/SystemInterface.java b/src/main/java/neqsim/thermo/system/SystemInterface.java index 78d378f352..e98bd59e7a 100644 --- a/src/main/java/neqsim/thermo/system/SystemInterface.java +++ b/src/main/java/neqsim/thermo/system/SystemInterface.java @@ -1472,7 +1472,7 @@ public default int getPhaseNumberOfPhase(String phaseTypeName) { /** *
- * Getter for property TC
.
+ * Get critical temperature.
*
- * method to return temperature. + * method to return temperature from a specific phase. *
* * @param phaseNumber phase to get temperature of * @return temperature in unit Kelvin */ - public double getTemperature(int phaseNumber); + public double getTemperature(int phaseNumber); // TODO: is it possible for the phases to have + // different temperatures? /** * method to return temperature in a specified unit. @@ -2123,9 +2124,10 @@ public default void prettyPrint() { public void setAttractiveTerm(int i); /** + * Setter for propertybeta
.
*
- * Setter for property beta
. NB! Sets beta = b for first phase and 1-b for second
- * phase, not for multiphase systems.
+ * NB! Sets beta = b for first (heaviest) phase and 1-b for second (lightest) phase, not for
+ * multiphase systems.
*