1#ifndef BOUNDARY_CONDITION_SURFACE_ENERGY_BALANCE
2#define BOUNDARY_CONDITION_SURFACE_ENERGY_BALANCE
23 T m_stefan_boltzmann_const{};
24 std::string m_temperature_type{
"Temperature"};
57 this->m_sim->m_simulation_config.getStringParameters(
"boundary_temperature");
77 q_sol = this->m_sim->getFieldValue(
78 "QSol", this->m_facet_number);
84 std::cerr <<
"[BCTopSurfaceEnergyBalance]: SolarFlux module not "
85 "loaded or accessable!\n "
86 "[BCTopSurfaceEnergyBalance]:"
88 throw BadInput(
static_cast<std::string
>(
"[BCTopSurfaceEnergyBalance]: SolarFlux module not "
89 "loaded or accessable!\n "
90 "[BCTopSurfaceEnergyBalance]:")
91 +
static_cast<std::string
>(
e.what()));
93 for (
int i{0};
i < this->m_boundary_points.
size();
i++)
100 this->m_sim->getFieldValue(m_temperature_type, this->m_facet_number);
101 emissivity = this->m_sim->getFieldValue(
"Emissivity", this->m_facet_number);
105 std::cerr <<
"[BCTopSurfaceEnergyBalance]: Emissivity module not "
106 "loaded or accessable or wrong temperature_type name!\n "
107 "[BCTopSurfaceEnergyBalance]:"
110 static_cast<std::string
>(
"[BCTopSurfaceEnergyBalance]: Emissivity module not "
111 "loaded or accessable or wrong temperature_type name!\n "
112 "[BCTopSurfaceEnergyBalance]:")
113 +
static_cast<std::string
>(
e.what()));
115 for (
auto&
val : this->m_capacitance_matrix_elements[
i])
119 this->m_stiffness_matrix_elements[
i][0] += 4 * m_stefan_boltzmann_const *
emissivity
122 this->m_forcing_vector_elements[
i] +=
Concrete implementation of a surface-energy-balance boundary condition in 1D.
Definition BCTopSurfaceEnergyBalance.h:20
void writeBoundaryCondition() override
Actual implementation of the boundary condition. Approximates the surface energy-balance-equation for...
Definition BCTopSurfaceEnergyBalance.h:72
~BCTopSurfaceEnergyBalance() override=default
BCTopSurfaceEnergyBalance(SimulationClassBase< T > *sim, std::vector< int > boundary_points, std::vector< std::vector< int > > connected_points, int facet_nr, T area, std::string face_prefix)
Constructor for a BCTopSurfaceEnergyBalance object.
Definition BCTopSurfaceEnergyBalance.h:47
Concrete implementation of a matrix class representing a Compressed Sparse Rows (CSR) matrix....
Definition CsrMatrix.h:37
CsrSparseMatrix()
Constructor for an empty CsrSparseMatrix object. Leaves all storage arrays empty but sets the flag to...
Definition CsrMatrix.h:94
Boundary condition abstract base class for the finite element method. All boundary condition implemen...
Definition GenericBoundaryCondition.h:18
std::pair< int, int > size() const
Function that returns the size of the matrix as a pair in (rows, columns) format.
Definition GenericMatrix.h:120
constexpr double stefan_boltzmann_const
Definition PhysicalConstants.h:6