Class ThermodynamicSystemContract
java.lang.Object
neqsim.util.validation.contracts.ThermodynamicSystemContract
- All Implemented Interfaces:
ModuleContract<SystemInterface>
Contract for thermodynamic systems.
Defines requirements and guarantees for SystemInterface implementations. AI agents can
use this contract to validate fluid setup before running simulations.
Preconditions (what the system needs):
- At least one component defined
- Temperature > 0 K
- Pressure > 0 bar
- Mixing rule set for multi-component systems
- Total moles > 0
Postconditions (what init() provides):
- Valid phase fractions (sum to 1.0)
- Finite compressibility factor
- Finite enthalpy and entropy
- Version:
- 1.0
- Author:
- NeqSim
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThermodynamicSystemContractSingleton instance.private static final doubleMinimum valid pressure in bar.private static final doubleMinimum valid temperature in Kelvin. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckPostconditions(SystemInterface system) Check postconditions after execution.checkPreconditions(SystemInterface system) Check preconditions before execution.Get the name of this contract.static ThermodynamicSystemContractGet the singleton instance.Get a description of what this module provides.Get a description of what this module requires.
-
Field Details
-
INSTANCE
Singleton instance. -
MIN_TEMPERATURE_K
private static final double MIN_TEMPERATURE_KMinimum valid temperature in Kelvin.- See Also:
-
MIN_PRESSURE_BAR
private static final double MIN_PRESSURE_BARMinimum valid pressure in bar.- See Also:
-
-
Constructor Details
-
ThermodynamicSystemContract
private ThermodynamicSystemContract()
-
-
Method Details
-
getInstance
Get the singleton instance.- Returns:
- contract instance
-
getContractName
Description copied from interface:ModuleContractGet the name of this contract.- Specified by:
getContractNamein interfaceModuleContract<SystemInterface>- Returns:
- contract name for logging/debugging
-
checkPreconditions
Description copied from interface:ModuleContractCheck preconditions before execution.Validates that all requirements are met before running the module.
- Specified by:
checkPreconditionsin interfaceModuleContract<SystemInterface>- Parameters:
system- object to validate- Returns:
- validation result with any precondition failures
-
checkPostconditions
Description copied from interface:ModuleContractCheck postconditions after execution.Validates that the module produced valid output.
- Specified by:
checkPostconditionsin interfaceModuleContract<SystemInterface>- Parameters:
system- object to validate- Returns:
- validation result with any postcondition failures
-
getRequirementsDescription
Description copied from interface:ModuleContractGet a description of what this module requires.AI agents can use this to understand setup requirements.
- Specified by:
getRequirementsDescriptionin interfaceModuleContract<SystemInterface>- Returns:
- human-readable requirements description
-
getProvidesDescription
Description copied from interface:ModuleContractGet a description of what this module provides.AI agents can use this to understand available outputs.
- Specified by:
getProvidesDescriptionin interfaceModuleContract<SystemInterface>- Returns:
- human-readable outputs description
-