Skip to content

Add process safety functionality#1614

Merged
EvenSol merged 25 commits intoequinor:masterfrom
EvenSol:master
Nov 1, 2025
Merged

Add process safety functionality#1614
EvenSol merged 25 commits intoequinor:masterfrom
EvenSol:master

Conversation

@EvenSol
Copy link
Copy Markdown
Collaborator

@EvenSol EvenSol commented Nov 1, 2025

No description provided.

@EvenSol EvenSol marked this pull request as ready for review November 1, 2025 09:31
@EvenSol EvenSol requested a review from Copilot November 1, 2025 09:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces a comprehensive process safety analysis framework with mechanical design validation, scenario-based safety reporting, and enhanced safety valve sizing capabilities. The changes add support for CSV-based design data loading, multi-scenario relief valve calculations, and disposal network analysis for flare systems.

Reviewed Changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/test/resources/design_limits_test.csv Test data file for mechanical design limits
src/test/java/.../ProcessSafetyReportBuilderTest.java Integration tests for safety report generation
src/test/java/.../ProcessSafetyAnalyzerTest.java Tests for safety scenario analyzer
src/test/java/.../MechanicalDesignDataSourceTest.java Tests for CSV design data loading
src/test/java/.../SafetyValveMechanicalDesignTest.java Enhanced tests for multi-scenario valve sizing
src/main/java/.../safety/* New safety analysis domain model and DTOs
src/main/java/.../mechanicaldesign/* Design limit validation and data source framework
src/main/java/.../valve/SafetyValveMechanicalDesign.java Multi-scenario valve sizing with strategy pattern
src/main/java/.../valve/SafetyValve.java Scenario management for relief valves
src/main/java/.../flare/Flare.java Radiation, dispersion, and capacity analysis

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

design.setMinOperationPressure(15.0);
design.setMaxOperationTemperature(360.0);
design.setMinOperationTemperature(265.0);
design.setCorrosionAllowanse(3.5);
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name 'setCorrosionAllowanse' contains a typo. It should be 'setCorrosionAllowance' (with 'ance' instead of 'anse'). This appears to be calling an existing misspelled method in the codebase.

Copilot uses AI. Check for mistakes.
design.setMinOperationPressure(7.0);
design.setMaxOperationTemperature(370.0);
design.setMinOperationTemperature(270.0);
design.setCorrosionAllowanse(6.5);
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name 'setCorrosionAllowanse' contains a typo. It should be 'setCorrosionAllowance' (with 'ance' instead of 'anse'). This appears to be calling an existing misspelled method in the codebase.

Copilot uses AI. Check for mistakes.
double referenceMassRate = inStream != null ? inStream.getFlowRate("kg/sec") : 0.0;
double standardVolumeRate = 0.0;
if (referenceMassRate > 1.0e-12) {
double refStdVolume = inStream.getFlowRate("Sm3/sec");
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable inStream may be null at this access as suggested by this null guard.
Variable inStream may be null at this access as suggested by this null guard.

Suggested change
double refStdVolume = inStream.getFlowRate("Sm3/sec");
double refStdVolume = (inStream != null) ? inStream.getFlowRate("Sm3/sec") : 0.0;

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 1, 2025

Codecov Report

❌ Patch coverage is 54.33125% with 659 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.35%. Comparing base (d3e8682) to head (5d7bf5d).

Files with missing lines Patch % Lines
...ain/java/neqsim/process/equipment/flare/Flare.java 16.86% 135 Missing and 3 partials ⚠️
...in/java/neqsim/process/safety/DisposalNetwork.java 3.84% 75 Missing ⚠️
...util/report/safety/ProcessSafetyReportBuilder.java 59.21% 43 Missing and 19 partials ⚠️
...esign/data/DatabaseMechanicalDesignDataSource.java 17.39% 34 Missing and 4 partials ⚠️
...a/neqsim/process/safety/ProcessSafetyScenario.java 64.21% 28 Missing and 6 partials ⚠️
...va/neqsim/process/equipment/valve/SafetyValve.java 65.97% 27 Missing and 6 partials ⚠️
...sim/process/mechanicaldesign/MechanicalDesign.java 68.13% 20 Missing and 9 partials ⚠️
...ocess/equipment/flare/dto/FlarePerformanceDTO.java 0.00% 25 Missing ⚠️
...rocess/util/report/safety/ProcessSafetyReport.java 82.22% 10 Missing and 14 partials ⚠️
.../process/equipment/flare/dto/FlareCapacityDTO.java 0.00% 22 Missing ⚠️
... and 18 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1614      +/-   ##
============================================
+ Coverage     47.17%   47.35%   +0.17%     
- Complexity     8917     9121     +204     
============================================
  Files           859      879      +20     
  Lines         84786    86204    +1418     
  Branches      10713    10875     +162     
============================================
+ Hits          39999    40823     +824     
- Misses        41810    42310     +500     
- Partials       2977     3071      +94     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@EvenSol EvenSol merged commit 4e32fcb into equinor:master Nov 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants