13 #include <Eigen/Dense>
31 template <
typename ShapeFunction,
typename IntegrationMethod,
int GlobalDim>
47 std::size_t
const local_matrix_size,
48 bool const is_axially_symmetric,
49 unsigned const integration_order,
51 const unsigned dof_per_node)
59 assert(local_matrix_size == ShapeFunction::NPOINTS * dof_per_node);
60 (void)local_matrix_size;
63 unsigned const n_integration_points =
65 _ip_data.reserve(n_integration_points);
67 auto const shape_matrices =
69 GlobalDim>(element, is_axially_symmetric,
72 for (
unsigned ip = 0; ip < n_integration_points; ip++)
75 shape_matrices[ip].N, shape_matrices[ip].dNdx,
77 shape_matrices[ip].integralMeasure *
78 shape_matrices[ip].detJ);
83 const unsigned integration_point)
const override
85 auto const& N =
_ip_data[integration_point].N;
88 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
95 std::vector<double>
const& local_x)
const override
100 auto const shape_matrices =
104 std::array{pnt_local_coords})[0];
112 double T_int_pt = 0.0;
113 double p_int_pt = 0.0;
124 auto const& liquid_phase = medium.phase(
"AqueousLiquid");
128 double const dt = std::numeric_limits<double>::quiet_NaN();
130 auto const K = MaterialPropertyLib::formEigenTensor<GlobalDim>(
132 .value(vars, pos, t, dt));
136 .template value<double>(vars, pos, t, dt);
139 auto const p_nodal_values = Eigen::Map<const NodalVectorType>(
140 &local_x[local_x.size() / 2], ShapeFunction::NPOINTS);
142 -K_over_mu * shape_matrices.dNdx * p_nodal_values;
149 .template value<double>(vars, pos, t, dt);
151 q += K_over_mu * rho_w * b;
154 Eigen::Vector3d flux;
155 flux.head<GlobalDim>() =
q;
166 Eigen::aligned_allocator<
172 const double fluid_density,
const double specific_heat_capacity_fluid,
178 auto const& solid_phase = medium.phase(
"Solid");
180 auto const specific_heat_capacity_solid =
184 .template value<double>(vars, pos, t, dt);
186 auto const solid_density =
188 .template value<double>(vars, pos, t, dt);
190 return solid_density * specific_heat_capacity_solid * (1 - porosity) +
196 const double fluid_density,
const double specific_heat_capacity_fluid,
205 MaterialPropertyLib::formEigenTensor<GlobalDim>(
209 .value(vars, pos, t, dt));
211 auto const thermal_dispersivity_longitudinal =
215 .template value<double>();
216 auto const thermal_dispersivity_transversal =
220 .template value<double>();
222 double const velocity_magnitude = velocity.norm();
224 if (velocity_magnitude < std::numeric_limits<double>::epsilon())
231 (thermal_dispersivity_transversal * velocity_magnitude * I +
232 (thermal_dispersivity_longitudinal -
233 thermal_dispersivity_transversal) /
234 velocity_magnitude * velocity * velocity.transpose());
240 const double t, std::vector<double>
const& local_x,
241 std::vector<double>& cache)
const
243 std::vector<double> local_p{
246 std::vector<double> local_T{
250 auto const n_integration_points =
255 Eigen::Matrix<double, GlobalDim, Eigen::Dynamic, Eigen::RowMajor>>(
256 cache, GlobalDim, n_integration_points);
263 auto const p_nodal_values = Eigen::Map<const NodalVectorType>(
264 &local_p[0], ShapeFunction::NPOINTS);
268 auto const& liquid_phase = medium.phase(
"AqueousLiquid");
270 for (
unsigned ip = 0; ip < n_integration_points; ++ip)
273 auto const& N = ip_data.N;
274 auto const& dNdx = ip_data.dNdx;
276 pos.setIntegrationPoint(ip);
278 double T_int_pt = 0.0;
279 double p_int_pt = 0.0;
285 vars[
static_cast<int>(
290 double const dt = std::numeric_limits<double>::quiet_NaN();
291 auto const K = MaterialPropertyLib::formEigenTensor<GlobalDim>(
293 .value(vars, pos, t, dt));
298 .template value<double>(vars, pos, t, dt);
301 cache_mat.col(ip).noalias() = -K_over_mu * dNdx * p_nodal_values;
308 .template value<double>(vars, pos, t, dt);
311 cache_mat.col(ip).noalias() += K_over_mu * rho_w * b;
virtual std::size_t getID() const final
Returns the ID of the element.
void setElementID(std::size_t element_id)
IntegrationMethod const _integration_method
typename ShapeMatricesType::NodalVectorType NodalVectorType
static const int pressure_index
Eigen::Vector3d getFlux(MathLib::Point3d const &pnt_local_coords, double const t, std::vector< double > const &local_x) const override
double getHeatEnergyCoefficient(MaterialPropertyLib::VariableArray const &vars, const double porosity, const double fluid_density, const double specific_heat_capacity_fluid, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
MeshLib::Element const & _element
static const int pressure_size
typename ShapeMatricesType::GlobalDimNodalMatrixType GlobalDimNodalMatrixType
typename ShapeMatricesType::GlobalDimVectorType GlobalDimVectorType
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix(const unsigned integration_point) const override
Provides the shape matrix at the given integration point.
static const int temperature_size
HTProcessData const & _process_data
ShapeMatrixPolicyType< ShapeFunction, GlobalDim > ShapeMatricesType
typename ShapeMatricesType::ShapeMatrices ShapeMatrices
HTFEM(MeshLib::Element const &element, std::size_t const local_matrix_size, bool const is_axially_symmetric, unsigned const integration_order, HTProcessData const &process_data, const unsigned dof_per_node)
static const int temperature_index
std::vector< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType >, Eigen::aligned_allocator< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType > > > _ip_data
typename ShapeMatricesType::GlobalDimMatrixType GlobalDimMatrixType
typename ShapeMatricesType::NodalRowVectorType NodalRowVectorType
std::vector< double > const & getIntPtDarcyVelocityLocal(const double t, std::vector< double > const &local_x, std::vector< double > &cache) const
GlobalDimMatrixType getThermalConductivityDispersivity(MaterialPropertyLib::VariableArray const &vars, const double fluid_density, const double specific_heat_capacity_fluid, const GlobalDimVectorType &velocity, const GlobalDimMatrixType &I, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
std::array< VariableType, static_cast< int >(Variable::number_of_variables)> VariableArray
@ thermal_transversal_dispersivity
@ thermal_longitudinal_dispersivity
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > computeShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, PointContainer const &points)
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)
double fluid_density(const double p, const double T, const double x)
NumLib::ShapeMatrices< NodalRowVectorType, DimNodalMatrixType, DimMatrixType, GlobalDimNodalMatrixType > ShapeMatrices
MatrixType< GlobalDim, ShapeFunction::NPOINTS > GlobalDimNodalMatrixType
MatrixType< GlobalDim, GlobalDim > GlobalDimMatrixType
VectorType< GlobalDim > GlobalDimVectorType
VectorType< ShapeFunction::NPOINTS > NodalVectorType
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType
Eigen::VectorXd const specific_body_force
std::unique_ptr< MaterialPropertyLib::MaterialSpatialDistributionMap > media_map