62 std::vector<double>
const& local_x,
63 std::vector<double>
const& local_x_prev,
64 std::vector<double>& local_M_data,
65 std::vector<double>& local_K_data,
66 std::vector<double>& local_b_data)
override
68 auto const local_matrix_size = local_x.size();
71 assert(local_matrix_size == ShapeFunction::NPOINTS *
NUM_NODAL_DOF);
74 local_M_data, local_matrix_size, local_matrix_size);
76 local_K_data, local_matrix_size, local_matrix_size);
78 local_b_data, local_matrix_size);
80 auto KTT = local_K.template block<temperature_size, temperature_size>(
82 auto MTT = local_M.template block<temperature_size, temperature_size>(
84 auto Kpp = local_K.template block<pressure_size, pressure_size>(
86 auto Mpp = local_M.template block<pressure_size, pressure_size>(
88 auto Bp = local_b.template block<pressure_size, 1>(
pressure_index, 0);
92 auto p_nodal_values = Eigen::Map<const NodalVectorType>(
96 *process_data.media_map.getMedium(this->
_element.getID());
97 auto const& liquid_phase =
99 auto const& solid_phase =
104 .projected_specific_body_force_vectors[this->
_element.getID()];
108 unsigned const n_integration_points =
111 std::vector<GlobalDimVectorType> ip_flux_vector;
112 double average_velocity_norm = 0.0;
113 ip_flux_vector.reserve(n_integration_points);
116 process_data.shape_matrix_cache
117 .template NsHigherOrder<typename ShapeFunction::MeshElement>();
119 for (
unsigned ip(0); ip < n_integration_points; ip++)
121 auto const& ip_data = this->
_ip_data[ip];
122 auto const& dNdx = ip_data.dNdx;
123 auto const& N = Ns[ip];
124 auto const& w = ip_data.integration_weight;
127 std::nullopt, this->
_element.getID(),
133 double T_int_pt = 0.0;
134 double p_int_pt = 0.0;
144 auto const specific_storage =
146 .template value<double>(vars, pos, t, dt);
148 auto const porosity =
150 .template value<double>(vars, pos, t, dt);
153 auto const intrinsic_permeability =
158 .value(vars, pos, t, dt));
160 auto const specific_heat_capacity_fluid =
163 .template value<double>(vars, pos, t, dt);
166 auto const fluid_density =
169 .template value<double>(vars, pos, t, dt);
172 const double dfluid_density_dp =
175 .template dValue<double>(
181 auto const viscosity =
184 .template value<double>(vars, pos, t, dt);
188 process_data.has_gravity
196 vars, fluid_density, specific_heat_capacity_fluid, velocity,
200 dNdx.transpose() * thermal_conductivity_dispersivity * dNdx * w;
202 ip_flux_vector.emplace_back(velocity * fluid_density *
203 specific_heat_capacity_fluid);
204 average_velocity_norm += velocity.norm();
206 Kpp.noalias() += w * dNdx.transpose() * K_over_mu * dNdx;
209 vars, porosity, fluid_density,
210 specific_heat_capacity_fluid, pos, t, dt) *
213 (porosity * dfluid_density_dp / fluid_density +
216 if (process_data.has_gravity)
218 Bp += w * fluid_density * dNdx.transpose() * K_over_mu * b;
221 if (process_data.has_fluid_thermal_expansion)
223 double const solid_thermal_expansion =
224 process_data.solid_thermal_expansion(t, pos)[0];
225 double const dfluid_density_dT =
228 .template dValue<double>(
231 double const Tdot_int_pt =
233 Eigen::Map<const NodalVectorType>(
237 double const biot_constant =
238 process_data.biot_constant(t, pos)[0];
239 double const eff_thermal_expansion =
240 3.0 * (biot_constant - porosity) * solid_thermal_expansion -
241 porosity * dfluid_density_dT / fluid_density;
242 Bp.noalias() += eff_thermal_expansion * Tdot_int_pt * w * N;
247 process_data.stabilizer, this->_ip_data,
248 process_data.shape_matrix_cache, ip_flux_vector,
249 average_velocity_norm /
static_cast<double>(n_integration_points),