JUnit Test Overview
The NeqSim project contains an extensive JUnit 5 test suite. The tests are grouped by feature area under src/test/java/neqsim. The main groups are summarised below.
Thermodynamic operations
Directory: src/test/java/neqsim/thermodynamicoperations
Tests for the core thermodynamic calculation utilities. The flashops package verifies different flash calculations (TP, PH, PS etc.) while phaseenvelopeops checks phase envelope algorithms. Utilities and common operations are tested under util.
PVT simulations
Directory: src/test/java/neqsim/pvtsimulation/simulation
Covers simulation models used for PVT studies such as constant volume depletion, differential liberation and slim‑tube simulations. These tests ensure that the simulation workflow and calculated properties are consistent.
Process modelling
Directory: src/test/java/neqsim/process
Tests of the dynamic process models and process equipment. Examples include separator, compressor and process controller behaviour.
Compressor Test Files
| Test File | Description |
|---|---|
CompressorTest.java |
Core compressor calculations, polytropic method, efficiency |
CompressorChartTest.java |
Performance curve interpolation, surge/stone wall |
CompressorChartGeneratorTest.java |
Automatic curve generation from templates |
CompressorChartMWInterpolationTest.java |
Multi-map MW interpolation |
CompressorChartKhader2015Test.java |
Khader 2015 method with fan law scaling |
CompressorMechanicalLossesTest.java |
Seal gas consumption (API 692) and bearing losses (API 617) |
ASMEPTC10ValidationTest.java |
Validation against ASME PTC 10 standard |
CompressorDynamicSimulationTest.java |
Dynamic simulation, startup/shutdown profiles |
SafeSplineSurgeCurveTest.java |
Spline-based surge curve with safe extrapolation |
Physical properties and fluid mechanics
Directories:
src/test/java/neqsim/physicalpropertiessrc/test/java/neqsim/fluidmechanics
Focus on methods for viscosity, density and other property models together with flow system calculations.
Fluid Mechanics Test Files
| Test File | Description |
|---|---|
TwoPhasePipeFlowSystemTest.java |
System setup, steady-state solving, mass/heat transfer, model comparisons |
NonEquilibriumPipeFlowTest.java |
Non-equilibrium mass transfer, evaporation, dissolution, bidirectional transfer |
FlowPatternDetectorTest.java |
Flow pattern detection (Taitel-Dukler, Baker, Barnea, Beggs-Brill) |
InterfacialAreaCalculatorTest.java |
Interfacial area calculations for all flow patterns |
MassTransferCoefficientCalculatorTest.java |
Mass transfer coefficient correlations |
TwoPhasePipeFlowSystemBuilderTest.java |
Builder API tests |
Chemical reactions and thermo
Directories:
src/test/java/neqsim/chemicalreactionssrc/test/java/neqsim/thermo
Verify reaction models and the underlying thermodynamic phase implementations.
Utilities, statistics and standards
Directories:
src/test/java/neqsim/utilsrc/test/java/neqsim/statisticssrc/test/java/neqsim/standards
Contain unit tests for helper utilities (database connectors, units), statistical calculations and implementation of industry standards.
Running the tests
All tests can be executed with Maven:
mvn test
Use the Maven wrapper (./mvnw test) when Maven is not installed. To run a specific test class you can supply the class name:
mvn -Dtest=ClassName test
A code coverage report can be produced using Jacoco:
mvn jacoco:prepare-agent test install jacoco:report
The resulting report is written to target/site/jacoco/index.html.