From f2aa23106c1334f2c80f448f14d5be495ac3bb64 Mon Sep 17 00:00:00 2001 From: Gustavo Paim Berned Date: Tue, 3 Dec 2024 14:49:17 -0300 Subject: [PATCH] Add FluidMaterialConvectionCorrelation Add a new transfer mechanism for fluid materials composed by a parcel of radiation and convection. ASIM-5943 --- CHANGELOG.rst | 1 + .../alfacase_definitions/PhysicsDescription.txt | 2 ++ src/alfasim_sdk/__init__.py | 2 ++ .../_internal/alfacase/case_description.py | 3 ++- src/alfasim_sdk/_internal/alfacase/schema.py | 3 ++- src/alfasim_sdk/_internal/constants.py | 11 +++++++++++ ...case_description_docstring_PhysicsDescription_.txt | 2 ++ .../test_generate_schema_for_all_cases.txt | 1 + 8 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c8bb3b19..303c626c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,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. 2024.2 (2024-09-10) diff --git a/docs/source/alfacase_definitions/PhysicsDescription.txt b/docs/source/alfacase_definitions/PhysicsDescription.txt index eb0d83d0..7ca2a7cd 100644 --- a/docs/source/alfacase_definitions/PhysicsDescription.txt +++ b/docs/source/alfacase_definitions/PhysicsDescription.txt @@ -25,6 +25,7 @@ emulsion_inversion_water_cut: \ :class:`Scalar `\ = Scalar(0.4, 'm3/m3', 'volume per volume') flash_model: \ :class:`FlashModel `\ = FlashModel.HydrocarbonAndWater correlations_package: \ :class:`CorrelationPackageType `\ = CorrelationPackageType.Classical + fluid_material_convection_correlation: \ :class:`FluidMaterialConvectionCorrelation `\ = FluidMaterialConvectionCorrelation.HasanKabir1994 .. tab:: Schema @@ -70,3 +71,4 @@ unit: string flash_model: \ :class:`FlashModel `\ # optional correlations_package: \ :class:`CorrelationPackageType `\ # optional + fluid_material_convection_correlation: \ :class:`FluidMaterialConvectionCorrelation `\ # optional diff --git a/src/alfasim_sdk/__init__.py b/src/alfasim_sdk/__init__.py index 54d5249d..21a9815f 100644 --- a/src/alfasim_sdk/__init__.py +++ b/src/alfasim_sdk/__init__.py @@ -295,6 +295,7 @@ def get_alfasim_sdk_api_path(): from alfasim_sdk._internal.constants import WellConnectionPort from alfasim_sdk._internal.constants import WellIndexPhaseType from alfasim_sdk._internal.constants import ForchheimerCoefficientsOption +from alfasim_sdk._internal.constants import FluidMaterialConvectionCorrelation # Plugins: Layouts imports @@ -404,6 +405,7 @@ def get_alfasim_sdk_api_path(): "FlashModel", "FlowDirection", "FlowPatternModel", + "FluidMaterialConvectionCorrelation", "ForchheimerIPRDescription", "ForchheimerCoefficientsOption", "CompositionalFluidDescription", diff --git a/src/alfasim_sdk/_internal/alfacase/case_description.py b/src/alfasim_sdk/_internal/alfacase/case_description.py index 8fbaa204..72e3149a 100644 --- a/src/alfasim_sdk/_internal/alfacase/case_description.py +++ b/src/alfasim_sdk/_internal/alfacase/case_description.py @@ -38,6 +38,7 @@ from .case_description_attributes import PhaseName from alfasim_sdk._internal import constants + # [[[cog # # This cog has no output, it just declares and imports symbols used by cogs in this module. # @@ -3358,7 +3359,7 @@ class PhysicsDescription: correlations_package = attrib_enum( default=constants.CorrelationPackageType.Classical ) - + fluid_material_convection_correlation = attrib_enum(default=constants.FluidMaterialConvectionCorrelation.HasanKabir1994) @attr.s() class TimeOptionsDescription: diff --git a/src/alfasim_sdk/_internal/alfacase/schema.py b/src/alfasim_sdk/_internal/alfacase/schema.py index d7020799..0fb92b56 100644 --- a/src/alfasim_sdk/_internal/alfacase/schema.py +++ b/src/alfasim_sdk/_internal/alfacase/schema.py @@ -443,6 +443,7 @@ Optional("emulsion_inversion_water_cut"): Map({"value": Float(), "unit": Str()}), Optional("flash_model"): Enum(['hydrocarbon_only', 'hydrocarbon_and_water']), Optional("correlations_package"): Enum(['correlation_package_classical', 'correlation_package_alfasim', 'correlation_package_isdb_tests']), + Optional("fluid_material_convection_correlation"): Enum(['Hasan and Kabir 1994', 'Hasan and Kabir 2002', 'Fuzong Zhou 2013', 'Holman 1981']), } ) pig_equipment_description_schema = Map( @@ -1198,4 +1199,4 @@ Optional("walls"): Seq(wall_description_schema), } ) -# [[[end]]] (checksum: c3e9dda5b6b211c66aef5f5b6f7ab550) +# [[[end]]] (checksum: 491e5442b3beadcbf3ad91c5ca5d52e1) diff --git a/src/alfasim_sdk/_internal/constants.py b/src/alfasim_sdk/_internal/constants.py index ceec5ba0..c6dd64a1 100644 --- a/src/alfasim_sdk/_internal/constants.py +++ b/src/alfasim_sdk/_internal/constants.py @@ -539,3 +539,14 @@ class ForchheimerCoefficientsOption(Enum): ReservoirParameters = "reservoir_parameters" FlowCoefficients = "flow_coefficients" + +class FluidMaterialConvectionCorrelation(Enum): + """ + The heat transfer mechanism for fluid materials composed by a parcel of radiation and + convection. + """ + + HasanKabir1994 = "Hasan and Kabir 1994" + HasanKabir2002 = "Hasan and Kabir 2002" + FuzongZhou2013 = "Fuzong Zhou 2013" + Holman1981 = "Holman 1981" diff --git a/tests/alfacase/test_generate_case_description_docstring/test_generate_case_description_docstring_PhysicsDescription_.txt b/tests/alfacase/test_generate_case_description_docstring/test_generate_case_description_docstring_PhysicsDescription_.txt index eb0d83d0..7ca2a7cd 100644 --- a/tests/alfacase/test_generate_case_description_docstring/test_generate_case_description_docstring_PhysicsDescription_.txt +++ b/tests/alfacase/test_generate_case_description_docstring/test_generate_case_description_docstring_PhysicsDescription_.txt @@ -25,6 +25,7 @@ emulsion_inversion_water_cut: \ :class:`Scalar `\ = Scalar(0.4, 'm3/m3', 'volume per volume') flash_model: \ :class:`FlashModel `\ = FlashModel.HydrocarbonAndWater correlations_package: \ :class:`CorrelationPackageType `\ = CorrelationPackageType.Classical + fluid_material_convection_correlation: \ :class:`FluidMaterialConvectionCorrelation `\ = FluidMaterialConvectionCorrelation.HasanKabir1994 .. tab:: Schema @@ -70,3 +71,4 @@ unit: string flash_model: \ :class:`FlashModel `\ # optional correlations_package: \ :class:`CorrelationPackageType `\ # optional + fluid_material_convection_correlation: \ :class:`FluidMaterialConvectionCorrelation `\ # optional diff --git a/tests/alfacase/test_generate_case_schema/test_generate_schema_for_all_cases.txt b/tests/alfacase/test_generate_case_schema/test_generate_schema_for_all_cases.txt index a5383ff9..ecc551c1 100644 --- a/tests/alfacase/test_generate_case_schema/test_generate_schema_for_all_cases.txt +++ b/tests/alfacase/test_generate_case_schema/test_generate_schema_for_all_cases.txt @@ -458,6 +458,7 @@ physics_description_schema = Map( Optional("emulsion_inversion_water_cut"): Map({"value": Float(), "unit": Str()}), Optional("flash_model"): Enum(['hydrocarbon_only', 'hydrocarbon_and_water']), Optional("correlations_package"): Enum(['correlation_package_classical', 'correlation_package_alfasim', 'correlation_package_isdb_tests']), + Optional("fluid_material_convection_correlation"): Enum(['Hasan and Kabir 1994', 'Hasan and Kabir 2002', 'Fuzong Zhou 2013', 'Holman 1981']), } )