62 double const t,
double const dt, std::vector<double>
const& local_x,
63 std::vector<double>
const& ,
64 std::vector<double>& local_M_data, std::vector<double>& local_K_data,
65 std::vector<double>& local_b_data)
67 auto const local_matrix_size = local_x.size();
70 assert(local_matrix_size == ShapeFunction::NPOINTS *
NUM_NODAL_DOF);
73 local_M_data, local_matrix_size, local_matrix_size);
75 local_K_data, local_matrix_size, local_matrix_size);
77 local_b_data, local_matrix_size);
79 unsigned const n_integration_points =
80 _integration_method.getNumberOfPoints();
85 auto p_nodal_values = Eigen::Map<const NodalVectorType>(
86 &local_x[pressure_index], pressure_size);
88 auto const& b = _process_data.specific_body_force;
93 GlobalDimMatrixType::Identity(GlobalDim, GlobalDim));
96 auto const& medium = *_process_data.media_map.getMedium(_element_id);
97 auto const& phase = medium.phase(
"AqueousLiquid");
98 auto const& component =
99 phase.component(_transport_process_variable.getName());
101 auto KCC = local_K.template block<concentration_size, concentration_size>(
102 concentration_index, concentration_index);
103 auto MCC = local_M.template block<concentration_size, concentration_size>(
104 concentration_index, concentration_index);
105 auto Kpp = local_K.template block<pressure_size, pressure_size>(
106 pressure_index, pressure_index);
107 auto Mpp = local_M.template block<pressure_size, pressure_size>(
108 pressure_index, pressure_index);
109 auto Bp = local_b.template block<pressure_size, 1>(pressure_index, 0);
111 for (std::size_t ip(0); ip < n_integration_points; ++ip)
115 auto const& ip_data = _ip_data[ip];
116 auto const& N = ip_data.N;
117 auto const& dNdx = ip_data.dNdx;
118 auto const& w = ip_data.integration_weight;
120 double C_int_pt = 0.0;
121 double p_int_pt = 0.0;
127 .template value<double>(vars, pos, t, dt);
129 double const dSw_dpc =
131 .template dValue<double>(
143 auto const specific_storage =
145 .template value<double>(vars, pos, t, dt);
148 auto const porosity =
150 .template value<double>(vars, pos, t, dt);
152 auto const retardation_factor =
154 .template value<double>(vars, pos, t, dt);
156 auto const solute_dispersivity_transverse =
158 .template value<double>(vars, pos, t, dt);
159 auto const solute_dispersivity_longitudinal =
161 .template value<double>(vars, pos, t, dt);
165 .template value<double>(vars, pos, t, dt);
168 auto const decay_rate =
170 .template value<double>(vars, pos, t, dt);
171 auto const pore_diffusion_coefficient =
174 .value(vars, pos, t, dt));
182 .template value<double>(vars, pos, t, dt);
185 .template value<double>(vars, pos, t, dt);
186 auto const K_times_k_rel_over_mu = K * (k_rel / mu);
189 _process_data.has_gravity
191 (dNdx * p_nodal_values - density * b))
195 double const velocity_magnitude = velocity.norm();
197 velocity_magnitude != 0.0
199 porosity * pore_diffusion_coefficient +
200 solute_dispersivity_transverse * velocity_magnitude * I +
201 (solute_dispersivity_longitudinal -
202 solute_dispersivity_transverse) /
203 velocity_magnitude * velocity * velocity.transpose())
205 solute_dispersivity_transverse *
206 velocity_magnitude * I);
210 (dNdx.transpose() * hydrodynamic_dispersion * dNdx +
211 N.transpose() * velocity.transpose() * dNdx +
212 N.transpose() * decay_rate * porosity * retardation_factor * N) *
214 MCC.noalias() += w * N.transpose() * porosity * retardation_factor * N;
215 Kpp.noalias() += w * dNdx.transpose() * K_times_k_rel_over_mu * dNdx;
217 double const drhow_dp(0.0);
218 Mpp.noalias() += (specific_storage * Sw + porosity * Sw * drhow_dp -
219 porosity * dSw_dpc) *
220 ip_data.mass_operator;
222 if (_process_data.has_gravity)
224 Bp += w * density * dNdx.transpose() * K_times_k_rel_over_mu * b;
235 std::vector<GlobalVector*>
const& x,
236 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
237 std::vector<double>& cache)
const
239 unsigned const n_integration_points =
240 _integration_method.getNumberOfPoints();
242 constexpr int process_id = 0;
245 assert(!indices.empty());
246 auto const local_x = x[process_id]->get(indices);
250 Eigen::Matrix<double, GlobalDim, Eigen::Dynamic, Eigen::RowMajor>>(
251 cache, GlobalDim, n_integration_points);
259 auto const& medium = *_process_data.media_map.getMedium(_element_id);
260 auto const& phase = medium.phase(
"AqueousLiquid");
262 auto const p_nodal_values = Eigen::Map<const NodalVectorType>(
263 &local_x[ShapeFunction::NPOINTS], ShapeFunction::NPOINTS);
265 for (
unsigned ip = 0; ip < n_integration_points; ++ip)
267 auto const& ip_data = _ip_data[ip];
268 auto const& N = ip_data.N;
269 auto const& dNdx = ip_data.dNdx;
271 pos.setIntegrationPoint(ip);
273 auto const dt = std::numeric_limits<double>::quiet_NaN();
278 .template value<double>(vars, pos, t, dt);
280 double C_int_pt = 0.0;
281 double p_int_pt = 0.0;
287 .template value<double>(vars, pos, t, dt);
292 .template value<double>(vars, pos, t, dt);
294 cache_mat.col(ip).noalias() = -dNdx * p_nodal_values;
295 if (_process_data.has_gravity)
300 .template value<double>(vars, pos, t, dt);
301 auto const b = _process_data.specific_body_force;
303 cache_mat.col(ip).noalias() += rho_w * b;
305 cache_mat.col(ip).noalias() = k_rel / mu * (K * cache_mat.col(ip));
325 std::vector<GlobalVector*>
const& x,
326 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
327 std::vector<double>& cache)
const
334 auto const& medium = *_process_data.media_map.getMedium(_element_id);
336 unsigned const n_integration_points =
337 _integration_method.getNumberOfPoints();
339 constexpr int process_id = 0;
342 assert(!indices.empty());
343 auto const local_x = x[process_id]->get(indices);
347 Eigen::Matrix<double, 1, Eigen::Dynamic, Eigen::RowMajor>>(
348 cache, n_integration_points);
350 for (
unsigned ip = 0; ip < n_integration_points; ++ip)
352 auto const& ip_data = _ip_data[ip];
353 auto const& N = ip_data.N;
355 double C_int_pt = 0.0;
356 double p_int_pt = 0.0;
361 auto const dt = std::numeric_limits<double>::quiet_NaN();
363 .template value<double>(vars, pos, t, dt);