OGS
ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface Class Reference

Detailed Description

Base class for BHENetwork. This class will get Python bindings and is intended to be to be derived in Python.

Definition at line 18 of file BHEInflowPythonBoundaryConditionPythonSideInterface.h.

#include <BHEInflowPythonBoundaryConditionPythonSideInterface.h>

Inheritance diagram for ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface:
[legend]

Public Member Functions

virtual std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > initializeDataContainer () const
 
virtual std::tuple< bool, bool, std::vector< double >, std::vector< double > > tespySolver (double, std::vector< double > const &, std::vector< double > const &) const
 
virtual std::tuple< std::vector< double >, std::vector< double > > serverCommunicationPreTimestep (double, double, std::vector< double > const &, std::vector< double > const &, std::vector< double > const &) const
 
virtual void serverCommunicationPostTimestep (double, double, std::vector< double > const &, std::vector< double > const &, std::vector< double > const &) const
 
bool isOverriddenEssential () const
 
bool isOverriddenTespy () const
 
bool isOverriddenServerCommunicationPreTimestep () const
 
bool isOverriddenServerCommunicationPostTimestep () const
 
virtual ~BHEInflowPythonBoundaryConditionPythonSideInterface ()=default
 

Public Attributes

std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > dataframe_network
 

Private Attributes

bool _overridden_essential = true
 
bool _overridden_tespy = true
 
bool _overridden_server_communication_pre = true
 
bool _overridden_server_communication_post = true
 

Constructor & Destructor Documentation

◆ ~BHEInflowPythonBoundaryConditionPythonSideInterface()

virtual ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::~BHEInflowPythonBoundaryConditionPythonSideInterface ( )
virtualdefault

Member Function Documentation

◆ initializeDataContainer()

virtual std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::initializeDataContainer ( ) const
inlinevirtual

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 in ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline.

Definition at line 32 of file BHEInflowPythonBoundaryConditionPythonSideInterface.h.

33 {
35 return std::tuple<double,
36 std::vector<double>,
37 std::vector<double>,
38 std::vector<int>,
39 std::vector<double>>{
40 std::numeric_limits<double>::quiet_NaN(), {}, {}, {}, {}};
41 }

References _overridden_essential.

◆ isOverriddenEssential()

bool ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::isOverriddenEssential ( ) const
inline

Tells if initializeDataContainer() has been overridden in the derived class in Python.

Precondition
initializeDataContainer() must already have been called once.

Definition at line 101 of file BHEInflowPythonBoundaryConditionPythonSideInterface.h.

101{ return _overridden_essential; }

References _overridden_essential.

◆ isOverriddenServerCommunicationPostTimestep()

bool ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::isOverriddenServerCommunicationPostTimestep ( ) const
inline

◆ isOverriddenServerCommunicationPreTimestep()

bool ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::isOverriddenServerCommunicationPreTimestep ( ) const
inline

Tells if serverCommunication() has been overridden in the derived class in Python.

Precondition
serverCommunication() must already have been called once.

Definition at line 113 of file BHEInflowPythonBoundaryConditionPythonSideInterface.h.

References _overridden_server_communication_pre.

Referenced by ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::preTimestepConcreteProcess().

◆ isOverriddenTespy()

bool ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::isOverriddenTespy ( ) const
inline

◆ serverCommunicationPostTimestep()

virtual void ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::serverCommunicationPostTimestep ( double ,
double ,
std::vector< double > const & ,
std::vector< double > const & ,
std::vector< double > const &  ) const
inlinevirtual

◆ serverCommunicationPreTimestep()

virtual std::tuple< std::vector< double >, std::vector< double > > ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::serverCommunicationPreTimestep ( double ,
double ,
std::vector< double > const & ,
std::vector< double > const & ,
std::vector< double > const &  ) const
inlinevirtual

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 in ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline.

Definition at line 77 of file BHEInflowPythonBoundaryConditionPythonSideInterface.h.

82 {
84 return {};
85 }

References _overridden_server_communication_pre.

Referenced by ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::preTimestepConcreteProcess().

◆ tespySolver()

virtual std::tuple< bool, bool, std::vector< double >, std::vector< double > > ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::tespySolver ( double ,
std::vector< double > const & ,
std::vector< double > const &  ) const
inlinevirtual

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 in ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterfaceTrampoline.

Definition at line 54 of file BHEInflowPythonBoundaryConditionPythonSideInterface.h.

57 {
58 _overridden_tespy = false;
59 return std::tuple<bool, bool, std::vector<double>, std::vector<double>>{
60 false, false, {}, {}};
61 }

References _overridden_tespy.

Referenced by ProcessLib::bheInflowpythonBindBoundaryCondition(), and ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::postIterationConcreteProcess().

Member Data Documentation

◆ _overridden_essential

bool ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::_overridden_essential = true
mutableprivate

Tells if initializeDataContainer() has been overridden in the derived class in Python.

Definition at line 136 of file BHEInflowPythonBoundaryConditionPythonSideInterface.h.

Referenced by initializeDataContainer(), and isOverriddenEssential().

◆ _overridden_server_communication_post

bool ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::_overridden_server_communication_post = true
mutableprivate

◆ _overridden_server_communication_pre

bool ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::_overridden_server_communication_pre = true
mutableprivate

Tells if serverCommunication() has been overridden in the derived class in Python.

Definition at line 142 of file BHEInflowPythonBoundaryConditionPythonSideInterface.h.

Referenced by isOverriddenServerCommunicationPreTimestep(), and serverCommunicationPreTimestep().

◆ _overridden_tespy

bool ProcessLib::BHEInflowPythonBoundaryConditionPythonSideInterface::_overridden_tespy = true
mutableprivate

Tells if tespySolver() has been overridden in the derived class in Python.

Definition at line 139 of file BHEInflowPythonBoundaryConditionPythonSideInterface.h.

Referenced by isOverriddenTespy(), and tespySolver().

◆ dataframe_network


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