Skip to content
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
2 changes: 1 addition & 1 deletion .github/RELEASE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ conda install -c conda-forge neqsim=<version>
Requirements:

- Python 3.9 or newer.
- Java 8 or newer for pip installs.
- Java 11 or newer for pip installs.
- Conda installs include OpenJDK through conda-forge.

Verify the installed package version without starting the JVM:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/generate-stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
# Run when JAR files are updated
push:
paths:
- 'src/neqsim/lib/**/*.jar'
- 'src/neqsim/lib/*.jar'
# Run on release
release:
types: [published]
Expand All @@ -16,18 +16,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'

- name: Set up Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'

- name: Install dependencies
run: |
Expand All @@ -39,7 +39,7 @@ jobs:
poetry run python scripts/generate_stubs.py

- name: Commit updated stubs
uses: stefanzweifel/git-auto-commit-action@v5
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "chore: regenerate Java stubs"
file_pattern: "src/jneqsim-stubs/**"
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
python-version: "3.13"
- uses: pre-commit/action@v3.0.1
- uses: pre-commit-ci/lite-action@v1.1.0
if: always()
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Install poetry
run: pipx install poetry

- name: Setup python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.11
python-version: 3.13

- name: Install dependencies
run: poetry install --no-interaction
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
version: [3.9, 3.12, 3.13]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7

- name: Install poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.version }}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ It provides Python toolboxes such as [thermoTools](https://github.com/equinor/ne
### Install

<table>
<tr><td><strong>pip</strong> (requires Java 8+)</td><td><strong>conda</strong> (Java included)</td></tr>
<tr><td><strong>pip</strong> (requires Java 11+)</td><td><strong>conda</strong> (Java included)</td></tr>
<tr>
<td>

Expand All @@ -65,7 +65,7 @@ conda install -c conda-forge neqsim
</tr>
</table>

> **Prerequisites:** Python 3.9+ and Java 8+. The conda package automatically installs OpenJDK — no separate Java setup needed. For pip, install Java from [Adoptium](https://adoptium.net/).
> **Prerequisites:** Python 3.9+ and Java 11+. The conda package automatically installs OpenJDK — no separate Java setup needed. For pip, install Java from [Adoptium](https://adoptium.net/).

### Try it now

Expand Down
2 changes: 1 addition & 1 deletion docs/release-notes/v3.10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ printFrame(natural_gas)
- Documentation: https://equinor.github.io/neqsimhome/
- Python examples: https://github.com/equinor/neqsim-python/tree/master/examples
- Java engine: https://github.com/equinor/neqsim
- Discussions: https://github.com/equinor/neqsim/discussions
- Discussions: https://github.com/equinor/neqsim/discussions
2 changes: 1 addition & 1 deletion docs/release-notes/v3.11.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ printFrame(natural_gas)
- Documentation: https://equinor.github.io/neqsimhome/
- Python examples: https://github.com/equinor/neqsim-python/tree/master/examples
- Java engine: https://github.com/equinor/neqsim
- Discussions: https://github.com/equinor/neqsim/discussions
- Discussions: https://github.com/equinor/neqsim/discussions
12 changes: 8 additions & 4 deletions examples/equationOfState.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ def create_wet_gas(eos_name):
# =============================================================================
print("\n6. EOS-CG FOR CO2 AND COMBUSTION GASES")
print("-" * 40)
print("""
print(
"""
EOS-CG (Equation of State for Combustion Gases) is based on GERG-2008
but optimized for CO2-rich mixtures and combustion product gases.

Expand All @@ -224,7 +225,8 @@ def create_wet_gas(eos_name):
- Blue/green hydrogen with CO2

Components: CO2, N2, O2, Ar, H2O, CO, H2, H2S, SO2, CH4
""")
"""
)

# Create a typical flue gas / CCS mixture
print("Example: CO2-rich CCS mixture")
Expand Down Expand Up @@ -261,7 +263,8 @@ def create_wet_gas(eos_name):
# =============================================================================
print("\n7. GUIDELINES FOR EoS SELECTION")
print("-" * 40)
print("""
print(
"""
Application | Recommended EoS
-------------------------------------|----------------------
Natural gas properties | GERG-2008 (most accurate)
Expand All @@ -286,5 +289,6 @@ def create_wet_gas(eos_name):
Gas hydrates | CPA with hydrate model
|
Electrolyte solutions (brine) | Electrolyte-CPA
""")
"""
)
print("=" * 70)
6 changes: 4 additions & 2 deletions examples/flashCalculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@
print("\n" + "=" * 70)
print("FLASH CALCULATION SUMMARY")
print("=" * 70)
print("""
print(
"""
Flash Type | Given | Find | Application
-----------|----------------|----------------|---------------------------
TPflash | T, P | Phases, comp. | General equilibrium
Expand All @@ -198,5 +199,6 @@
TVflash | T, V | P, phases | Closed vessels
VHflash | V, H | T, P, phases | Adiabatic closed systems
VUflash | V, U | T, P, phases | Isolated systems
""")
"""
)
print("=" * 70)
6 changes: 4 additions & 2 deletions examples/fluidCreation.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@
# =============================================================================
print("\n9. COMMONLY USED COMPONENTS")
print("-" * 40)
print("""
print(
"""
Category | Component Names
-------------------|------------------------------------------------
Light gases | nitrogen, oxygen, argon, helium, hydrogen, H2S
Expand All @@ -287,7 +288,8 @@

Note: For components not in database, use addTBPfraction() or
addPlusFraction() with MW and density.
""")
"""
)

# =============================================================================
# 10. ELECTROLYTE FLUIDS
Expand Down
30 changes: 20 additions & 10 deletions examples/hydrateCalculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
# =============================================================================
print("\n1. INTRODUCTION TO GAS HYDRATES")
print("-" * 40)
print("""
print(
"""
Gas hydrates form when water and light gases (C1, C2, C3, CO2, H2S)
combine under high pressure and low temperature conditions.

Expand All @@ -43,7 +44,8 @@
- Temperature: Typically < 25°C
- Pressure: Typically > 10-20 bara
- Presence of free water
""")
"""
)

# =============================================================================
# 2. HYDRATE FORMATION TEMPERATURE
Expand Down Expand Up @@ -114,14 +116,16 @@
# =============================================================================
print("\n4. SUBCOOLING - HYDRATE RISK ASSESSMENT")
print("-" * 40)
print("""
print(
"""
Subcooling (ΔT) = Hydrate formation T - Operating T

Interpretation:
ΔT > 0: Operating BELOW hydrate T → HIGH RISK
ΔT = 0: At hydrate equilibrium → BORDERLINE
ΔT < 0: Operating ABOVE hydrate T → SAFE
""")
"""
)

# Example calculation
gas.setPressure(100.0, "bara")
Expand Down Expand Up @@ -224,7 +228,8 @@
# =============================================================================
print("\n7. INHIBITOR SELECTION GUIDELINES")
print("-" * 40)
print("""
print(
"""
┌─────────────────────────────────────────────────────────────────┐
│ Inhibitor Comparison │
├────────────┬──────────────────────────────────────────────────┐
Expand All @@ -251,14 +256,16 @@
│ │ ✗ Cannot be regenerated │
│ │ → Best for: Drilling fluids, completion ops │
└────────────┴──────────────────────────────────────────────────┘
""")
"""
)

# =============================================================================
# 8. KINETIC HYDRATE INHIBITORS (KHI)
# =============================================================================
print("\n8. KINETIC HYDRATE INHIBITORS (KHI)")
print("-" * 40)
print("""
print(
"""
Unlike thermodynamic inhibitors (MEG, MeOH) that shift equilibrium,
KHIs work by slowing hydrate formation kinetics.

Expand All @@ -273,22 +280,25 @@

Note: NeqSim primarily calculates thermodynamic equilibrium.
KHI effects require separate kinetic models.
""")
"""
)

# =============================================================================
# 9. PRACTICAL EXAMPLE: PIPELINE HYDRATE ASSESSMENT
# =============================================================================
print("\n9. PRACTICAL EXAMPLE: PIPELINE HYDRATE ASSESSMENT")
print("-" * 40)

print("""
print(
"""
Scenario: Subsea pipeline from wellhead to platform
- Wellhead: 150 bara, 80°C
- Pipeline arrival: 80 bara, 5°C
- Gas is water-saturated

Question: Will hydrates form? How much MEG is needed?
""")
"""
)

# Check hydrate risk
pipeline_gas = fluid("cpa")
Expand Down
Loading
Loading