-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ad9d91
commit b3adc86
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...test/java/neqsim/fluidMechanics/flowSystem/twoPhaseFlowSystem/shipSystem/LNGshipTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package neqsim.fluidMechanics.flowSystem.twoPhaseFlowSystem.shipSystem; | ||
|
||
import neqsim.thermo.system.SystemInterface; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class LNGshipTest { | ||
|
||
LNGship testShip; | ||
SystemInterface testSystem; | ||
@BeforeEach | ||
void setUp() { | ||
testSystem = new neqsim.thermo.system.SystemSrkEos(100, 1.0); | ||
testSystem.addComponent("methane", 0.9); | ||
testSystem.addComponent("nitrogen", 0.1); | ||
testSystem.init(0); | ||
|
||
testShip = new LNGship(testSystem, 1_000_000, 0.01); | ||
} | ||
|
||
@Test | ||
void createSystem() { | ||
assertEquals(0.7, testShip.getLiquidDensity()); | ||
assertEquals(0.0, testShip.dailyBoilOffVolume); | ||
assertEquals(0.0, testShip.initialNumberOffMoles); | ||
testShip.createSystem(); | ||
assertEquals(474.3293447569919, testShip.getLiquidDensity()); | ||
assertEquals(10_000.0, testShip.dailyBoilOffVolume); | ||
assertEquals(2.7513223265419292E10, testShip.initialNumberOffMoles); | ||
|
||
} | ||
|
||
@Test | ||
public void testSolveSteadyState() { | ||
assertEquals(-173.15, testShip.getThermoSystem().getTemperature("C"), 1e-2); | ||
testShip.createSystem(); | ||
testShip.solveSteadyState(1, null); | ||
assertEquals(-176.43, testShip.getThermoSystem().getTemperature("C"), 1e-2); | ||
assertEquals(testSystem.getPhase("oil").getComponent("nitrogen").getx(), testShip.getThermoSystem().getPhase("oil").getComponent("nitrogen").getx(), 1e-4); | ||
assertEquals(testSystem.getPhase("oil").getComponent("methane").getx(), testShip.getThermoSystem().getPhase("oil").getComponent("methane").getx(), 1e-4); | ||
} | ||
|
||
@Test | ||
void solveTransient() { | ||
assertNull(testShip.volume); | ||
assertEquals(0.0, testShip.endVolume); | ||
assertEquals(1_000_000, testShip.totalTankVolume); // Initial cargo volume | ||
|
||
testShip.createSystem(); | ||
testShip.solveSteadyState(0, null); | ||
testShip.solveTransient(0, null); | ||
|
||
|
||
assertEquals(testShip.numberOffTimeSteps, testShip.tankTemperature.length); // Check that the results have correct length | ||
assertEquals(600_000.0, testShip.endVolume); | ||
} | ||
} |