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 > > serverCommunicationPreTimestep (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
 
void serverCommunicationPostTimestep (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 isOverriddenServerCommunicationPreTimestep () const
 
bool isOverriddenServerCommunicationPostTimestep () 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

References initializeDataContainer().

Referenced by initializeDataContainer().

◆ serverCommunicationPostTimestep()

void ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline::serverCommunicationPostTimestep ( double const t,
double const dt,
std::vector< double > const & Tin_val,
std::vector< double > const & Tout_val,
std::vector< double > const & flowrate ) const
inlineoverridevirtual

Reimplemented from ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface.

Definition at line 64 of file BHEInflowPythonBoundaryConditionModule.cpp.

68 {
69 PYBIND11_OVERLOAD(void,
70 BHEInflowPythonBoundaryConditionPythonSideInterface,
71 serverCommunicationPostTimestep, t, dt, Tin_val,
72 Tout_val, flowrate);
73 }
void serverCommunicationPostTimestep(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

References serverCommunicationPostTimestep().

Referenced by serverCommunicationPostTimestep().

◆ serverCommunicationPreTimestep()

std::tuple< std::vector< double >, std::vector< double > > ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline::serverCommunicationPreTimestep ( 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 which will be used as (python) boundary conditions for the next time step. The communication happens in preTimestep so that the updated values are used in the current 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 53 of file BHEInflowPythonBoundaryConditionModule.cpp.

57 {
58 using Ret = std::tuple<std::vector<double>, std::vector<double>>;
59 PYBIND11_OVERLOAD(
60 Ret, BHEInflowPythonBoundaryConditionPythonSideInterface,
61 serverCommunicationPreTimestep, t, dt, Tin_val, Tout_val, flowrate);
62 }
std::tuple< std::vector< double >, std::vector< double > > serverCommunicationPreTimestep(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

References serverCommunicationPreTimestep().

Referenced by serverCommunicationPreTimestep().

◆ 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

References tespySolver().

Referenced by tespySolver().


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