{ "cells": [ { "cell_type": "markdown", "id": "aececd27", "metadata": { "papermill": { "duration": 0.004945, "end_time": "2026-03-19T15:07:14.927111", "exception": false, "start_time": "2026-03-19T15:07:14.922166", "status": "completed" }, "tags": [] }, "source": [ "(hydraulic distribution function example)=\n", "# Hydraulic Distribution Functions Script Examples" ] }, { "cell_type": "markdown", "id": "8f03602b", "metadata": { "papermill": { "duration": 0.001379, "end_time": "2026-03-19T15:07:14.930037", "exception": false, "start_time": "2026-03-19T15:07:14.928658", "status": "completed" }, "tags": [] }, "source": [ "Download the [HydroDistribution.fez](https://github.com/Rocscience/rs2-scripting/blob/main/docs/example_code/example_models/HydroDistribution.fez) for this example." ] }, { "cell_type": "code", "execution_count": 1, "id": "efd68734", "metadata": { "execution": { "iopub.execute_input": "2026-03-19T15:07:14.934401Z", "iopub.status.busy": "2026-03-19T15:07:14.934122Z", "iopub.status.idle": "2026-03-19T15:07:59.612577Z", "shell.execute_reply": "2026-03-19T15:07:59.610404Z" }, "papermill": { "duration": 44.683062, "end_time": "2026-03-19T15:07:59.614163", "exception": false, "start_time": "2026-03-19T15:07:14.931101", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example Function 1\n", "[[0.1, 0.2], [0.3, 0.4], [0.5, 0.6]]\n", "The current function name of HydraulicVariableTypes.KS_FUNCTION is Function 1 New Name\n", "The stage hydraulic distribution of HydraulicVariableTypes.KS_FUNCTION at stage 1 is HydraulicDistributionTypes.MEAN_STRESS_DISTRIBUTION\n", "The stage hydraulic distribution function of HydraulicVariableTypes.KS_FUNCTION at stage 1 is Function 1 New Name\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "Stage 1 Results\n", "\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_HORIZONTAL_PERMEABILITY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.2\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.2\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_VERTICAL_PERMEABILITY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.2\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.2\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_PERM\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.2\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.2\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_WC\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.4\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.4\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.39999999999999997\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_WC_RES\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_CONDY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 1.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 1.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1.0\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_ANGLE\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.0\n", "\n", "\n", "Stage 2 Results\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_HORIZONTAL_PERMEABILITY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_VERTICAL_PERMEABILITY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_PERM\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_WC\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.4\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.4\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.39999999999999997\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_WC_RES\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.0\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_CONDY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 1.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 1.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1.0\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_ANGLE\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.0\n", "\n", "\n", "Stage 3 Results\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_HORIZONTAL_PERMEABILITY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_VERTICAL_PERMEABILITY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_PERM\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_WC\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.4\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.4\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.39999999999999997\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_WC_RES\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_CONDY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 1.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 1.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1.0\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_ANGLE\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.0\n", "\n", "\n", "Stage 4 Results\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_HORIZONTAL_PERMEABILITY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_VERTICAL_PERMEABILITY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_PERM\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.6\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1e-07\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_WC\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.4\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.4\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.39999999999999997\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_WC_RES\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.0\n", "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_CONDY\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 1.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 1.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 1.0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Seepage Result Type = ExportResultType.SEEPAGE_SPATIAL_ANGLE\n", "==============================================================================\n", "\n", "Query Unique ID = {4169D56D-6607-4a2c-8C48-B910EAECE202}, MaterialID = 1\n", "------------------------------------------------------------------------------\n", "X-Coord =-2.0, Y-Coordinate = -1.5, Distance = 0.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = -1.5, Distance = 5.0, Result Type Node Value = 0.0\n", "X-Coord =3.0, Y-Coordinate = 2.0, Distance = 8.5, Result Type Node Value = 0.0\n", "The current hydraulic distribution of HydraulicVariableTypes.KS_FUNCTION is HydraulicDistributionTypes.CONSTANT_DISTRIBUTION\n", "The current hydraulic distribution value of HydraulicVariableTypes.KS_FUNCTION is 0.1\n" ] } ], "source": [ "from rs2.modeler import properties\n", "from rs2.modeler.properties.PropertyEnums import *\n", "from rs2.modeler.RS2Modeler import RS2Modeler\n", "from rs2.modeler.properties import *\n", "from rs2.interpreter.RS2Interpreter import RS2Interpreter\n", "from rs2.interpreter.InterpreterEnums import *\n", "import os\n", "\n", "current_dir = os.path.dirname(os.path.abspath(\"\")) \n", "\n", "RS2Modeler.startApplication(port=60093)\n", "modeler = RS2Modeler(port=60093)\n", "model_path = rf\"{current_dir}\\example_models\\HydroDistribution.fez\"\n", "modeler_model = modeler.openFile(model_path)\n", "\n", "material = modeler_model.getMaterialPropertyByName(\"Dense Sand\")\n", "\n", "function_name_1 = \"Example Function 1\"\n", "function_name_2 = \"Function 1 New Name\"\n", "\n", "variable_type = HydraulicVariableTypes.KS_FUNCTION\n", "distribution_type = HydraulicDistributionTypes.MEAN_STRESS_DISTRIBUTION\n", "\n", "modeler_model.createNewHydroDistributionFunction(variable_type, distribution_type, function_name_1)\n", "function1 = modeler_model.getHydroDistributionFunctionByName(variable_type, distribution_type, function_name_1)\n", "point_ks1 = [[0.1, 0.2], [0.3, 0.4], [0.5, 0.6]]\n", "function1.setPointsParameter(point_ks1)\n", "print(function_name_1)\n", "current_points = function1.getPointsParameter()\n", "print(current_points)\n", "\n", "hydroDistribution = material.Hydraulic.HydroDistribution\n", "hydroDistribution.setHydroDistribution(variable_type, distribution_type, function_name_1)\n", "modeler_model.renameHydroDistributionFunction(variable_type, distribution_type, function_name_1, function_name_2)\n", "current_function_name = hydroDistribution.getHydroDistributionFunctionName(variable_type)\n", "print(f\"The current function name of {variable_type} is {current_function_name}\")\n", "\n", "material.StageFactors.setStageHydraulicStageFactor(True)\n", "material.StageFactors.setStageHydroDistributionStageFactor(True)\n", "\n", "stage_1 = 1\n", "definedStageFactors = material.StageFactors.getDefinedStageFactors()\n", "newStageFactor_1 = material.StageFactors.createStageFactor(stage_1)\n", "definedStageFactors[stage_1] = newStageFactor_1\n", "material.StageFactors.setDefinedStageFactors(definedStageFactors)\n", "\n", "hydroDistributionGroundwaterStageFactor_1 = material.Hydraulic.HydroDistribution.stageFactorInterface.getDefinedStageFactors()[stage_1]\n", "hydroDistributionGroundwaterStageFactor_1.setHydroDistributionStagedFunction(variable_type, distribution_type, function_name_2)\n", "hydroDistributionProp = hydroDistributionGroundwaterStageFactor_1.getHydroDistributionStagedFunction(variable_type)\n", "print(f\"The stage hydraulic distribution of {variable_type} at stage {stage_1} is {hydroDistributionProp.distribution_type}\")\n", "print(f\"The stage hydraulic distribution function of {variable_type} at stage {stage_1} is {hydroDistributionProp.function_name}\")\n", "\n", "modeler_model.save()\n", "modeler_model.compute()\n", "\n", "\n", "RS2Interpreter.startApplication(port=60094)\n", "interpreter = RS2Interpreter(port=60094)\n", "interpreter_model = interpreter.openFile(model_path)\n", "\n", "points_making_line = [[-2, -1.5], [3, -1.5], [3, 2]]\n", "lineID = interpreter_model.AddMaterialQuery(points=points_making_line)\n", "\n", "seepageTypes = [ExportResultType.SEEPAGE_HORIZONTAL_PERMEABILITY,\n", " ExportResultType.SEEPAGE_VERTICAL_PERMEABILITY,\n", " ExportResultType.SEEPAGE_SPATIAL_PERM,\n", " ExportResultType.SEEPAGE_SPATIAL_WC,\n", " ExportResultType.SEEPAGE_SPATIAL_WC_RES,\n", " ExportResultType.SEEPAGE_SPATIAL_CONDY,\n", " ExportResultType.SEEPAGE_SPATIAL_ANGLE,\n", " ]\n", "\n", "first_stage = 1\n", "last_stage = 4\n", "\n", "for stageNum in range(first_stage, last_stage + 1):\n", " print(f\"\\n\\nStage {stageNum} Results\\n\")\n", " interpreter_model.SetActiveStage(stageNum)\n", "\n", " for seepageType in seepageTypes:\n", " interpreter_model.SetResultType(seepageType)\n", " results = interpreter_model.GetMaterialQueryResults()\n", " mat_query_data = results[0]\n", " print(f\"\\nSeepage Result Type = {seepageType}\")\n", " print(\"==============================================================================\")\n", " unique_ID = mat_query_data.GetUniqueIdentifier()\n", " material_ID = mat_query_data.GetMaterialID()\n", " print(f\"\\nQuery Unique ID = {unique_ID}, MaterialID = {material_ID}\")\n", " print(\"------------------------------------------------------------------------------\")\n", " query_results = mat_query_data.GetAllValues()\n", " for result in query_results:\n", " x = result.GetXCoordinate()\n", " y = result.GetYCoordinate()\n", " distance = result.GetDistance()\n", " value = result.GetValue()\n", " print(f\"X-Coord ={x}, Y-Coordinate = {y}, Distance = {distance}, Result Type Node Value = {value}\")\n", "\n", "\n", "constant_val = 0.1\n", "constant_distribution_type = HydraulicDistributionTypes.CONSTANT_DISTRIBUTION\n", "hydroDistribution.setHydroDistribution(variable_type, constant_distribution_type, constant_val)\n", "current_distribution = hydroDistribution.getHydroDistribution(variable_type)\n", "current_val = hydroDistribution.getHydroDistributionConstantVal(variable_type)\n", "print(f\"The current hydraulic distribution of {variable_type} is {current_distribution}\")\n", "print(f\"The current hydraulic distribution value of {variable_type} is {current_val}\")\n", "\n", "modeler_model.deleteHydroDistributionFunction(variable_type, distribution_type, function_name_2)\n", "modeler_model.save()\n", "\n", "modeler_model.close()\n", "interpreter_model.close()\n", "modeler.closeProgram()\n", "interpreter.closeProgram()" ] } ], "metadata": { "kernelspec": { "display_name": "myenv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.0" }, "papermill": { "default_parameters": {}, "duration": 46.333977, "end_time": "2026-03-19T15:07:59.967351", "environment_variables": {}, "exception": null, "input_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\hydraulic\\hydraulic_distribution_functions_script_examples.ipynb", "output_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\hydraulic\\hydraulic_distribution_functions_script_examples.ipynb", "parameters": {}, "start_time": "2026-03-19T15:07:13.633374", "version": "2.6.0" } }, "nbformat": 4, "nbformat_minor": 5 }