71 double const t,
double const dt, std::vector<double>
const& local_x,
72 std::vector<double>
const& ,
73 std::vector<double>& local_M_data, std::vector<double>& local_K_data,
74 std::vector<double>& )
76 assert(local_x.size() == ShapeFunction::NPOINTS);
80 local_M_data, ShapeFunction::NPOINTS, ShapeFunction::NPOINTS);
82 local_K_data, ShapeFunction::NPOINTS, ShapeFunction::NPOINTS);
87 auto const& medium = *_process_data.media_map.getMedium(_element_id);
88 auto const& solid_phase = medium.phase(
"Solid");
89 auto const& liquid_phase = medium.phase(
"AqueousLiquid");
93 unsigned const n_integration_points =
94 _integration_method.getNumberOfPoints();
96 for (
unsigned ip = 0; ip < n_integration_points; ip++)
99 auto& ip_data = _ip_data[ip];
100 auto const& N = ip_data.N;
101 auto const& dNdx = ip_data.dNdx;
102 auto const& w = ip_data.integration_weight;
104 double T_int_pt = 0.0;
110 auto const density_s =
112 .template value<double>(vars, pos, t, dt);
114 auto const heat_capacity_s =
118 .template value<double>(vars, pos, t, dt);
120 auto const density_f =
122 .template value<double>(vars, pos, t, dt);
124 auto const heat_capacity_f =
128 .template value<double>(vars, pos, t, dt);
130 auto const porosity =
132 .template value<double>(vars, pos, t, dt);
134 auto const velocity =
137 .template value<Eigen::Vector3d>(vars, pos, t, dt);
140 auto const thermal_conductivity =
145 .value(vars, pos, t, dt));
147 auto thermal_conductivity_dispersivity = thermal_conductivity;
149 double const velocity_magnitude = velocity.norm();
151 if (velocity_magnitude >= std::numeric_limits<double>::epsilon())
153 auto const thermal_dispersivity_longitudinal =
156 thermal_longitudinal_dispersivity)
157 .template value<double>();
158 auto const thermal_dispersivity_transversal =
161 thermal_transversal_dispersivity)
162 .template value<double>();
164 auto const thermal_dispersivity =
165 density_f * heat_capacity_f *
166 (thermal_dispersivity_transversal * velocity_magnitude *
167 Eigen::Matrix3d::Identity() +
168 (thermal_dispersivity_longitudinal -
169 thermal_dispersivity_transversal) /
170 velocity_magnitude * velocity * velocity.transpose());
171 thermal_conductivity_dispersivity += thermal_dispersivity;
176 (dNdx.transpose() * thermal_conductivity_dispersivity * dNdx +
177 N.transpose() * velocity.transpose() * dNdx * density_f *
182 local_M.noalias() += N.transpose() * N * w *
183 (density_s * heat_capacity_s * (1 - porosity) +
184 density_f * heat_capacity_f * porosity);
196 double const t,
double const dt, std::vector<double>
const& local_x,
197 std::vector<double>
const& local_x_prev,
198 std::vector<double>& local_rhs_data, std::vector<double>& local_Jac_data)
200 assert(local_x.size() == ShapeFunction::NPOINTS);
201 auto const local_matrix_size = local_x.size();
204 Eigen::Map<NodalVectorType const>(local_x.data(), local_matrix_size);
205 auto x_prev = Eigen::Map<NodalVectorType const>(local_x_prev.data(),
209 local_Jac_data, local_matrix_size, local_matrix_size);
211 local_rhs_data, local_matrix_size);
213 std::vector<double> local_M_data;
214 std::vector<double> local_K_data;
215 assemble(t, dt, local_x, local_x_prev, local_M_data, local_K_data,
220 local_M_data, local_matrix_size, local_matrix_size);
222 local_K_data, local_matrix_size, local_matrix_size);
225 local_Jac.noalias() += local_K + local_M / dt;
226 local_rhs.noalias() -= local_K * x + local_M * (x - x_prev) / dt;