Skip to content

Commit 264f7a2

Browse files
authored
Added Leachman method (#1270)
* Added Leachman method * file added * Added test and defined methods in phase * Deleted file
1 parent 0a560d0 commit 264f7a2

File tree

5 files changed

+1338
-0
lines changed

5 files changed

+1338
-0
lines changed

src/main/java/neqsim/thermo/phase/Phase.java

+44
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,50 @@ public double[] getProperties_GERG2008() {
22282228
return test.propertiesGERG();
22292229
}
22302230

2231+
/** {@inheritDoc} */
2232+
@Override
2233+
public double getDensity_Leachman(String hydrogenType) {
2234+
neqsim.thermo.util.Leachman.NeqSimLeachman test =
2235+
new neqsim.thermo.util.Leachman.NeqSimLeachman(this, hydrogenType);
2236+
return test.getDensity();
2237+
}
2238+
2239+
/**
2240+
* Gets the density using the default hydrogen type ('normal').
2241+
* This method prints a warning if no hydrogen type is specified.
2242+
*
2243+
* @return the density calculated with the 'normal' hydrogen type.
2244+
*/
2245+
public double getDensity_Leachman() {
2246+
// Warn the user that no hydrogen type was specified and use "normal" by default
2247+
System.out.println("No hydrogen type specified. Using default type: 'normal'.");
2248+
return getDensity_Leachman("normal");
2249+
}
2250+
2251+
2252+
2253+
/** {@inheritDoc} */
2254+
@Override
2255+
public double[] getProperties_Leachman(String hydrogenType) {
2256+
neqsim.thermo.util.Leachman.NeqSimLeachman test =
2257+
new neqsim.thermo.util.Leachman.NeqSimLeachman(this, hydrogenType);
2258+
return test.propertiesLeachman();
2259+
}
2260+
2261+
2262+
/**
2263+
* Gets the Leachman properties of a phase using the default hydrogen type ('normal').
2264+
* This method prints a warning if no hydrogen type is specified.
2265+
*
2266+
* @return an array of properties of type double.
2267+
*/
2268+
public double[] getProperties_Leachman() {
2269+
// Warn the user and use the default hydrogen type
2270+
System.out.println("No hydrogen type specified. Using default type: 'normal'.");
2271+
return getProperties_Leachman("normal");
2272+
}
2273+
2274+
22312275
/** {@inheritDoc} */
22322276
@Override
22332277
public double getDensity_AGA8() {

src/main/java/neqsim/thermo/phase/PhaseInterface.java

+33
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,39 @@ public default void initPhysicalProperties(String name) {
419419
*/
420420
public double[] getProperties_GERG2008();
421421

422+
423+
/**
424+
* method to get Leachman density of a phase using the Leachman EoS.
425+
*
426+
* @return density with unit kg/m3
427+
*/
428+
public double getDensity_Leachman(String hydrogenType);
429+
430+
/**
431+
* Overloaded method to get the Leachman density with default hydrogen type ('normal').
432+
*
433+
* @return density with unit kg/m3
434+
*/
435+
public double getDensity_Leachman();
436+
437+
/**
438+
* <p>
439+
* method to get Leachman properties of a phase using the Leachman EoS.
440+
* </p>
441+
*
442+
* @return an array of type double
443+
*/
444+
445+
public double[] getProperties_Leachman(String hydrogenType);
446+
447+
/**
448+
* Overloaded method to get the Leachman properties with default hydrogen type ('normal').
449+
*
450+
* @return density with unit kg/m3
451+
*/
452+
453+
public double[] getProperties_Leachman();
454+
422455
/**
423456
* method to get density of a phase note: does not use Peneloux volume correction.
424457
*

0 commit comments

Comments
 (0)