Skip to content

Commit

Permalink
Added Leachman method (#1270)
Browse files Browse the repository at this point in the history
* Added Leachman method

* file added

* Added test and defined methods in phase

* Deleted file
  • Loading branch information
victorigi99 authored Feb 7, 2025
1 parent 0a560d0 commit 264f7a2
Show file tree
Hide file tree
Showing 5 changed files with 1,338 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/main/java/neqsim/thermo/phase/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,50 @@ public double[] getProperties_GERG2008() {
return test.propertiesGERG();
}

/** {@inheritDoc} */
@Override
public double getDensity_Leachman(String hydrogenType) {
neqsim.thermo.util.Leachman.NeqSimLeachman test =
new neqsim.thermo.util.Leachman.NeqSimLeachman(this, hydrogenType);
return test.getDensity();
}

/**
* Gets the density using the default hydrogen type ('normal').
* This method prints a warning if no hydrogen type is specified.
*
* @return the density calculated with the 'normal' hydrogen type.
*/
public double getDensity_Leachman() {
// Warn the user that no hydrogen type was specified and use "normal" by default
System.out.println("No hydrogen type specified. Using default type: 'normal'.");
return getDensity_Leachman("normal");
}



/** {@inheritDoc} */
@Override
public double[] getProperties_Leachman(String hydrogenType) {
neqsim.thermo.util.Leachman.NeqSimLeachman test =
new neqsim.thermo.util.Leachman.NeqSimLeachman(this, hydrogenType);
return test.propertiesLeachman();
}


/**
* Gets the Leachman properties of a phase using the default hydrogen type ('normal').
* This method prints a warning if no hydrogen type is specified.
*
* @return an array of properties of type double.
*/
public double[] getProperties_Leachman() {
// Warn the user and use the default hydrogen type
System.out.println("No hydrogen type specified. Using default type: 'normal'.");
return getProperties_Leachman("normal");
}


/** {@inheritDoc} */
@Override
public double getDensity_AGA8() {
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/neqsim/thermo/phase/PhaseInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,39 @@ public default void initPhysicalProperties(String name) {
*/
public double[] getProperties_GERG2008();


/**
* method to get Leachman density of a phase using the Leachman EoS.
*
* @return density with unit kg/m3
*/
public double getDensity_Leachman(String hydrogenType);

/**
* Overloaded method to get the Leachman density with default hydrogen type ('normal').
*
* @return density with unit kg/m3
*/
public double getDensity_Leachman();

/**
* <p>
* method to get Leachman properties of a phase using the Leachman EoS.
* </p>
*
* @return an array of type double
*/

public double[] getProperties_Leachman(String hydrogenType);

/**
* Overloaded method to get the Leachman properties with default hydrogen type ('normal').
*
* @return density with unit kg/m3
*/

public double[] getProperties_Leachman();

/**
* method to get density of a phase note: does not use Peneloux volume correction.
*
Expand Down
Loading

0 comments on commit 264f7a2

Please sign in to comment.