14template <
typename ShapeFunction,
typename BHEType>
20 bool const is_axially_symmetric,
30 unsigned const n_integration_points =
33 _ip_data.reserve(n_integration_points);
36 auto const shape_matrices =
38 3 >(e, is_axially_symmetric,
42 for (
unsigned ip = 0; ip < n_integration_points; ip++)
44 auto const& sm = shape_matrices[ip];
49 sm.integralMeasure * sm.detJ});
63 static constexpr int max_num_thermal_exchange_terms = 5;
65 for (
int idx_bhe_unknowns = 0; idx_bhe_unknowns <
bhe_unknowns;
68 typename ShapeMatricesType::template MatrixType<
70 matBHE_loc_R = ShapeMatricesType::template MatrixType<
75 for (
unsigned ip = 0; ip < n_integration_points; ip++)
78 auto const& w =
_ip_data[ip].integration_weight;
80 auto const& R =
_bhe.thermalResistance(idx_bhe_unknowns);
82 matBHE_loc_R += N.transpose() * N * (1 / R) * w;
94 if (idx_bhe_unknowns < max_num_thermal_exchange_terms)
96 _bhe.template assembleRMatrices<ShapeFunction::NPOINTS>(
114template <
typename ShapeFunction,
typename BHEType>
116 double const ,
double const ,
117 std::vector<double>
const& ,
118 std::vector<double>
const& ,
119 std::vector<double>& local_M_data, std::vector<double>& local_K_data,
120 std::vector<double>& )
127 unsigned const n_integration_points =
130 auto const& pipe_heat_capacities =
_bhe.pipeHeatCapacities();
131 auto const& pipe_heat_conductions =
_bhe.pipeHeatConductions();
132 auto const& pipe_advection_vectors =
134 auto const& cross_section_areas =
_bhe.crossSectionAreas();
137 for (
unsigned ip = 0; ip < n_integration_points; ip++)
141 auto const& w = ip_data.integration_weight;
142 auto const& N = ip_data.N;
143 auto const& dNdx = ip_data.dNdx;
146 for (
int idx_bhe_unknowns = 0; idx_bhe_unknowns <
bhe_unknowns;
150 auto const& mass_coeff = pipe_heat_capacities[idx_bhe_unknowns];
151 auto const& lambda = pipe_heat_conductions[idx_bhe_unknowns];
152 auto const& advection_vector =
153 pipe_advection_vectors[idx_bhe_unknowns];
154 auto const& A = cross_section_areas[idx_bhe_unknowns];
156 int const single_bhe_unknowns_index =
163 single_bhe_unknowns_index, single_bhe_unknowns_index)
164 .noalias() += N.transpose() * N * mass_coeff * A * w;
171 single_bhe_unknowns_index, single_bhe_unknowns_index)
172 .noalias() += dNdx.transpose() * dNdx * lambda * A * w;
177 single_bhe_unknowns_index, single_bhe_unknowns_index)
179 N.transpose() * advection_vector.transpose() * dNdx * A * w;
184 local_K.template block<bhe_unknowns_size, bhe_unknowns_size>(
189 .template block<bhe_unknowns_size, soil_temperature_size>(
193 .template block<soil_temperature_size, bhe_unknowns_size>(
199 .template block<soil_temperature_size, soil_temperature_size>(
210template <
typename ShapeFunction,
typename BHEType>
213 std::vector<double>
const& local_x,
214 std::vector<double>
const& local_x_prev,
215 std::vector<double>& local_rhs_data,
216 std::vector<double>& local_Jac_data)
222 auto x_prev = Eigen::Map<BheLocalVectorType const>(local_x_prev.data(),
230 std::vector<double> local_M_data;
231 std::vector<double> local_K_data;
232 assemble(t, dt, local_x, local_x_prev, local_M_data, local_K_data,
242 local_Jac.noalias() += local_K + local_M / dt;
243 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
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)