From 21c9b30dc04a64f98aad314d0031ad29cb09fb68 Mon Sep 17 00:00:00 2001 From: Shuang Chen <gechenshuang88@gmail.com> Date: Fri, 7 Feb 2020 21:05:00 +0100 Subject: [PATCH] [BHE/PNW] naming with underscores; remove the useless variable following the reviewer suggestions fixed naming with underscores --- ProcessLib/HeatTransportBHE/BHE/BHECommon.h | 2 +- ProcessLib/HeatTransportBHE/BHE/BHECommonCoaxial.h | 4 ++-- ProcessLib/HeatTransportBHE/BHE/BHECommonUType.h | 4 ++-- ProcessLib/HeatTransportBHE/BHE/BHE_1U.h | 4 ++-- ProcessLib/HeatTransportBHE/BHE/BHE_2U.h | 4 ++-- ProcessLib/HeatTransportBHE/BHE/BHE_CXA.h | 4 ++-- ProcessLib/HeatTransportBHE/BHE/BHE_CXC.h | 4 ++-- .../CreateHeatTransportBHEProcess.cpp | 13 +++---------- .../HeatTransportBHE/HeatTransportBHEProcess.cpp | 2 +- 9 files changed, 17 insertions(+), 24 deletions(-) diff --git a/ProcessLib/HeatTransportBHE/BHE/BHECommon.h b/ProcessLib/HeatTransportBHE/BHE/BHECommon.h index a19f997d6b0..a8f2be2d39b 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BHECommon.h +++ b/ProcessLib/HeatTransportBHE/BHE/BHECommon.h @@ -42,7 +42,7 @@ struct BHECommon RefrigerantProperties const refrigerant; GroutParameters const grout; FlowAndTemperatureControl const flowAndTemperatureControl; - bool const usePythonBC; + bool const use_python_bcs; }; } // end of namespace BHE } // end of namespace HeatTransportBHE diff --git a/ProcessLib/HeatTransportBHE/BHE/BHECommonCoaxial.h b/ProcessLib/HeatTransportBHE/BHE/BHECommonCoaxial.h index 4b03f1fae59..6b42e434001 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BHECommonCoaxial.h +++ b/ProcessLib/HeatTransportBHE/BHE/BHECommonCoaxial.h @@ -28,9 +28,9 @@ public: GroutParameters const& grout, FlowAndTemperatureControl const& flowAndTemperatureControl, PipeConfigurationCoaxial const& pipes, - bool const usePythonBC) + bool const use_python_bcs) : BHECommon{borehole, refrigerant, grout, flowAndTemperatureControl, - usePythonBC}, + use_python_bcs}, _pipes(pipes) { cross_section_area_inner_pipe = _pipes.inner_pipe.area(); diff --git a/ProcessLib/HeatTransportBHE/BHE/BHECommonUType.h b/ProcessLib/HeatTransportBHE/BHE/BHECommonUType.h index 1f9717578fc..4a62f2213a4 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BHECommonUType.h +++ b/ProcessLib/HeatTransportBHE/BHE/BHECommonUType.h @@ -28,9 +28,9 @@ public: GroutParameters const& grout, FlowAndTemperatureControl const& flowAndTemperatureControl, PipeConfigurationUType const& pipes, - bool const usePythonBC) + bool const use_python_bcs) : BHECommon{borehole, refrigerant, grout, flowAndTemperatureControl, - usePythonBC}, + use_python_bcs}, _pipes(pipes) { } diff --git a/ProcessLib/HeatTransportBHE/BHE/BHE_1U.h b/ProcessLib/HeatTransportBHE/BHE/BHE_1U.h index 498e55ec3e4..1c310007b20 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BHE_1U.h +++ b/ProcessLib/HeatTransportBHE/BHE/BHE_1U.h @@ -46,10 +46,10 @@ public: GroutParameters const& grout, FlowAndTemperatureControl const& flowAndTemperatureControl, PipeConfigurationUType const& pipes, - bool const usePythonBC) + bool const use_python_bcs) : BHECommonUType{borehole, refrigerant, grout, flowAndTemperatureControl, - pipes, usePythonBC} + pipes, use_python_bcs} { _thermal_resistances.fill(std::numeric_limits<double>::quiet_NaN()); diff --git a/ProcessLib/HeatTransportBHE/BHE/BHE_2U.h b/ProcessLib/HeatTransportBHE/BHE/BHE_2U.h index 151b21c9b59..0eca5582707 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BHE_2U.h +++ b/ProcessLib/HeatTransportBHE/BHE/BHE_2U.h @@ -46,10 +46,10 @@ public: GroutParameters const& grout, FlowAndTemperatureControl const& flowAndTemperatureControl, PipeConfigurationUType const& pipes, - bool const usePythonBC) + bool const use_python_bcs) : BHECommonUType{borehole, refrigerant, grout, flowAndTemperatureControl, - pipes, usePythonBC} + pipes, use_python_bcs} { _thermal_resistances.fill(std::numeric_limits<double>::quiet_NaN()); diff --git a/ProcessLib/HeatTransportBHE/BHE/BHE_CXA.h b/ProcessLib/HeatTransportBHE/BHE/BHE_CXA.h index 98b40cd65b0..7b818351bfc 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BHE_CXA.h +++ b/ProcessLib/HeatTransportBHE/BHE/BHE_CXA.h @@ -43,10 +43,10 @@ public: GroutParameters const& grout, FlowAndTemperatureControl const& flowAndTemperatureControl, PipeConfigurationCoaxial const& pipes, - bool const usePythonBC) + bool const use_python_bcs) : BHECommonCoaxial{borehole, refrigerant, grout, flowAndTemperatureControl, - pipes, usePythonBC} + pipes, use_python_bcs} { // Initialize thermal resistances. auto values = visit( diff --git a/ProcessLib/HeatTransportBHE/BHE/BHE_CXC.h b/ProcessLib/HeatTransportBHE/BHE/BHE_CXC.h index 78e42566275..3ddbb6c526e 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BHE_CXC.h +++ b/ProcessLib/HeatTransportBHE/BHE/BHE_CXC.h @@ -43,10 +43,10 @@ public: GroutParameters const& grout, FlowAndTemperatureControl const& flowAndTemperatureControl, PipeConfigurationCoaxial const& pipes, - bool const usePythonBC) + bool const use_python_bcs) : BHECommonCoaxial{borehole, refrigerant, grout, flowAndTemperatureControl, - pipes, usePythonBC} + pipes, use_python_bcs} { // Initialize thermal resistances. auto values = visit( diff --git a/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp b/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp index 9deeded9983..d5baf91fdb6 100644 --- a/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp +++ b/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp @@ -95,9 +95,6 @@ std::unique_ptr<Process> createHeatTransportBHEProcess( // reading BHE parameters -------------------------------------------------- std::vector<BHE::BHETypes> bhes; - // bhe array network parameter. - bool has_network_python_bc = false; - auto const& bhe_configs = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers} config.getConfigSubtree("borehole_heat_exchangers"); @@ -147,17 +144,13 @@ std::unique_ptr<Process> createHeatTransportBHEProcess( MaterialPropertyLib::createMaterialSpatialDistributionMap(media, mesh); // find if bhe uses python boundary condition - auto const isUsingPythonBC = - visit([](auto const& bhe) { return bhe.usePythonBC; }, bhes[0]); - if (isUsingPythonBC) - { - has_network_python_bc = true; - } + auto const using_python_bcs = + visit([](auto const& bhe) { return bhe.use_python_bcs; }, bhes[0]); //! Python object computing BC values. BHEInflowPythonBoundaryConditionPythonSideInterface* py_object = nullptr; // create a pythonBoundaryCondition object - if (has_network_python_bc) + if (using_python_bcs) { #ifdef OGS_USE_PYTHON // Evaluate Python code in scope of main module diff --git a/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp b/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp index f4fae872bb9..2c327c794a5 100644 --- a/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp +++ b/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp @@ -307,7 +307,7 @@ void HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom( for (auto const& in_out_component_id : bhe.inflow_outflow_bc_component_ids) { - if (bhe.usePythonBC) + if (bhe.use_python_bcs) // call BHEPythonBoundarycondition { #ifdef OGS_USE_PYTHON -- GitLab