17template <
typename ShapeFunction,
typename BHEType>
23 bool const is_axially_symmetric,
35 unsigned const n_integration_points =
38 _ip_data.reserve(n_integration_points);
41 auto const shape_matrices =
43 3 >(e, is_axially_symmetric,
47 for (
unsigned ip = 0; ip < n_integration_points; ip++)
49 auto const& sm = shape_matrices[ip];
54 sm.integralMeasure * sm.detJ});
65 auto const section_it =
67 if (section_it ==
_bhe_mesh_data.BHE_element_section_indices.end())
70 "Could not read BHE element section index for element id "
79 "Invalid BHE section index for element id {:d}. Check BHE mesh "
80 "data initialisation.",
87 static constexpr int max_num_thermal_exchange_terms = 5;
94 for (
int idx_bhe_unknowns = 0;
99 typename ShapeMatricesType::template MatrixType<
101 matBHE_loc_R = ShapeMatricesType::template MatrixType<
106 for (
unsigned ip = 0; ip < n_integration_points; ip++)
109 auto const& w =
_ip_data[ip].integration_weight;
112 auto const& R =
_bhe.thermalResistanceAtSection(idx_bhe_unknowns,
115 matBHE_loc_R += N.transpose() * N * (1 / R) * w;
118 _bhe.template assembleRMatrices<ShapeFunction::NPOINTS>(
124template <
typename ShapeFunction,
typename BHEType>
126 double const ,
double const ,
127 std::vector<double>
const& ,
128 std::vector<double>
const& ,
129 std::vector<double>& local_M_data, std::vector<double>& local_K_data,
130 std::vector<double>& )
137 unsigned const n_integration_points =
140 auto const& pipe_heat_capacities =
_bhe.pipeHeatCapacities();
141 auto const& pipe_heat_conductions =
143 auto const& pipe_advection_vectors =
148 for (
unsigned ip = 0; ip < n_integration_points; ip++)
152 auto const& w = ip_data.integration_weight;
153 auto const& N = ip_data.N;
154 auto const& dNdx = ip_data.dNdx;
157 for (
int idx_bhe_unknowns = 0; idx_bhe_unknowns <
bhe_unknowns;
161 auto const& mass_coeff = pipe_heat_capacities[idx_bhe_unknowns];
162 auto const& lambda = pipe_heat_conductions[idx_bhe_unknowns];
163 auto const& advection_vector =
164 pipe_advection_vectors[idx_bhe_unknowns];
165 auto const& A = cross_section_areas[idx_bhe_unknowns];
167 int const single_bhe_unknowns_index =
174 single_bhe_unknowns_index, single_bhe_unknowns_index)
175 .noalias() += N.transpose() * N * mass_coeff * A * w;
182 single_bhe_unknowns_index, single_bhe_unknowns_index)
183 .noalias() += dNdx.transpose() * dNdx * lambda * A * w;
188 single_bhe_unknowns_index, single_bhe_unknowns_index)
190 N.transpose() * advection_vector.transpose() * dNdx * A * w;
195 local_K.template block<bhe_unknowns_size, bhe_unknowns_size>(
200 .template block<bhe_unknowns_size, soil_temperature_size>(
204 .template block<soil_temperature_size, bhe_unknowns_size>(
210 .template block<soil_temperature_size, soil_temperature_size>(
215template <
typename ShapeFunction,
typename BHEType>
218 std::vector<double>
const& local_x,
219 std::vector<double>
const& local_x_prev,
220 std::vector<double>& local_rhs_data,
221 std::vector<double>& local_Jac_data)
227 auto x_prev = Eigen::Map<BheLocalVectorType const>(local_x_prev.data(),
235 std::vector<double> local_M_data;
236 std::vector<double> local_K_data;
237 assemble(t, dt, local_x, local_x_prev, local_M_data, local_K_data,
247 local_Jac.noalias() += local_K + local_M / dt;
248 local_rhs.noalias() -= local_K * x + local_M * (x - x_prev) / dt;
Eigen::Vector3d const & asEigenVector3d() const
virtual const Node * getNode(unsigned idx) const =0
virtual constexpr unsigned getDimension() const =0
Get dimension of the mesh element.
ShapeMatricesType::template MatrixType< bhe_unknowns_size, bhe_unknowns_size > _R_matrix
ShapeMatricesType::template MatrixType< soil_temperature_size, soil_temperature_size > _R_s_matrix
Eigen::Vector3d _element_direction
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data
ShapeMatrixPolicyType< ShapeFunction, 3 > ShapeMatricesType
static constexpr int soil_temperature_size
std::vector< IntegrationPointDataBHE< ShapeMatricesType >, Eigen::aligned_allocator< IntegrationPointDataBHE< ShapeMatricesType > > > _ip_data
ShapeMatricesType::template MatrixType< bhe_unknowns_size, soil_temperature_size > _R_pi_s_matrix
void assemble(double const, double const, std::vector< double > const &, std::vector< double > const &, std::vector< double > &, std::vector< double > &, std::vector< double > &) override
static constexpr int bhe_unknowns_size
static constexpr int bhe_unknowns
static constexpr int bhe_unknowns_index
static constexpr int local_matrix_size
NumLib::GenericIntegrationMethod const & _integration_method
BHEMeshData const & _bhe_mesh_data
static constexpr int single_bhe_unknowns_size
void assembleWithJacobian(double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_rhs_data, std::vector< double > &local_Jac_data) override
static constexpr int soil_temperature_index
HeatTransportBHELocalAssemblerBHE(HeatTransportBHELocalAssemblerBHE const &)=delete
std::size_t const _element_id
HeatTransportBHEProcessData & _process_data
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
Eigen::Map< const Matrix > toMatrix(std::vector< double > const &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)