28 namespace HeatTransportBHE
30 template <
typename ShapeFunction,
typename IntegrationMethod>
34 bool const is_axially_symmetric,
35 unsigned const integration_order,
37 : _process_data(process_data),
38 _integration_method(integration_order),
39 _element_id(e.getID())
41 unsigned const n_integration_points =
44 _ip_data.reserve(n_integration_points);
49 3 >(e, is_axially_symmetric,
56 for (
unsigned ip = 0; ip < n_integration_points; ip++)
58 x_position.setIntegrationPoint(ip);
63 sm.integralMeasure * sm.detJ;
64 _ip_data.push_back({sm.N, sm.dNdx, w});
70 template <
typename ShapeFunction,
typename IntegrationMethod>
72 assemble(
double const t,
double const dt,
73 std::vector<double>
const& local_x,
74 std::vector<double>
const& ,
75 std::vector<double>& local_M_data,
76 std::vector<double>& local_K_data,
77 std::vector<double>& )
79 assert(local_x.size() == ShapeFunction::NPOINTS);
82 auto local_M = MathLib::createZeroedMatrix<NodalMatrixType>(
83 local_M_data, ShapeFunction::NPOINTS, ShapeFunction::NPOINTS);
84 auto local_K = MathLib::createZeroedMatrix<NodalMatrixType>(
85 local_K_data, ShapeFunction::NPOINTS, ShapeFunction::NPOINTS);
90 auto const& medium = *_process_data.media_map->getMedium(_element_id);
91 auto const& solid_phase = medium.phase(
"Solid");
92 auto const& liquid_phase = medium.phase(
"AqueousLiquid");
96 unsigned const n_integration_points =
97 _integration_method.getNumberOfPoints();
99 for (
unsigned ip = 0; ip < n_integration_points; ip++)
102 auto& ip_data = _ip_data[ip];
103 auto const& N = ip_data.N;
104 auto const& dNdx = ip_data.dNdx;
105 auto const& w = ip_data.integration_weight;
107 double T_int_pt = 0.0;
114 auto const density_s =
116 .template value<double>(vars, pos, t, dt);
118 auto const heat_capacity_s =
122 .template value<double>(vars, pos, t, dt);
124 auto const density_f =
126 .template value<double>(vars, pos, t, dt);
128 auto const heat_capacity_f =
132 .template value<double>(vars, pos, t, dt);
134 auto const porosity =
136 .template value<double>(vars, pos, t, dt);
138 auto const velocity =
141 .template value<Eigen::Vector3d>(vars, pos, t, dt);
149 .value(vars, pos, t, dt));
153 double const velocity_magnitude = velocity.norm();
155 if (velocity_magnitude >= std::numeric_limits<double>::epsilon())
157 auto const thermal_dispersivity_longitudinal =
161 .template value<double>();
162 auto const thermal_dispersivity_transversal =
166 .template value<double>();
168 auto const thermal_dispersivity =
169 density_f * heat_capacity_f *
170 (thermal_dispersivity_transversal * velocity_magnitude *
171 Eigen::Matrix3d::Identity() +
172 (thermal_dispersivity_longitudinal -
173 thermal_dispersivity_transversal) /
174 velocity_magnitude * velocity * velocity.transpose());
175 thermal_conductivity_dispersivity += thermal_dispersivity;
180 (dNdx.transpose() * thermal_conductivity_dispersivity * dNdx +
181 N.transpose() * velocity.transpose() * dNdx * density_f *
186 local_M.noalias() += N.transpose() * N * w *
187 (density_s * heat_capacity_s * (1 - porosity) +
188 density_f * heat_capacity_f * porosity);
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data
ShapeMatrixPolicyType< ShapeFunction, 3 > ShapeMatricesType
std::size_t const _element_id
HeatTransportBHELocalAssemblerSoil(HeatTransportBHELocalAssemblerSoil const &)=delete
std::vector< ShapeMatrices, Eigen::aligned_allocator< ShapeMatrices > > _shape_matrices
std::vector< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType >, Eigen::aligned_allocator< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType > > > _ip_data
void assemble(double const, double const, std::vector< double > const &, std::vector< double > const &, std::vector< double > &, std::vector< double > &, std::vector< double > &) override
IntegrationMethod const _integration_method
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(MaterialPropertyLib::PropertyDataType const &values)
std::array< VariableType, static_cast< int >(Variable::number_of_variables)> VariableArray
@ thermal_transversal_dispersivity
@ thermal_longitudinal_dispersivity
void shapeFunctionInterpolate(const NodalValues &nodal_values, const ShapeMatrix &shape_matrix_N, double &interpolated_value, ScalarTypes &... interpolated_values)
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)
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N