35 bool const is_axially_symmetric,
37 : _process_data(process_data),
38 _integration_method(integration_method),
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});
72 double const t,
double const dt, std::vector<double>
const& local_x,
73 std::vector<double>
const& ,
74 std::vector<double>& local_M_data, std::vector<double>& local_K_data,
75 std::vector<double>& )
77 assert(local_x.size() == ShapeFunction::NPOINTS);
81 local_M_data, ShapeFunction::NPOINTS, ShapeFunction::NPOINTS);
83 local_K_data, ShapeFunction::NPOINTS, ShapeFunction::NPOINTS);
88 auto const& medium = *_process_data.media_map.getMedium(_element_id);
89 auto const& solid_phase = medium.phase(
"Solid");
90 auto const& liquid_phase = medium.phase(
"AqueousLiquid");
94 unsigned const n_integration_points =
95 _integration_method.getNumberOfPoints();
97 for (
unsigned ip = 0; ip < n_integration_points; ip++)
100 auto& ip_data = _ip_data[ip];
101 auto const& N = ip_data.N;
102 auto const& dNdx = ip_data.dNdx;
103 auto const& w = ip_data.integration_weight;
105 double T_int_pt = 0.0;
111 auto const density_s =
113 .template value<double>(vars, pos, t, dt);
115 auto const heat_capacity_s =
119 .template value<double>(vars, pos, t, dt);
121 auto const density_f =
123 .template value<double>(vars, pos, t, dt);
125 auto const heat_capacity_f =
129 .template value<double>(vars, pos, t, dt);
131 auto const porosity =
133 .template value<double>(vars, pos, t, dt);
135 auto const velocity =
138 .template value<Eigen::Vector3d>(vars, pos, t, dt);
141 auto const thermal_conductivity =
146 .value(vars, pos, t, dt));
148 auto thermal_conductivity_dispersivity = thermal_conductivity;
150 double const velocity_magnitude = velocity.norm();
152 if (velocity_magnitude >= std::numeric_limits<double>::epsilon())
154 auto const thermal_dispersivity_longitudinal =
157 thermal_longitudinal_dispersivity)
158 .
template value<double>();
159 auto const thermal_dispersivity_transversal =
162 thermal_transversal_dispersivity)
163 .
template value<double>();
165 auto const thermal_dispersivity =
166 density_f * heat_capacity_f *
167 (thermal_dispersivity_transversal * velocity_magnitude *
168 Eigen::Matrix3d::Identity() +
169 (thermal_dispersivity_longitudinal -
170 thermal_dispersivity_transversal) /
171 velocity_magnitude * velocity * velocity.transpose());
172 thermal_conductivity_dispersivity += thermal_dispersivity;
177 (dNdx.transpose() * thermal_conductivity_dispersivity * dNdx +
178 N.transpose() * velocity.transpose() * dNdx * density_f *
183 local_M.noalias() += N.transpose() * N * w *
184 (density_s * heat_capacity_s * (1 - porosity) +
185 density_f * heat_capacity_f * porosity);
188 if (_process_data._mass_lumping)
191 if (_process_data.mass_lumping_soil_elements[_element_id])
193 local_M = local_M.colwise().sum().eval().asDiagonal();
206 double const t,
double const dt, std::vector<double>
const& local_x,
207 std::vector<double>
const& local_x_prev,
208 std::vector<double>& local_rhs_data, std::vector<double>& local_Jac_data)
210 assert(local_x.size() == ShapeFunction::NPOINTS);
211 auto const local_matrix_size = local_x.size();
214 Eigen::Map<NodalVectorType const>(local_x.data(), local_matrix_size);
215 auto x_prev = Eigen::Map<NodalVectorType const>(local_x_prev.data(),
219 local_Jac_data, local_matrix_size, local_matrix_size);
221 local_rhs_data, local_matrix_size);
223 std::vector<double> local_M_data;
224 std::vector<double> local_K_data;
225 assemble(t, dt, local_x, local_x_prev, local_M_data, local_K_data,
230 local_M_data, local_matrix_size, local_matrix_size);
232 local_K_data, local_matrix_size, local_matrix_size);
235 local_Jac.noalias() += local_K + local_M / dt;
236 local_rhs.noalias() -= local_K * x + local_M * (x - x_prev) / dt;