OGS
ProcessLib::BHEInflowPythonBoundaryCondition< BHEType > Class Template Referencefinal

Detailed Description

template<typename BHEType>
class ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >

A boundary condition whose values are computed by a Python script.

Definition at line 31 of file BHEInflowPythonBoundaryCondition.h.

#include <BHEInflowPythonBoundaryCondition.h>

Inheritance diagram for ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >:
[legend]
Collaboration diagram for ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >:
[legend]

Public Member Functions

 BHEInflowPythonBoundaryCondition (std::pair< GlobalIndexType, GlobalIndexType > &&in_out_global_indices, BHEType &bhe, BHEInflowPythonBoundaryConditionPythonSideInterface &py_bc_object)
 
void getEssentialBCValues (const double t, const GlobalVector &, NumLib::IndexValueVector< GlobalIndexType > &bc_values) const override
 Writes the values of essential BCs to bc_values.
 
- Public Member Functions inherited from ProcessLib::BoundaryCondition
virtual void applyNaturalBC (const double, std::vector< GlobalVector * > const &, int const, GlobalMatrix &, GlobalVector &, GlobalMatrix *)
 
virtual void preTimestep (const double, std::vector< GlobalVector * > const &, int const)
 
virtual void postTimestep (const double, std::vector< GlobalVector * > const &, int const)
 
virtual ~BoundaryCondition ()=default
 

Private Attributes

std::pair< GlobalIndexType, GlobalIndexType > const _in_out_global_indices
 
BHEType & _bhe
 
BHEInflowPythonBoundaryConditionPythonSideInterface_py_bc_object
 

Constructor & Destructor Documentation

◆ BHEInflowPythonBoundaryCondition()

template<typename BHEType >
ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >::BHEInflowPythonBoundaryCondition ( std::pair< GlobalIndexType, GlobalIndexType > && in_out_global_indices,
BHEType & bhe,
BHEInflowPythonBoundaryConditionPythonSideInterface & py_bc_object )
inline

Definition at line 34 of file BHEInflowPythonBoundaryCondition.h.

38 : _in_out_global_indices(std::move(in_out_global_indices)),
39 _bhe(bhe),
40 _py_bc_object(py_bc_object)
41 {
42 const auto g_idx_T_out =
43 static_cast<int>(_in_out_global_indices.second);
44
45 // store the bc node ids to BHE network dataframe
46 std::get<3>(_py_bc_object.dataframe_network).emplace_back(g_idx_T_out);
47 }
std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > dataframe_network
BHEInflowPythonBoundaryConditionPythonSideInterface & _py_bc_object
std::pair< GlobalIndexType, GlobalIndexType > const _in_out_global_indices

References ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >::_in_out_global_indices, ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >::_py_bc_object, and ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::dataframe_network.

Member Function Documentation

◆ getEssentialBCValues()

template<typename BHEType >
void ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >::getEssentialBCValues ( const double ,
const GlobalVector & ,
NumLib::IndexValueVector< GlobalIndexType > &  ) const
inlineoverridevirtual

Writes the values of essential BCs to bc_values.

Reimplemented from ProcessLib::BoundaryCondition.

Definition at line 49 of file BHEInflowPythonBoundaryCondition.h.

52 {
53 bc_values.ids.resize(1);
54 bc_values.values.resize(1);
55 auto const& data_exchange = _py_bc_object.dataframe_network;
56 // get the number of all boundary nodes
57 const std::size_t n_bc_nodes = std::get<3>(data_exchange).size();
58
59 // get T_in bc_id
60 bc_values.ids[0] = _in_out_global_indices.first;
61
62 // get T_out bc_id
63 auto const boundary_node_id = _in_out_global_indices.second;
64
65 // return T_in from currently BHE dataframe column 2,
66 // update flowrate and HeatTransferCoefficients for each BHE
67 for (std::size_t i = 0; i < n_bc_nodes; i++)
68 {
69 // auto pair_flag_value =
70 // _bc_data.bc_object->getDirichletBCValue(boundary_node_id);
71 auto const dataframe_node_id = std::get<3>(data_exchange);
72 auto const dataframe_Tin_val = std::get<1>(data_exchange);
73 auto const dataframe_BHE_flowrate = std::get<4>(data_exchange);
74 if (dataframe_node_id[i] == boundary_node_id)
75 {
76 bc_values.values[0] = dataframe_Tin_val[i];
77 _bhe.updateHeatTransferCoefficients(dataframe_BHE_flowrate[i]);
78 break;
79 }
80 }
81
82 // store the current time to network dataframe
83 std::get<0>(_py_bc_object.dataframe_network) = t;
84 }

References ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >::_bhe, ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >::_in_out_global_indices, ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >::_py_bc_object, ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::dataframe_network, NumLib::IndexValueVector< IndexType >::ids, and NumLib::IndexValueVector< IndexType >::values.

Member Data Documentation

◆ _bhe

template<typename BHEType >
BHEType& ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >::_bhe
private

◆ _in_out_global_indices

◆ _py_bc_object


The documentation for this class was generated from the following file: