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 32 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 35 of file BHEInflowPythonBoundaryCondition.h.

40 _bhe(bhe),
42 {
43 const auto g_idx_T_out =
44 static_cast<int>(_in_out_global_indices.second);
45
46 // store the bc node ids to BHE network dataframe
47 std::get<3>(_py_bc_object.dataframe_network).emplace_back(g_idx_T_out);
48 }
A boundary condition whose values are computed by a Python script.
BHEInflowPythonBoundaryConditionPythonSideInterface & _py_bc_object
std::pair< GlobalIndexType, GlobalIndexType > const _in_out_global_indices

References _bhe, _in_out_global_indices, and _py_bc_object.

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 50 of file BHEInflowPythonBoundaryCondition.h.

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

References _bhe, _in_out_global_indices, _py_bc_object, 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

template<typename BHEType>
std::pair<GlobalIndexType, GlobalIndexType> const ProcessLib::BHEInflowPythonBoundaryCondition< BHEType >::_in_out_global_indices
private

◆ _py_bc_object


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