27 double const t,
double const dt, Eigen::VectorXd
const& local_x,
28 Eigen::VectorXd
const& local_x_prev,
int const process_id,
29 std::vector<double>& local_M_data, std::vector<double>& local_K_data,
30 std::vector<double>& local_b_data)
32 if (process_id == this->_process_data.heat_transport_process_id)
34 assembleHeatTransportEquation(t, dt, local_x, local_M_data,
39 assembleHydraulicEquation(t, dt, local_x, local_x_prev, local_M_data,
40 local_K_data, local_b_data);
45 double const t,
double const dt, Eigen::VectorXd
const& local_x,
46 Eigen::VectorXd
const& local_x_prev, std::vector<double>& local_M_data,
47 std::vector<double>& local_K_data, std::vector<double>& local_b_data)
50 local_x.template segment<pressure_size>(pressure_index);
52 local_x.template segment<temperature_size>(temperature_index);
54 auto const local_T_prev =
55 local_x_prev.template segment<temperature_size>(temperature_index);
58 local_M_data, pressure_size, pressure_size);
60 local_K_data, pressure_size, pressure_size);
67 auto const& process_data = this->_process_data;
69 *this->_process_data.media_map.getMedium(this->_element.getID());
70 auto const& liquid_phase = medium.phase(
"AqueousLiquid");
71 auto const& solid_phase = medium.phase(
"Solid");
75 .projected_specific_body_force_vectors[this->_element.getID()];
79 unsigned const n_integration_points =
80 this->_integration_method.getNumberOfPoints();
83 process_data.shape_matrix_cache
84 .template NsHigherOrder<typename ShapeFunction::MeshElement>();
86 for (
unsigned ip(0); ip < n_integration_points; ip++)
90 auto const& ip_data = this->_ip_data[ip];
91 auto const& dNdx = ip_data.dNdx;
92 auto const& N = Ns[ip];
93 auto const& w = ip_data.integration_weight;
95 double p_int_pt = 0.0;
96 double T_int_pt = 0.0;
105 auto const porosity =
107 .template value<double>(vars, pos, t, dt);
108 auto const fluid_density =
110 .template value<double>(vars, pos, t, dt);
113 const double dfluid_density_dp =
115 .template dValue<double>(
120 auto const viscosity =
122 .template value<double>(vars, pos, t, dt);
126 auto const specific_storage =
128 .template value<double>(vars, pos, t, dt);
130 auto const intrinsic_permeability =
133 .value(vars, pos, t, dt));
135 intrinsic_permeability / viscosity;
140 (porosity * dfluid_density_dp / fluid_density + specific_storage) *
143 local_K.noalias() += w * dNdx.transpose() * K_over_mu * dNdx;
145 if (process_data.has_gravity)
148 w * fluid_density * dNdx.transpose() * K_over_mu * b;
151 if (!process_data.has_fluid_thermal_expansion)
158 auto const solid_thermal_expansion =
159 process_data.solid_thermal_expansion(t, pos)[0];
160 const double dfluid_density_dT =
163 .template dValue<double>(
166 double const Tdot_int_pt = (T_int_pt - local_T_prev.dot(N)) / dt;
167 auto const biot_constant = process_data.biot_constant(t, pos)[0];
168 const double eff_thermal_expansion =
169 3.0 * (biot_constant - porosity) * solid_thermal_expansion -
170 porosity * dfluid_density_dT / fluid_density;
171 local_b.noalias() += eff_thermal_expansion * Tdot_int_pt * w * N;
180 Eigen::VectorXd
const& local_x,
181 std::vector<double>& local_M_data,
182 std::vector<double>& local_K_data)
185 local_x.template segment<pressure_size>(pressure_index);
187 local_x.template segment<temperature_size>(temperature_index);
190 local_M_data, temperature_size, temperature_size);
192 local_K_data, temperature_size, temperature_size);
197 auto const& process_data = this->_process_data;
199 *process_data.media_map.getMedium(this->_element.getID());
200 auto const& liquid_phase = medium.phase(
"AqueousLiquid");
204 .projected_specific_body_force_vectors[this->_element.getID()];
208 unsigned const n_integration_points =
209 this->_integration_method.getNumberOfPoints();
211 std::vector<GlobalDimVectorType> ip_flux_vector;
212 double average_velocity_norm = 0.0;
213 ip_flux_vector.reserve(n_integration_points);
216 process_data.shape_matrix_cache
217 .template NsHigherOrder<typename ShapeFunction::MeshElement>();
219 for (
unsigned ip(0); ip < n_integration_points; ip++)
223 auto const& ip_data = this->_ip_data[ip];
224 auto const& dNdx = ip_data.dNdx;
225 auto const& N = Ns[ip];
226 auto const& w = ip_data.integration_weight;
238 auto const porosity =
240 .template value<double>(vars, pos, t, dt);
244 auto const fluid_density =
246 .template value<double>(vars, pos, t, dt);
248 auto const specific_heat_capacity_fluid =
250 .template value<double>(vars, pos, t, dt);
253 local_M.noalias() += w *
254 this->getHeatEnergyCoefficient(
255 vars, porosity, fluid_density,
256 specific_heat_capacity_fluid, pos, t, dt) *
260 auto const viscosity =
262 .template value<double>(vars, pos, t, dt);
264 auto const intrinsic_permeability =
267 .value(vars, pos, t, dt));
270 intrinsic_permeability / viscosity;
272 process_data.has_gravity
274 (dNdx * local_p - fluid_density * b))
278 this->getThermalConductivityDispersivity(
279 vars, fluid_density, specific_heat_capacity_fluid, velocity,
283 w * dNdx.transpose() * thermal_conductivity_dispersivity * dNdx;
285 ip_flux_vector.emplace_back(velocity * fluid_density *
286 specific_heat_capacity_fluid);
287 average_velocity_norm += velocity.norm();
291 process_data.stabilizer, this->_ip_data,
292 process_data.shape_matrix_cache, ip_flux_vector,
293 average_velocity_norm /
static_cast<double>(n_integration_points),
301 std::vector<GlobalVector*>
const& x,
302 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
303 std::vector<double>& cache)
const
305 assert(x.size() == dof_table.size());
306 auto const n_processes = dof_table.size();
308 std::vector<std::vector<GlobalIndexType>> indices_of_all_coupled_processes;
309 indices_of_all_coupled_processes.reserve(n_processes);
310 for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
314 assert(!indices.empty());
315 indices_of_all_coupled_processes.push_back(indices);
317 auto const local_xs =
320 return this->getIntPtDarcyVelocityLocal(t, local_xs, cache);
void assembleForStaggeredScheme(double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data) override
void assembleHydraulicEquation(double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)