diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a5a0e6c7..36d8ad28 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,7 +8,7 @@ CHANGELOG * We have decided internally to revert the versioning schema back to SemVer, starting at ``1.0.0``, in order to improve better backward and forward compatibility support for plugins. * Fix bug related to Probabilistic History Matching result reader. The shape of result was wrong. * Add the heat transfer mechanism for fluid materials composed by a parcel of radiation and convection. -* Add the PvtModelConstantPropertiesDescription: This model is used to define the PVT properties of the fluid as a table with constant values. +* Add the PvtModelConstantPropertiesDescription: This model is used to define the PVT properties of the fluid as a table with constant values. * Changed the constructor of result metadata objects in ``alfasim_sdk.result_reader.aggregator`` from ``attr`` to ``dataclasses.dataclass`` to make then more easily integrated into the (de)serialization engine of popular packages such as ``pyserde`` and ``pydantic``. * Changed function ``read_global_sensitivity_coefficients`` and ``read_uncertainty_propagation_results`` to accept multiple keys so it can perform bulk reads without having to open the result file every time. * Added ``GlobalSensitivityAnalysisResults``, ``HistoryMatchingDeterministicResults``, ``HistoryMatchingProbabilisticResults`` and ``UncertaintyPropagationResults``, which are objects to read and interact with the Uncertainty Quantification analyses results in a more user-friendly way. diff --git a/src/alfasim_sdk/_internal/alfacase/case_description.py b/src/alfasim_sdk/_internal/alfacase/case_description.py index b5922c5c..6844268a 100644 --- a/src/alfasim_sdk/_internal/alfacase/case_description.py +++ b/src/alfasim_sdk/_internal/alfacase/case_description.py @@ -2372,13 +2372,13 @@ class PvtModelConstantPropertiesDescription: :ivar gas_water_surface_tension: default: Scalar(7.197e-2, "N/m") - :ivar oil_water_surface_tension: + :ivar oil_water_surface_tension: default: Scalar(7.197e-2, "N/m") :ivar gas_specific_enthalpy: default: Scalar(2.260e6, "J/kg") - :ivar oil_specific_enthalpy: + :ivar oil_specific_enthalpy: default: Scalar(104.86e3, "J/kg") .. include:: /alfacase_definitions/PvtModelConstantPropertiesDescription.txt @@ -2391,24 +2391,23 @@ class PvtModelConstantPropertiesDescription: .. include:: /alfacase_definitions/list_of_unit_for_specific_energy.txt """ - gas_density = attrib_scalar(default=Scalar(1.0, 'kg/m3')) - oil_density = attrib_scalar(default=Scalar(1000.0, 'kg/m3')) - water_density = attrib_scalar(default=Scalar(1000.0, 'kg/m3')) - gas_viscosity = attrib_scalar(default=Scalar(5e-6, 'Pa.s')) - oil_viscosity = attrib_scalar(default=Scalar(5e-2, 'Pa.s')) - water_viscosity = attrib_scalar(default=Scalar(5e-2, 'Pa.s')) - gas_specific_heat = attrib_scalar(default=Scalar(1010.0, 'J/kg.K')) - oil_specific_heat = attrib_scalar(default=Scalar(4181.3, 'J/kg.K')) - water_specific_heat = attrib_scalar(default=Scalar(4181.3, 'J/kg.K')) - gas_thermal_conductivity = attrib_scalar(default=Scalar(2.4e-2, 'W/m.K')) - oil_thermal_conductivity = attrib_scalar(default=Scalar(5.91e-1, 'W/m.K')) - water_thermal_conductivity = attrib_scalar(default=Scalar(5.91e-1, 'W/m.K')) - gas_oil_surface_tension = attrib_scalar(default=Scalar(7.197e-2, 'N/m')) - gas_water_surface_tension = attrib_scalar(default=Scalar(7.197e-2, 'N/m')) - oil_water_surface_tension = attrib_scalar(default=Scalar(7.197e-2, 'N/m')) - gas_specific_enthalpy = attrib_scalar(default=Scalar(2.260e6, 'J/kg')) - oil_specific_enthalpy = attrib_scalar(default=Scalar(104.86e3, 'J/kg')) - + gas_density = attrib_scalar(default=Scalar(1.0, "kg/m3")) + oil_density = attrib_scalar(default=Scalar(1000.0, "kg/m3")) + water_density = attrib_scalar(default=Scalar(1000.0, "kg/m3")) + gas_viscosity = attrib_scalar(default=Scalar(5e-6, "Pa.s")) + oil_viscosity = attrib_scalar(default=Scalar(5e-2, "Pa.s")) + water_viscosity = attrib_scalar(default=Scalar(5e-2, "Pa.s")) + gas_specific_heat = attrib_scalar(default=Scalar(1010.0, "J/kg.K")) + oil_specific_heat = attrib_scalar(default=Scalar(4181.3, "J/kg.K")) + water_specific_heat = attrib_scalar(default=Scalar(4181.3, "J/kg.K")) + gas_thermal_conductivity = attrib_scalar(default=Scalar(2.4e-2, "W/m.K")) + oil_thermal_conductivity = attrib_scalar(default=Scalar(5.91e-1, "W/m.K")) + water_thermal_conductivity = attrib_scalar(default=Scalar(5.91e-1, "W/m.K")) + gas_oil_surface_tension = attrib_scalar(default=Scalar(7.197e-2, "N/m")) + gas_water_surface_tension = attrib_scalar(default=Scalar(7.197e-2, "N/m")) + oil_water_surface_tension = attrib_scalar(default=Scalar(7.197e-2, "N/m")) + gas_specific_enthalpy = attrib_scalar(default=Scalar(2.260e6, "J/kg")) + oil_specific_enthalpy = attrib_scalar(default=Scalar(104.86e3, "J/kg")) has_water: bool = attr.ib(default=False) @@ -2652,10 +2651,10 @@ def ideal_gas_density_derivative_respect_pressure_const_temperature(p, t): def ideal_gas_density_derivative_respect_temperature_const_pressure(p, t): return -p / (r * t**2) - + def constant_gas_density_model(p, t): return rho_g_ref + 0 * p - + def constant_gas_density_derivative_respect_pressure_const_temperature(p, t): return 0 * p @@ -2739,14 +2738,22 @@ def oil_water_surface_tension_model(p, t): if ideal_gas: data = [ ideal_gas_density_model(p, t).flatten(), - ideal_gas_density_derivative_respect_pressure_const_temperature(p, t).flatten(), - ideal_gas_density_derivative_respect_temperature_const_pressure(p, t).flatten(), + ideal_gas_density_derivative_respect_pressure_const_temperature( + p, t + ).flatten(), + ideal_gas_density_derivative_respect_temperature_const_pressure( + p, t + ).flatten(), ] else: data = [ constant_gas_density_model(p, t).flatten(), - constant_gas_density_derivative_respect_pressure_const_temperature(p, t).flatten(), - constant_gas_density_derivative_respect_temperature_const_pressure(p, t).flatten(), + constant_gas_density_derivative_respect_pressure_const_temperature( + p, t + ).flatten(), + constant_gas_density_derivative_respect_temperature_const_pressure( + p, t + ).flatten(), ] data += [ diff --git a/tests/common_testing/alfasim_sdk_common_testing/filled_case_descriptions.py b/tests/common_testing/alfasim_sdk_common_testing/filled_case_descriptions.py index 89be00b6..47ac3a93 100644 --- a/tests/common_testing/alfasim_sdk_common_testing/filled_case_descriptions.py +++ b/tests/common_testing/alfasim_sdk_common_testing/filled_case_descriptions.py @@ -89,7 +89,9 @@ has_water=True ) ) -PVT_MODEL_CONST_TABLE_DEFINITION = case_description.PvtModelConstantPropertiesDescription() +PVT_MODEL_CONST_TABLE_DEFINITION = ( + case_description.PvtModelConstantPropertiesDescription() +) PVT_MODELS_DEFINITION = case_description.PvtModelsDescription( default_model="acme", compositional={