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

refact: make method default in Interface #950

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void setFrictionFactorType(int type) {
if (type == 1) {
interphaseTransportCoefficient = new InterphaseTransportCoefficientBaseClass(this);
} else {
System.out.println("error chhosing friction type");
System.out.println("error choosing friction type");
}
}

Expand Down
6 changes: 0 additions & 6 deletions src/main/java/neqsim/thermo/phase/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,6 @@ public neqsim.physicalProperties.physicalPropertySystem.PhysicalPropertiesInterf
}
}

/** {@inheritDoc} */
@Override
public void init() {
init(numberOfMolesInPhase / beta, numberOfComponents, initType, getType(), beta);
}

/** {@inheritDoc} */
@Override
public void init(double totalNumberOfMoles, int numberOfComponents, int initType, PhaseType pt,
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/neqsim/thermo/phase/PhaseInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,13 @@ public default double getGamma2() {

/**
* <p>
* init.
* Init using current phase properties.
* </p>
*/
public void init();
public default void init() {
init(getNumberOfMolesInPhase() / getBeta(), getNumberOfComponents(), getInitType(), getType(),
getBeta());
}

/**
* <p>
Expand Down Expand Up @@ -715,7 +718,7 @@ public void init(double totalNumberOfMoles, int numberOfComponents, int initType
* not change the total number of moles of component in system.
*
* NB! Phase fraction <code>beta</code> is not updated by this method. Must be done separately to
* keep consistency between phase and component calculation of of total number of moles in system.
* keep consistency between phase and component calculation of total number of moles in system.
* </p>
*
* @param component Component number to change
Expand All @@ -732,7 +735,7 @@ public default void addMoles(int component, double dn) {
* amount.
*
* NB! Phase fraction <code>beta</code> is not updated by this method. Must be done separately to
* keep consistency between phase and component calculation of of total number of moles in system.
* keep consistency between phase and component calculation of total number of moles in system.
* </p>
*
* @param component Component number to change
Expand All @@ -750,7 +753,7 @@ public default void addMolesChemReac(int component, double dn) {
* <code>numberOfMoles</code> with separate amounts.
*
* NB! Phase fraction <code>beta</code> is not updated by this method. Must be done separately to
* keep consistency between phase and component calculation of of total number of moles in system.
* keep consistency between phase and component calculation of total number of moles in system.
* </p>
*
* @param component Component number to change
Expand Down
Loading