Skip to content

Commit

Permalink
[PL] HTBHE; Clean up the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
endJunction authored and HBShaoUFZ committed Feb 14, 2019
1 parent cc2f5b4 commit 71359f4
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 49 deletions.
25 changes: 25 additions & 0 deletions ProcessLib/HeatTransportBHE/BHE/BHECommonCoaxial.cpp
Expand Up @@ -11,6 +11,10 @@

#include "BHECommonCoaxial.h"

#include "Physics.h"
#include "ThermalResistancesCoaxial.h"
#include "ThermoMechanicalFlowProperties.h"

namespace ProcessLib
{
namespace HeatTransportBHE
Expand Down Expand Up @@ -111,6 +115,27 @@ BHECommonCoaxial::calcThermalResistances(double const Nu_inner_pipe,

return getThermalResistances(R_gs, R_ff, R_fg);
}

void BHECommonCoaxial::updateHeatTransferCoefficients(double const flow_rate)
{
auto const tm_flow_properties_annulus =
calculateThermoMechanicalFlowPropertiesAnnulus(_pipes.inner_pipe,
_pipes.outer_pipe,
borehole_geometry.length,
refrigerant,
flow_rate);

_flow_velocity_annulus = tm_flow_properties_annulus.velocity;

auto const tm_flow_properties = calculateThermoMechanicalFlowPropertiesPipe(
_pipes.inner_pipe, borehole_geometry.length, refrigerant, flow_rate);

_flow_velocity_inner = tm_flow_properties.velocity;

_thermal_resistances =
calcThermalResistances(tm_flow_properties.nusselt_number,
tm_flow_properties_annulus.nusselt_number);
}
} // namespace BHE
} // namespace HeatTransportBHE
} // namespace ProcessLib
29 changes: 1 addition & 28 deletions ProcessLib/HeatTransportBHE/BHE/BHECommonCoaxial.h
Expand Up @@ -12,10 +12,7 @@
#include <Eigen/Eigen>
#include "BHECommon.h"
#include "FlowAndTemperatureControl.h"
#include "Physics.h"
#include "PipeConfigurationCoaxial.h"
#include "ThermalResistancesCoaxial.h"
#include "ThermoMechanicalFlowProperties.h"

namespace ProcessLib
{
Expand Down Expand Up @@ -68,31 +65,7 @@ class BHECommonCoaxial : public BHECommon
cross_section_area_grout;

protected:
void updateHeatTransferCoefficients(double const flow_rate)
{
auto const tm_flow_properties_annulus =
calculateThermoMechanicalFlowPropertiesAnnulus(
_pipes.inner_pipe,
_pipes.outer_pipe,
borehole_geometry.length,
refrigerant,
flow_rate);

_flow_velocity_annulus = tm_flow_properties_annulus.velocity;

auto const tm_flow_properties =
calculateThermoMechanicalFlowPropertiesPipe(
_pipes.inner_pipe,
borehole_geometry.length,
refrigerant,
flow_rate);

_flow_velocity_inner = tm_flow_properties.velocity;

_thermal_resistances =
calcThermalResistances(tm_flow_properties.nusselt_number,
tm_flow_properties_annulus.nusselt_number);
}
void updateHeatTransferCoefficients(double const flow_rate);

PipeConfigurationCoaxial const _pipes;

Expand Down
2 changes: 1 addition & 1 deletion ProcessLib/HeatTransportBHE/BHE/BHE_1U.cpp
Expand Up @@ -182,7 +182,7 @@ void BHE_1U::updateHeatTransferCoefficients(double const flow_rate)
std::array<double, BHE_1U::number_of_unknowns> BHE_1U::calcThermalResistances(
double const Nu)
{
static constexpr double pi = boost::math::constants::pi<double>();
constexpr double pi = boost::math::constants::pi<double>();

double const& lambda_r = refrigerant.thermal_conductivity;
double const& lambda_g = grout.lambda_g;
Expand Down
3 changes: 3 additions & 0 deletions ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp
Expand Up @@ -11,6 +11,9 @@

#include "CreateBHECoaxial.h"
#include "BaseLib/ConfigTree.h"

#include "BHE_CXA.h"
#include "BHE_CXC.h"
#include "CreateFlowAndTemperatureControl.h"
namespace ProcessLib
{
Expand Down
2 changes: 0 additions & 2 deletions ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.h
Expand Up @@ -10,8 +10,6 @@
#pragma once

#include "BHECommonCoaxial.h"
#include "BHE_CXA.h"
#include "BHE_CXC.h"

namespace BaseLib
{
Expand Down
2 changes: 0 additions & 2 deletions ProcessLib/HeatTransportBHE/BHE/GroutParameters.h
Expand Up @@ -11,8 +11,6 @@

#pragma once

#include <boost/math/constants/constants.hpp>

namespace BaseLib
{
class ConfigTree;
Expand Down
2 changes: 0 additions & 2 deletions ProcessLib/HeatTransportBHE/BHE/Physics.h
Expand Up @@ -11,8 +11,6 @@

#pragma once

#include "Pipe.h"

namespace ProcessLib
{
namespace HeatTransportBHE
Expand Down
3 changes: 0 additions & 3 deletions ProcessLib/HeatTransportBHE/BHE/PipeConfiguration1U.h
Expand Up @@ -11,9 +11,6 @@

#pragma once

#include <boost/math/constants/constants.hpp>

#include "BaseLib/ConfigTree.h"
#include "Pipe.h"

namespace ProcessLib
Expand Down
3 changes: 0 additions & 3 deletions ProcessLib/HeatTransportBHE/BHE/PipeConfigurationCoaxial.h
Expand Up @@ -11,9 +11,6 @@

#pragma once

#include <boost/math/constants/constants.hpp>

#include "BaseLib/ConfigTree.h"
#include "Pipe.h"

namespace ProcessLib
Expand Down
2 changes: 0 additions & 2 deletions ProcessLib/HeatTransportBHE/BHE/RefrigerantProperties.h
Expand Up @@ -11,8 +11,6 @@

#pragma once

#include <boost/math/constants/constants.hpp>

namespace BaseLib
{
class ConfigTree;
Expand Down
11 changes: 5 additions & 6 deletions ProcessLib/HeatTransportBHE/BHE/ThermalResistancesCoaxial.h
Expand Up @@ -12,7 +12,6 @@
#pragma once

#include "GroutParameters.h"
#include "Physics.h"
#include "Pipe.h"
#include "RefrigerantProperties.h"

Expand All @@ -24,9 +23,9 @@ namespace BHE
{
struct AdvectiveThermalResistanceCoaxial
{
double inner_pipe_coaxial;
double a_annulus;
double b_annulus;
double const inner_pipe_coaxial;
double const a_annulus;
double const b_annulus;
};

struct PipeWallThermalResistanceCoaxial
Expand All @@ -50,7 +49,7 @@ inline AdvectiveThermalResistanceCoaxial calculateAdvectiveThermalResistance(
coaxialPipesAnnulusDiameter(inner_pipe, outer_pipe);

auto advective_thermal_resistance = [&](double Nu, double diameter_ratio) {
static constexpr double pi = boost::math::constants::pi<double>();
constexpr double pi = boost::math::constants::pi<double>();
return 1.0 / (Nu * fluid.thermal_conductivity * pi) * diameter_ratio;
};
return {advective_thermal_resistance(Nu_inner_pipe, 1.),
Expand All @@ -72,7 +71,7 @@ calculateGroutAndGroutSoilExchangeThermalResistance(
Pipe const& outer_pipe, GroutParameters const& grout_parameters,
double const borehole_diameter)
{
static constexpr double pi = boost::math::constants::pi<double>();
constexpr double pi = boost::math::constants::pi<double>();

double const outer_pipe_outside_diameter = outer_pipe.outsideDiameter();
double const chi =
Expand Down

0 comments on commit 71359f4

Please sign in to comment.