OGS
ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline Class Reference

Detailed Description

Trampoline class allowing methods of class PythonBoundaryConditionPythonSideInterface to be overridden on the Python side. Cf. https://pybind11.readthedocs.io/en/stable/advanced/classes.html

Definition at line 22 of file BHEInflowPythonBoundaryConditionModule.cpp.

Inheritance diagram for ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline:
[legend]
Collaboration diagram for ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline:
[legend]

Public Member Functions

std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > initializeDataContainer () const override
 
std::tuple< bool, bool, std::vector< double >, std::vector< double > > tespySolver (double t, std::vector< double > const &Tin_val, std::vector< double > const &Tout_val) const override
 
std::tuple< std::vector< double >, std::vector< double > > serverCommunication (double const t, double const dt, std::vector< double > const &Tin_val, std::vector< double > const &Tout_val, std::vector< double > const &flowrate) const override
 
- Public Member Functions inherited from ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface
bool isOverriddenEssential () const
 
bool isOverriddenTespy () const
 
bool isOverriddenServerCommunication () const
 
virtual ~BHEInflowPythonBoundaryConditionPythonSideInterface ()=default
 

Additional Inherited Members

- Public Attributes inherited from ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface
std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > dataframe_network
 

Member Function Documentation

◆ initializeDataContainer()

std::tuple<double, std::vector<double>, std::vector<double>, std::vector<int>, std::vector<double> > ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline::initializeDataContainer ( ) const
inlineoverridevirtual

Initialize network dataframe return a tuple (time, BHE inflow temperature, BHE outflow temperature, BHE outflow bc node id, BHE flowrate) set at that position and the parameters of the BHE network.

Reimplemented from ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface.

Definition at line 31 of file BHEInflowPythonBoundaryConditionModule.cpp.

32  {
33  using Ret = std::tuple<double, std::vector<double>, std::vector<double>,
34  std::vector<int>, std::vector<double>>;
35  PYBIND11_OVERLOAD(Ret,
36  BHEInflowPythonBoundaryConditionPythonSideInterface,
38  }
std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > initializeDataContainer() const override

◆ serverCommunication()

std::tuple<std::vector<double>, std::vector<double> > ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline::serverCommunication ( double const  ,
double const  ,
std::vector< double > const &  ,
std::vector< double > const &  ,
std::vector< double > const &   
) const
inlineoverridevirtual

transfer BHE network dataframe to python script where function serverCommunication takes t, dt, Tin_val, Tout_val, BHE_flowrate as arguments and returns updated Tin_val and flowrate after each time step specific use case: interface between OGS and SimulationX via TCP/IP where OGS is connected as one client

Returns
a tuple (BHE Tin value, BHE flow rate for all BHEs from serverCommunication)

Reimplemented from ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface.

Definition at line 52 of file BHEInflowPythonBoundaryConditionModule.cpp.

56  {
57  using Ret = std::tuple<std::vector<double>, std::vector<double>>;
58  PYBIND11_OVERLOAD(
59  Ret, BHEInflowPythonBoundaryConditionPythonSideInterface,
60  serverCommunication, t, dt, Tin_val, Tout_val, flowrate);
61  }
std::tuple< std::vector< double >, std::vector< double > > serverCommunication(double const t, double const dt, std::vector< double > const &Tin_val, std::vector< double > const &Tout_val, std::vector< double > const &flowrate) const override

◆ tespySolver()

std::tuple<bool, bool, std::vector<double>, std::vector<double> > ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline::tespySolver ( double  ,
std::vector< double > const &  ,
std::vector< double > const &   
) const
inlineoverridevirtual

transfer BHE network dataframe to TESPy and get Tin and flow rate from TESPy

Returns
a tuple (if use tespyThermalSolver, if convergence achieved in tespy, BHE Tin value, BHE flow rate from TESPy) indicating if tespyThermalSolver shall be used at that position, if themal convergence has been achieved in the tespy, the new inflow temperature and flow rate for all BHEs.

Reimplemented from ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface.

Definition at line 41 of file BHEInflowPythonBoundaryConditionModule.cpp.

44  {
45  using Ret =
46  std::tuple<bool, bool, std::vector<double>, std::vector<double>>;
47  PYBIND11_OVERLOAD(Ret,
48  BHEInflowPythonBoundaryConditionPythonSideInterface,
49  tespySolver, t, Tin_val, Tout_val);
50  }
std::tuple< bool, bool, std::vector< double >, std::vector< double > > tespySolver(double t, std::vector< double > const &Tin_val, std::vector< double > const &Tout_val) const override

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