Loading [MathJax]/extensions/tex2jax.js
OGS
ComponentTransportFEM.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <numeric>
14#include <vector>
15
36
37namespace ProcessLib
38{
39namespace ComponentTransport
40{
41template <typename GlobalDimNodalMatrixType>
43{
44 IntegrationPointData(GlobalDimNodalMatrixType const& dNdx_,
45 double const& integration_weight_)
46 : dNdx(dNdx_), integration_weight(integration_weight_)
47 {
48 }
49
51 GlobalDimNodalMatrixType const dNdx;
52 double const integration_weight;
53
54 // -1 indicates that no chemical reaction takes place in the element to
55 // which the integration point belongs.
57
58 double porosity = std::numeric_limits<double>::quiet_NaN();
59 double porosity_prev = std::numeric_limits<double>::quiet_NaN();
61};
62
66{
67public:
69
70 virtual void setChemicalSystemID(std::size_t const /*mesh_item_id*/) = 0;
71
73 std::size_t const mesh_item_id,
74 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_tables,
75 std::vector<GlobalVector*> const& x, double const t)
76 {
77 std::vector<double> local_x_vec;
78
79 auto const n_processes = x.size();
80 for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
81 {
82 auto const indices =
83 NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
84 assert(!indices.empty());
85 auto const local_solution = x[process_id]->get(indices);
86 local_x_vec.insert(std::end(local_x_vec),
87 std::begin(local_solution),
88 std::end(local_solution));
89 }
90 auto const local_x = MathLib::toVector(local_x_vec);
91
93 }
94
96 std::size_t const mesh_item_id,
97 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_tables,
98 std::vector<GlobalVector*> const& x, double const t, double const dt)
99 {
100 std::vector<double> local_x_vec;
101
102 auto const n_processes = x.size();
103 for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
104 {
105 auto const indices =
106 NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
107 assert(!indices.empty());
108 auto const local_solution = x[process_id]->get(indices);
109 local_x_vec.insert(std::end(local_x_vec),
110 std::begin(local_solution),
111 std::end(local_solution));
112 }
113 auto const local_x = MathLib::toVector(local_x_vec);
114
115 setChemicalSystemConcrete(local_x, t, dt);
116 }
117
119 std::size_t const mesh_item_id,
120 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_tables,
121 std::vector<GlobalVector*> const& x, double const t, double const dt,
122 GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b, int const process_id)
123 {
124 std::vector<double> local_x_vec;
125
126 auto const n_processes = x.size();
127 for (std::size_t pcs_id = 0; pcs_id < n_processes; ++pcs_id)
128 {
129 auto const indices =
130 NumLib::getIndices(mesh_item_id, *dof_tables[pcs_id]);
131 assert(!indices.empty());
132 auto const local_solution = x[pcs_id]->get(indices);
133 local_x_vec.insert(std::end(local_x_vec),
134 std::begin(local_solution),
135 std::end(local_solution));
136 }
137 auto const local_x = MathLib::toVector(local_x_vec);
138
139 auto const indices =
140 NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
141 auto const num_r_c = indices.size();
142
143 std::vector<double> local_M_data;
144 local_M_data.reserve(num_r_c * num_r_c);
145 std::vector<double> local_K_data;
146 local_K_data.reserve(num_r_c * num_r_c);
147 std::vector<double> local_b_data;
148 local_b_data.reserve(num_r_c);
149
150 assembleReactionEquationConcrete(t, dt, local_x, local_M_data,
151 local_K_data, local_b_data,
152 process_id);
153
154 auto const r_c_indices =
156 if (!local_M_data.empty())
157 {
158 auto const local_M =
159 MathLib::toMatrix(local_M_data, num_r_c, num_r_c);
160 M.add(r_c_indices, local_M);
161 }
162 if (!local_K_data.empty())
163 {
164 auto const local_K =
165 MathLib::toMatrix(local_K_data, num_r_c, num_r_c);
166 K.add(r_c_indices, local_K);
167 }
168 if (!local_b_data.empty())
169 {
170 b.add(indices, local_b_data);
171 }
172 }
173
174 virtual void postSpeciationCalculation(std::size_t const ele_id,
175 double const t, double const dt) = 0;
176
178 std::size_t const ele_id) = 0;
179
180 virtual std::vector<double> const& getIntPtDarcyVelocity(
181 const double t,
182 std::vector<GlobalVector*> const& x,
183 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
184 std::vector<double>& cache) const = 0;
185
186 virtual std::vector<double> const& getIntPtMolarFlux(
187 const double t, std::vector<GlobalVector*> const& x,
188 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
189 std::vector<double>& cache, int const component_id) const = 0;
190
191private:
193 Eigen::VectorXd const& /*local_x*/, double const /*t*/) = 0;
194
195 virtual void setChemicalSystemConcrete(Eigen::VectorXd const& /*local_x*/,
196 double const /*t*/,
197 double const /*dt*/) = 0;
198
200 double const t, double const dt, Eigen::VectorXd const& local_x,
201 std::vector<double>& local_M_data, std::vector<double>& local_K_data,
202 std::vector<double>& local_b_data, int const transport_process_id) = 0;
203};
204
205template <typename ShapeFunction, int GlobalDim>
207{
208 // When monolithic scheme is adopted, nodal pressure and nodal concentration
209 // are accessed by vector index.
210 static const int pressure_index = 0;
211 const int temperature_index = -1;
213
214 static const int pressure_size = ShapeFunction::NPOINTS;
215 static const int temperature_size = ShapeFunction::NPOINTS;
216 static const int concentration_size =
217 ShapeFunction::NPOINTS; // per component
218
221
223 typename ShapeMatricesType::template MatrixType<pressure_size,
226 typename ShapeMatricesType::template VectorType<pressure_size>;
227
229 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
230 using LocalVectorType = Eigen::Matrix<double, Eigen::Dynamic, 1>;
231
234
239
240public:
242 MeshLib::Element const& element,
243 std::size_t const local_matrix_size,
244 NumLib::GenericIntegrationMethod const& integration_method,
245 bool is_axially_symmetric,
246 ComponentTransportProcessData const& process_data,
247 std::vector<std::reference_wrapper<ProcessVariable>> const&
248 transport_process_variables)
249 : temperature_index(process_data.isothermal ? -1
250 : ShapeFunction::NPOINTS),
251 first_concentration_index(process_data.isothermal
252 ? ShapeFunction::NPOINTS
253 : 2 * ShapeFunction::NPOINTS),
254 _element(element),
255 _process_data(process_data),
256 _integration_method(integration_method),
257 _transport_process_variables(transport_process_variables)
258 {
259 (void)local_matrix_size;
260
261 unsigned const n_integration_points =
263 _ip_data.reserve(n_integration_points);
264
267
268 double const aperture_size = _process_data.aperture_size(0.0, pos)[0];
269
270 auto const shape_matrices =
272 GlobalDim>(element, is_axially_symmetric,
274 auto const& medium =
276 for (unsigned ip = 0; ip < n_integration_points; ip++)
277 {
278 _ip_data.emplace_back(
279 shape_matrices[ip].dNdx,
281 shape_matrices[ip].integralMeasure *
282 shape_matrices[ip].detJ * aperture_size);
283
284 _ip_data[ip].porosity =
286 .template initialValue<double>(
287 pos, std::numeric_limits<double>::quiet_NaN() /*t*/);
288
289 _ip_data[ip].pushBackState();
290 }
291 }
292
293 void setChemicalSystemID(std::size_t const /*mesh_item_id*/) override
294 {
296 // chemical system index map
297 auto& chemical_system_index_map =
299
300 unsigned const n_integration_points =
302 for (unsigned ip = 0; ip < n_integration_points; ip++)
303 {
304 _ip_data[ip].chemical_system_id =
305 chemical_system_index_map.empty()
306 ? 0
307 : chemical_system_index_map.back() + 1;
308 chemical_system_index_map.push_back(
309 _ip_data[ip].chemical_system_id);
310 }
311 }
312
313 void initializeChemicalSystemConcrete(Eigen::VectorXd const& local_x,
314 double const t) override
315 {
317
318 auto const& medium =
320
323
324 auto const& Ns =
326 .NsHigherOrder<typename ShapeFunction::MeshElement>();
327
328 unsigned const n_integration_points =
330
331 for (unsigned ip = 0; ip < n_integration_points; ip++)
332 {
333 auto& ip_data = _ip_data[ip];
334 auto const& N = Ns[ip];
335 auto const& chemical_system_id = ip_data.chemical_system_id;
336
337 auto const n_component = _transport_process_variables.size();
338 std::vector<double> C_int_pt(n_component);
339 for (unsigned component_id = 0; component_id < n_component;
340 ++component_id)
341 {
342 auto const concentration_index =
344 component_id * concentration_size;
345 auto const local_C =
346 local_x.template segment<concentration_size>(
347 concentration_index);
348
350 C_int_pt[component_id]);
351 }
352
354 ->initializeChemicalSystemConcrete(C_int_pt, chemical_system_id,
355 medium, pos, t);
356 }
357 }
358
359 void setChemicalSystemConcrete(Eigen::VectorXd const& local_x,
360 double const t, double dt) override
361 {
363
364 auto const& medium =
366
369
372
373 auto const& Ns =
375 .NsHigherOrder<typename ShapeFunction::MeshElement>();
376
377 unsigned const n_integration_points =
379
380 for (unsigned ip = 0; ip < n_integration_points; ip++)
381 {
382 auto& ip_data = _ip_data[ip];
383 auto const& N = Ns[ip];
384 auto& porosity = ip_data.porosity;
385 auto const& porosity_prev = ip_data.porosity_prev;
386 auto const& chemical_system_id = ip_data.chemical_system_id;
387
388 auto const n_component = _transport_process_variables.size();
389 std::vector<double> C_int_pt(n_component);
390 for (unsigned component_id = 0; component_id < n_component;
391 ++component_id)
392 {
393 auto const concentration_index =
395 component_id * concentration_size;
396 auto const local_C =
397 local_x.template segment<concentration_size>(
398 concentration_index);
399
401 C_int_pt[component_id]);
402 }
403
404 {
405 vars_prev.porosity = porosity_prev;
406
407 porosity =
409 ? porosity_prev
410 : medium
411 ->property(
413 .template value<double>(vars, vars_prev, pos, t,
414 dt);
415
416 vars.porosity = porosity;
417 }
418
420 C_int_pt, chemical_system_id, medium, vars, pos, t, dt);
421 }
422 }
423
424 void postSpeciationCalculation(std::size_t const ele_id, double const t,
425 double const dt) override
426 {
428 {
429 return;
430 }
431
432 auto const& medium = *_process_data.media_map.getMedium(ele_id);
433
435 pos.setElementID(ele_id);
436
437 for (auto& ip_data : _ip_data)
438 {
439 ip_data.porosity = ip_data.porosity_prev;
440
442 ->updateVolumeFractionPostReaction(ip_data.chemical_system_id,
443 medium, pos,
444 ip_data.porosity, t, dt);
445
447 ip_data.chemical_system_id, medium, ip_data.porosity);
448 }
449 }
450
451 void assemble(double const t, double const dt,
452 std::vector<double> const& local_x,
453 std::vector<double> const& /*local_x_prev*/,
454 std::vector<double>& local_M_data,
455 std::vector<double>& local_K_data,
456 std::vector<double>& local_b_data) override
457 {
458 auto const local_matrix_size = local_x.size();
459 // Nodal DOFs include pressure
460 int const num_nodal_dof = 1 + _transport_process_variables.size();
461 // This assertion is valid only if all nodal d.o.f. use the same shape
462 // matrices.
463 assert(local_matrix_size == ShapeFunction::NPOINTS * num_nodal_dof);
464
466 local_M_data, local_matrix_size, local_matrix_size);
468 local_K_data, local_matrix_size, local_matrix_size);
470 local_b_data, local_matrix_size);
471
472 // Get block matrices
473 auto Kpp = local_K.template block<pressure_size, pressure_size>(
475 auto Mpp = local_M.template block<pressure_size, pressure_size>(
477 auto Bp = local_b.template segment<pressure_size>(pressure_index);
478
479 auto local_p = Eigen::Map<const NodalVectorType>(
480 &local_x[pressure_index], pressure_size);
481
482 auto const& b =
485
486 auto const number_of_components = num_nodal_dof - 1;
487 for (int component_id = 0; component_id < number_of_components;
488 ++component_id)
489 {
490 /* Partitioned assembler matrix
491 * | pp | pc1 | pc2 | pc3 |
492 * |-----|-----|-----|-----|
493 * | c1p | c1c1| 0 | 0 |
494 * |-----|-----|-----|-----|
495 * | c2p | 0 | c2c2| 0 |
496 * |-----|-----|-----|-----|
497 * | c3p | 0 | 0 | c3c3|
498 */
499 auto concentration_index =
500 pressure_size + component_id * concentration_size;
501
502 auto KCC =
503 local_K.template block<concentration_size, concentration_size>(
504 concentration_index, concentration_index);
505 auto MCC =
506 local_M.template block<concentration_size, concentration_size>(
507 concentration_index, concentration_index);
508 auto MCp =
509 local_M.template block<concentration_size, pressure_size>(
510 concentration_index, pressure_index);
511 auto MpC =
512 local_M.template block<pressure_size, concentration_size>(
513 pressure_index, concentration_index);
514
515 auto local_C = Eigen::Map<const NodalVectorType>(
516 &local_x[concentration_index], concentration_size);
517
518 assembleBlockMatrices(b, component_id, t, dt, local_C, local_p, KCC,
519 MCC, MCp, MpC, Kpp, Mpp, Bp);
520
522 {
523 auto const stoichiometric_matrix =
526
527 assert(stoichiometric_matrix);
528
529 for (Eigen::SparseMatrix<double>::InnerIterator it(
530 *stoichiometric_matrix, component_id);
531 it;
532 ++it)
533 {
534 auto const stoichiometric_coefficient = it.value();
535 auto const coupled_component_id = it.row();
536 auto const kinetic_prefactor =
538 ->getKineticPrefactor(coupled_component_id);
539
540 auto const concentration_index =
541 pressure_size + component_id * concentration_size;
542 auto const coupled_concentration_index =
544 coupled_component_id * concentration_size;
545 auto KCmCn = local_K.template block<concentration_size,
547 concentration_index, coupled_concentration_index);
548
549 // account for the coupling between components
550 assembleKCmCn(component_id, t, dt, KCmCn,
551 stoichiometric_coefficient,
552 kinetic_prefactor);
553 }
554 }
555 }
556 }
557
559 GlobalDimVectorType const& b, int const component_id, double const t,
560 double const dt,
561 Eigen::Ref<const NodalVectorType> const& C_nodal_values,
562 Eigen::Ref<const NodalVectorType> const& p_nodal_values,
563 Eigen::Ref<LocalBlockMatrixType> KCC,
564 Eigen::Ref<LocalBlockMatrixType> MCC,
565 Eigen::Ref<LocalBlockMatrixType> MCp,
566 Eigen::Ref<LocalBlockMatrixType> MpC,
567 Eigen::Ref<LocalBlockMatrixType> Kpp,
568 Eigen::Ref<LocalBlockMatrixType> Mpp,
569 Eigen::Ref<LocalSegmentVectorType> Bp)
570 {
571 unsigned const n_integration_points =
573
576
578
579 // Get material properties
580 auto const& medium =
582 // Select the only valid for component transport liquid phase.
583 auto const& phase = medium.phase("AqueousLiquid");
584
585 // Assume that the component name is the same as the process variable
586 // name. Components are shifted by one because the first one is always
587 // pressure.
588 auto const& component = phase.component(
589 _transport_process_variables[component_id].get().getName());
590
591 LocalBlockMatrixType KCC_Laplacian =
592 LocalBlockMatrixType::Zero(concentration_size, concentration_size);
593
594 std::vector<GlobalDimVectorType> ip_flux_vector;
595 double average_velocity_norm = 0.0;
597 {
598 ip_flux_vector.reserve(n_integration_points);
599 }
600
601 auto const& Ns =
603 .NsHigherOrder<typename ShapeFunction::MeshElement>();
604
605 for (unsigned ip(0); ip < n_integration_points; ++ip)
606 {
607 auto& ip_data = _ip_data[ip];
608 auto const& dNdx = ip_data.dNdx;
609 auto const& N = Ns[ip];
610 auto const& w = ip_data.integration_weight;
611 auto& porosity = ip_data.porosity;
612
613 double C_int_pt = 0.0;
614 double p_int_pt = 0.0;
615
616 NumLib::shapeFunctionInterpolate(C_nodal_values, N, C_int_pt);
617 NumLib::shapeFunctionInterpolate(p_nodal_values, N, p_int_pt);
618
619 // set position with N as the shape matrix at the current
620 // integration point
622 NumLib::interpolateCoordinates<ShapeFunction,
624 N)));
625
626 vars.concentration = C_int_pt;
627 vars.liquid_phase_pressure = p_int_pt;
628
629 // update according to a particular porosity model
631 .template value<double>(vars, pos, t, dt);
632 vars.porosity = porosity;
633
634 auto const& retardation_factor =
636 .template value<double>(vars, pos, t, dt);
637
638 auto const& solute_dispersivity_transverse = medium.template value<
639 double>(
641
642 auto const& solute_dispersivity_longitudinal =
643 medium.template value<double>(
645 longitudinal_dispersivity);
646
647 // Use the fluid density model to compute the density
648 // TODO (renchao): concentration of which component as the argument
649 // for calculation of fluid density
650 auto const density =
652 .template value<double>(vars, pos, t, dt);
653
654 auto const decay_rate =
656 .template value<double>(vars, pos, t, dt);
657
658 auto const& pore_diffusion_coefficient =
661 .value(vars, pos, t, dt));
662
665 vars, pos, t, dt));
666
667 // Use the viscosity model to compute the viscosity
669 .template value<double>(vars, pos, t, dt);
670
671 GlobalDimMatrixType const K_over_mu = K / mu;
672 GlobalDimVectorType const velocity =
674 ? GlobalDimVectorType(-K_over_mu *
675 (dNdx * p_nodal_values - density * b))
676 : GlobalDimVectorType(-K_over_mu * dNdx * p_nodal_values);
677
678 const double drho_dp =
680 .template dValue<double>(
681 vars,
683 pos, t, dt);
684
685 const double drho_dC =
687 .template dValue<double>(
689 t, dt);
690
691 GlobalDimMatrixType const hydrodynamic_dispersion =
694 pore_diffusion_coefficient, velocity, porosity,
695 solute_dispersivity_transverse,
696 solute_dispersivity_longitudinal);
697
698 const double R_times_phi(retardation_factor * porosity);
699 GlobalDimVectorType const mass_density_flow = velocity * density;
700 auto const N_t_N = (N.transpose() * N).eval();
701
703 {
704 MCp.noalias() += N_t_N * (C_int_pt * R_times_phi * drho_dp * w);
705 MCC.noalias() += N_t_N * (C_int_pt * R_times_phi * drho_dC * w);
706 KCC.noalias() -= dNdx.transpose() * mass_density_flow * N * w;
707 }
708 else
709 {
710 ip_flux_vector.emplace_back(mass_density_flow);
711 average_velocity_norm += velocity.norm();
712 }
713 MCC.noalias() += N_t_N * (R_times_phi * density * w);
714 KCC.noalias() += N_t_N * (decay_rate * R_times_phi * density * w);
715 KCC_Laplacian.noalias() +=
716 dNdx.transpose() * hydrodynamic_dispersion * dNdx * density * w;
717
718 MpC.noalias() += N_t_N * (porosity * drho_dC * w);
719
720 // Calculate Mpp, Kpp, and bp in the first loop over components
721 if (component_id == 0)
722 {
723 Mpp.noalias() += N_t_N * (porosity * drho_dp * w);
724 Kpp.noalias() +=
725 dNdx.transpose() * K_over_mu * dNdx * (density * w);
726
728 {
729 Bp.noalias() += dNdx.transpose() * K_over_mu * b *
730 (density * density * w);
731 }
732 }
733 }
734
736 {
738 typename ShapeFunction::MeshElement>(
740 _ip_data,
742 ip_flux_vector,
743 average_velocity_norm /
744 static_cast<double>(n_integration_points),
745 KCC_Laplacian);
746 }
747
748 KCC.noalias() += KCC_Laplacian;
749 }
750
751 void assembleKCmCn(int const component_id, double const t, double const dt,
752 Eigen::Ref<LocalBlockMatrixType> KCmCn,
753 double const stoichiometric_coefficient,
754 double const kinetic_prefactor)
755 {
756 unsigned const n_integration_points =
758
761
763
764 auto const& medium =
766 auto const& phase = medium.phase("AqueousLiquid");
767 auto const& component = phase.component(
768 _transport_process_variables[component_id].get().getName());
769
770 auto const& Ns =
772 .NsHigherOrder<typename ShapeFunction::MeshElement>();
773
774 for (unsigned ip(0); ip < n_integration_points; ++ip)
775 {
776 auto& ip_data = _ip_data[ip];
777 auto const& w = ip_data.integration_weight;
778 auto const& N = Ns[ip];
779 auto& porosity = ip_data.porosity;
780
781 // set position with N as the shape matrix at the current
782 // integration point
784 NumLib::interpolateCoordinates<ShapeFunction,
786 N)));
787
788 auto const retardation_factor =
790 .template value<double>(vars, pos, t, dt);
791
793 .template value<double>(vars, pos, t, dt);
794
795 auto const density =
797 .template value<double>(vars, pos, t, dt);
798
799 KCmCn.noalias() -= w * N.transpose() * stoichiometric_coefficient *
800 kinetic_prefactor * retardation_factor *
801 porosity * density * N;
802 }
803 }
804
805 void assembleForStaggeredScheme(double const t, double const dt,
806 Eigen::VectorXd const& local_x,
807 Eigen::VectorXd const& local_x_prev,
808 int const process_id,
809 std::vector<double>& local_M_data,
810 std::vector<double>& local_K_data,
811 std::vector<double>& local_b_data) override
812 {
813 if (process_id == _process_data.hydraulic_process_id)
814 {
815 assembleHydraulicEquation(t, dt, local_x, local_x_prev,
816 local_M_data, local_K_data, local_b_data);
817 }
818 else if (process_id == _process_data.thermal_process_id)
819 {
820 assembleHeatTransportEquation(t, dt, local_x, local_x_prev,
821 local_M_data, local_K_data,
822 local_b_data);
823 }
824 else
825 {
826 // Go for assembling in an order of transport process id.
827 assembleComponentTransportEquation(t, dt, local_x, local_x_prev,
828 local_M_data, local_K_data,
829 local_b_data, process_id);
830 }
831 }
832
833 void assembleHydraulicEquation(double const t,
834 double const dt,
835 Eigen::VectorXd const& local_x,
836 Eigen::VectorXd const& local_x_prev,
837 std::vector<double>& local_M_data,
838 std::vector<double>& local_K_data,
839 std::vector<double>& local_b_data)
840 {
841 auto const local_p =
842 local_x.template segment<pressure_size>(pressure_index);
843 auto const local_C = local_x.template segment<concentration_size>(
845 auto const local_C_prev =
846 local_x_prev.segment<concentration_size>(first_concentration_index);
847
848 NodalVectorType local_T = getLocalTemperature(t, local_x);
849
851 local_M_data, pressure_size, pressure_size);
853 local_K_data, pressure_size, pressure_size);
855 local_b_data, pressure_size);
856
857 unsigned const n_integration_points =
859
862
863 auto const& b =
866
867 auto const& medium =
869 auto const& phase = medium.phase("AqueousLiquid");
870
873
874 auto const& Ns =
876 .NsHigherOrder<typename ShapeFunction::MeshElement>();
877
878 for (unsigned ip(0); ip < n_integration_points; ++ip)
879 {
880 auto& ip_data = _ip_data[ip];
881 auto const& dNdx = ip_data.dNdx;
882 auto const& w = ip_data.integration_weight;
883 auto const& N = Ns[ip];
884 auto& porosity = ip_data.porosity;
885 auto const& porosity_prev = ip_data.porosity_prev;
886
887 double const C_int_pt = N.dot(local_C);
888 double const p_int_pt = N.dot(local_p);
889 double const T_int_pt = N.dot(local_T);
890
891 vars.concentration = C_int_pt;
892 vars.liquid_phase_pressure = p_int_pt;
893 vars.temperature = T_int_pt;
894
895 // porosity
896 {
897 vars_prev.porosity = porosity_prev;
898
899 porosity =
901 ? porosity_prev
903 .template value<double>(vars, vars_prev, pos, t,
904 dt);
905
906 vars.porosity = porosity;
907 }
908
909 // Use the fluid density model to compute the density
910 // TODO: Concentration of which component as one of arguments for
911 // calculation of fluid density
912 auto const density =
914 .template value<double>(vars, pos, t, dt);
915
918 vars, pos, t, dt));
919
920 // Use the viscosity model to compute the viscosity
922 .template value<double>(vars, pos, t, dt);
923
924 GlobalDimMatrixType const K_over_mu = K / mu;
925
926 const double drho_dp =
928 .template dValue<double>(
929 vars,
931 pos, t, dt);
932 const double drho_dC =
934 .template dValue<double>(
936 t, dt);
937
938 // matrix assembly
939 local_M.noalias() += w * N.transpose() * porosity * drho_dp * N;
940 local_K.noalias() +=
941 w * dNdx.transpose() * density * K_over_mu * dNdx;
942
944 {
945 local_b.noalias() +=
946 w * density * density * dNdx.transpose() * K_over_mu * b;
947 }
948
949 // coupling term
950 {
951 double const C_dot = (C_int_pt - N.dot(local_C_prev)) / dt;
952
953 local_b.noalias() -=
954 w * N.transpose() * porosity * drho_dC * C_dot;
955 }
956 }
957 }
958
959 void assembleHeatTransportEquation(double const t, double const dt,
960 Eigen::VectorXd const& local_x,
961 Eigen::VectorXd const& /*local_x_prev*/,
962 std::vector<double>& local_M_data,
963 std::vector<double>& local_K_data,
964 std::vector<double>& /*local_b_data*/)
965 {
966 assert(local_x.size() ==
968
969 auto const local_p =
970 local_x.template segment<pressure_size>(pressure_index);
971 auto const local_T =
972 local_x.template segment<temperature_size>(temperature_index);
973
975 local_M_data, temperature_size, temperature_size);
977 local_K_data, temperature_size, temperature_size);
978
980 pos.setElementID(this->_element.getID());
981
982 auto const& process_data = this->_process_data;
983 auto const& medium =
984 *process_data.media_map.getMedium(this->_element.getID());
985 auto const& liquid_phase = medium.phase("AqueousLiquid");
986
987 auto const& b =
990
992
993 unsigned const n_integration_points =
995
996 std::vector<GlobalDimVectorType> ip_flux_vector;
997 double average_velocity_norm = 0.0;
998 ip_flux_vector.reserve(n_integration_points);
999
1000 auto const& Ns =
1002 .NsHigherOrder<typename ShapeFunction::MeshElement>();
1003
1004 for (unsigned ip(0); ip < n_integration_points; ip++)
1005 {
1006 auto const& ip_data = this->_ip_data[ip];
1007 auto const& dNdx = ip_data.dNdx;
1008 auto const& w = ip_data.integration_weight;
1009 auto const& N = Ns[ip];
1010
1011 double p_at_xi = 0.;
1012 NumLib::shapeFunctionInterpolate(local_p, N, p_at_xi);
1013 double T_at_xi = 0.;
1014 NumLib::shapeFunctionInterpolate(local_T, N, T_at_xi);
1015
1016 vars.temperature = T_at_xi;
1017 vars.liquid_phase_pressure = p_at_xi;
1018
1019 vars.liquid_saturation = 1.0;
1020
1021 auto const porosity =
1023 .template value<double>(vars, pos, t, dt);
1024 vars.porosity = porosity;
1025
1026 // Use the fluid density model to compute the density
1027 auto const fluid_density =
1028 liquid_phase
1030 .template value<double>(vars, pos, t, dt);
1031 vars.density = fluid_density;
1032 auto const specific_heat_capacity_fluid =
1033 liquid_phase
1035 .template value<double>(vars, pos, t, dt);
1036
1037 // Assemble mass matrix
1038 local_M.noalias() += w *
1040 vars, porosity, fluid_density,
1041 specific_heat_capacity_fluid, pos, t, dt) *
1042 N.transpose() * N;
1043
1044 // Assemble Laplace matrix
1045 auto const viscosity =
1046 liquid_phase
1048 .template value<double>(vars, pos, t, dt);
1049
1050 auto const intrinsic_permeability =
1052 medium
1053 .property(
1055 .value(vars, pos, t, dt));
1056
1057 GlobalDimMatrixType const K_over_mu =
1058 intrinsic_permeability / viscosity;
1059 GlobalDimVectorType const velocity =
1060 process_data.has_gravity
1061 ? GlobalDimVectorType(-K_over_mu *
1062 (dNdx * local_p - fluid_density * b))
1063 : GlobalDimVectorType(-K_over_mu * dNdx * local_p);
1064
1065 GlobalDimMatrixType const thermal_conductivity_dispersivity =
1067 vars, fluid_density, specific_heat_capacity_fluid, velocity,
1068 pos, t, dt);
1069
1070 local_K.noalias() +=
1071 w * dNdx.transpose() * thermal_conductivity_dispersivity * dNdx;
1072
1073 ip_flux_vector.emplace_back(velocity * fluid_density *
1074 specific_heat_capacity_fluid);
1075 average_velocity_norm += velocity.norm();
1076 }
1077
1079 process_data.stabilizer, this->_ip_data,
1080 _process_data.shape_matrix_cache, ip_flux_vector,
1081 average_velocity_norm / static_cast<double>(n_integration_points),
1082 local_K);
1083 }
1084
1086 double const t, double const dt, Eigen::VectorXd const& local_x,
1087 Eigen::VectorXd const& local_x_prev, std::vector<double>& local_M_data,
1088 std::vector<double>& local_K_data,
1089 std::vector<double>& /*local_b_data*/, int const transport_process_id)
1090 {
1091 assert(static_cast<int>(local_x.size()) ==
1094 static_cast<int>(_transport_process_variables.size()) +
1096
1097 auto const local_p =
1098 local_x.template segment<pressure_size>(pressure_index);
1099
1100 NodalVectorType local_T = getLocalTemperature(t, local_x);
1101
1102 auto const local_C = local_x.template segment<concentration_size>(
1104 (transport_process_id - (_process_data.isothermal ? 1 : 2)) *
1106 auto const local_p_prev =
1107 local_x_prev.segment<pressure_size>(pressure_index);
1108
1110 local_M_data, concentration_size, concentration_size);
1112 local_K_data, concentration_size, concentration_size);
1113
1114 LocalBlockMatrixType KCC_Laplacian =
1115 LocalBlockMatrixType::Zero(concentration_size, concentration_size);
1116
1117 unsigned const n_integration_points =
1119
1120 std::vector<GlobalDimVectorType> ip_flux_vector;
1121 double average_velocity_norm = 0.0;
1123 {
1124 ip_flux_vector.reserve(n_integration_points);
1125 }
1126
1129
1130 auto const& b =
1133
1136
1137 auto const& medium =
1139 auto const& phase = medium.phase("AqueousLiquid");
1140 auto const component_id =
1141 transport_process_id - (_process_data.isothermal ? 1 : 2);
1142 auto const& component = phase.component(
1143 _transport_process_variables[component_id].get().getName());
1144
1145 auto const& Ns =
1147 .NsHigherOrder<typename ShapeFunction::MeshElement>();
1148
1149 for (unsigned ip(0); ip < n_integration_points; ++ip)
1150 {
1151 auto& ip_data = _ip_data[ip];
1152 auto const& dNdx = ip_data.dNdx;
1153 auto const& w = ip_data.integration_weight;
1154 auto const& N = Ns[ip];
1155 auto& porosity = ip_data.porosity;
1156 auto const& porosity_prev = ip_data.porosity_prev;
1157
1158 double const C_int_pt = N.dot(local_C);
1159 double const p_int_pt = N.dot(local_p);
1160 double const T_int_pt = N.dot(local_T);
1161
1162 vars.concentration = C_int_pt;
1163 vars.liquid_phase_pressure = p_int_pt;
1164 vars.temperature = T_int_pt;
1165
1167 {
1168 vars.temperature = N.dot(local_T);
1169 }
1170
1171 // porosity
1172 {
1173 vars_prev.porosity = porosity_prev;
1174
1175 porosity =
1177 ? porosity_prev
1179 .template value<double>(vars, vars_prev, pos, t,
1180 dt);
1181
1182 vars.porosity = porosity;
1183 }
1184
1185 auto const& retardation_factor =
1187 .template value<double>(vars, pos, t, dt);
1188
1189 auto const& solute_dispersivity_transverse = medium.template value<
1190 double>(
1192 auto const& solute_dispersivity_longitudinal =
1193 medium.template value<double>(
1195 longitudinal_dispersivity);
1196
1197 // Use the fluid density model to compute the density
1198 auto const density =
1200 .template value<double>(vars, pos, t, dt);
1201 auto const decay_rate =
1203 .template value<double>(vars, pos, t, dt);
1204
1205 auto const& pore_diffusion_coefficient =
1208 .value(vars, pos, t, dt));
1209
1212 vars, pos, t, dt));
1213 // Use the viscosity model to compute the viscosity
1215 .template value<double>(vars, pos, t, dt);
1216
1217 GlobalDimMatrixType const K_over_mu = K / mu;
1218 GlobalDimVectorType const velocity =
1220 ? GlobalDimVectorType(-K_over_mu *
1221 (dNdx * local_p - density * b))
1222 : GlobalDimVectorType(-K_over_mu * dNdx * local_p);
1223
1224 GlobalDimMatrixType const hydrodynamic_dispersion =
1227 pore_diffusion_coefficient, velocity, porosity,
1228 solute_dispersivity_transverse,
1229 solute_dispersivity_longitudinal);
1230
1231 double const R_times_phi = retardation_factor * porosity;
1232 auto const N_t_N = (N.transpose() * N).eval();
1233
1235 {
1236 const double drho_dC =
1238 .template dValue<double>(
1240 pos, t, dt);
1241 local_M.noalias() +=
1242 N_t_N * (R_times_phi * C_int_pt * drho_dC * w);
1243 }
1244
1245 local_M.noalias() += N_t_N * (R_times_phi * density * w);
1246
1247 // coupling term
1249 {
1250 double const p_dot = (p_int_pt - N.dot(local_p_prev)) / dt;
1251
1252 const double drho_dp =
1254 .template dValue<double>(vars,
1256 liquid_phase_pressure,
1257 pos, t, dt);
1258
1259 local_K.noalias() +=
1260 N_t_N * ((R_times_phi * drho_dp * p_dot) * w) -
1261 dNdx.transpose() * velocity * N * (density * w);
1262 }
1263 else
1264 {
1265 ip_flux_vector.emplace_back(velocity * density);
1266 average_velocity_norm += velocity.norm();
1267 }
1268 local_K.noalias() +=
1269 N_t_N * (decay_rate * R_times_phi * density * w);
1270
1271 KCC_Laplacian.noalias() += dNdx.transpose() *
1272 hydrodynamic_dispersion * dNdx *
1273 (density * w);
1274 }
1275
1277 {
1279 typename ShapeFunction::MeshElement>(
1281 _process_data.shape_matrix_cache, ip_flux_vector,
1282 average_velocity_norm /
1283 static_cast<double>(n_integration_points),
1284 KCC_Laplacian);
1285 }
1286 local_K.noalias() += KCC_Laplacian;
1287 }
1288
1290 double const t, double const dt, Eigen::VectorXd const& local_x,
1291 Eigen::VectorXd const& local_x_prev, int const process_id,
1292 std::vector<double>& local_b_data,
1293 std::vector<double>& local_Jac_data) override
1294 {
1295 if (process_id == _process_data.hydraulic_process_id)
1296 {
1297 assembleWithJacobianHydraulicEquation(t, dt, local_x, local_x_prev,
1298 local_b_data, local_Jac_data);
1299 }
1300 else
1301 {
1302 int const component_id = process_id - 1;
1304 t, dt, local_x, local_x_prev, local_b_data, local_Jac_data,
1305 component_id);
1306 }
1307 }
1308
1310 double const t, double const dt, Eigen::VectorXd const& local_x,
1311 Eigen::VectorXd const& local_x_prev, std::vector<double>& local_b_data,
1312 std::vector<double>& local_Jac_data)
1313 {
1314 auto const p = local_x.template segment<pressure_size>(pressure_index);
1315 auto const c = local_x.template segment<concentration_size>(
1317
1318 auto const p_prev = local_x_prev.segment<pressure_size>(pressure_index);
1319 auto const c_prev =
1320 local_x_prev.segment<concentration_size>(first_concentration_index);
1321
1323 local_Jac_data, pressure_size, pressure_size);
1325 local_b_data, pressure_size);
1326
1327 unsigned const n_integration_points =
1329
1332 auto const& b =
1335
1336 auto const& medium =
1338 auto const& phase = medium.phase("AqueousLiquid");
1339
1342
1343 auto const& Ns =
1345 .NsHigherOrder<typename ShapeFunction::MeshElement>();
1346
1347 for (unsigned ip(0); ip < n_integration_points; ++ip)
1348 {
1349 auto& ip_data = _ip_data[ip];
1350 auto const& dNdx = ip_data.dNdx;
1351 auto const& w = ip_data.integration_weight;
1352 auto const& N = Ns[ip];
1353 auto& phi = ip_data.porosity;
1354 auto const& phi_prev = ip_data.porosity_prev;
1355
1356 double const p_ip = N.dot(p);
1357 double const c_ip = N.dot(c);
1358
1359 double const cdot_ip = (c_ip - N.dot(c_prev)) / dt;
1360
1361 vars.liquid_phase_pressure = p_ip;
1362 vars.concentration = c_ip;
1363
1364 // porosity
1365 {
1366 vars_prev.porosity = phi_prev;
1367
1369 ? phi_prev
1371 .template value<double>(vars, vars_prev, pos, t,
1372 dt);
1373
1374 vars.porosity = phi;
1375 }
1376
1377 auto const rho = phase[MaterialPropertyLib::PropertyType::density]
1378 .template value<double>(vars, pos, t, dt);
1379
1382 vars, pos, t, dt));
1383
1385 .template value<double>(vars, pos, t, dt);
1386
1387 auto const drho_dp =
1389 .template dValue<double>(
1390 vars,
1392 pos, t, dt);
1393 auto const drho_dc =
1395 .template dValue<double>(
1397 t, dt);
1398
1399 // matrix assembly
1400 local_Jac.noalias() += w * N.transpose() * phi * drho_dp / dt * N +
1401 w * dNdx.transpose() * rho * k / mu * dNdx;
1402
1403 local_rhs.noalias() -=
1404 w * N.transpose() * phi *
1405 (drho_dp * N * p_prev + drho_dc * cdot_ip) +
1406 w * rho * dNdx.transpose() * k / mu * dNdx * p;
1407
1409 {
1410 local_rhs.noalias() +=
1411 w * rho * dNdx.transpose() * k / mu * rho * b;
1412 }
1413 }
1414 }
1415
1417 double const t, double const dt, Eigen::VectorXd const& local_x,
1418 Eigen::VectorXd const& local_x_prev, std::vector<double>& local_b_data,
1419 std::vector<double>& local_Jac_data, int const component_id)
1420 {
1421 auto const concentration_index =
1423
1424 auto const p = local_x.template segment<pressure_size>(pressure_index);
1425 auto const c =
1426 local_x.template segment<concentration_size>(concentration_index);
1427 auto const c_prev =
1428 local_x_prev.segment<concentration_size>(concentration_index);
1429
1432 {
1434 }
1435
1437 local_Jac_data, concentration_size, concentration_size);
1439 local_b_data, concentration_size);
1440
1441 LocalBlockMatrixType KCC_Laplacian =
1442 LocalBlockMatrixType::Zero(concentration_size, concentration_size);
1443
1444 unsigned const n_integration_points =
1446
1447 std::vector<GlobalDimVectorType> ip_flux_vector;
1448 double average_velocity_norm = 0.0;
1449 ip_flux_vector.reserve(n_integration_points);
1450
1453
1454 auto const& b =
1457
1460
1461 auto const& medium =
1463 auto const& phase = medium.phase("AqueousLiquid");
1464 auto const& component = phase.component(
1465 _transport_process_variables[component_id].get().getName());
1466
1467 auto const& Ns =
1469 .NsHigherOrder<typename ShapeFunction::MeshElement>();
1470
1471 for (unsigned ip(0); ip < n_integration_points; ++ip)
1472 {
1473 auto& ip_data = _ip_data[ip];
1474 auto const& dNdx = ip_data.dNdx;
1475 auto const& w = ip_data.integration_weight;
1476 auto const& N = Ns[ip];
1477 auto& phi = ip_data.porosity;
1478 auto const& phi_prev = ip_data.porosity_prev;
1479
1480 double const p_ip = N.dot(p);
1481 double const c_ip = N.dot(c);
1482
1483 vars.liquid_phase_pressure = p_ip;
1484 vars.concentration = c_ip;
1485
1487 {
1488 vars.temperature = N.dot(T);
1489 }
1490
1491 // porosity
1492 {
1493 vars_prev.porosity = phi_prev;
1494
1496 ? phi_prev
1498 .template value<double>(vars, vars_prev, pos, t,
1499 dt);
1500
1501 vars.porosity = phi;
1502 }
1503
1504 auto const R =
1506 .template value<double>(vars, pos, t, dt);
1507
1508 auto const alpha_T = medium.template value<double>(
1510 auto const alpha_L = medium.template value<double>(
1512
1513 auto const rho = phase[MaterialPropertyLib::PropertyType::density]
1514 .template value<double>(vars, pos, t, dt);
1515 // first-order decay constant
1516 auto const alpha =
1518 .template value<double>(vars, pos, t, dt);
1519
1522 .value(vars, pos, t, dt));
1523
1526 vars, pos, t, dt));
1528 .template value<double>(vars, pos, t, dt);
1529 // Darcy flux
1530 GlobalDimVectorType const q =
1532 ? GlobalDimVectorType(-k / mu * (dNdx * p - rho * b))
1533 : GlobalDimVectorType(-k / mu * dNdx * p);
1534
1536 _process_data.stabilizer, _element.getID(), Dp, q, phi, alpha_T,
1537 alpha_L);
1538
1539 // matrix assembly
1540 local_Jac.noalias() +=
1541 w * rho * N.transpose() * phi * R * (alpha + 1 / dt) * N;
1542
1543 KCC_Laplacian.noalias() += w * rho * dNdx.transpose() * D * dNdx;
1544
1545 auto const cdot = (c - c_prev) / dt;
1546 local_rhs.noalias() -=
1547 w * rho * N.transpose() * phi * R * N * (cdot + alpha * c);
1548
1549 ip_flux_vector.emplace_back(q * rho);
1550 average_velocity_norm += q.norm();
1551 }
1552
1555 _process_data.shape_matrix_cache, ip_flux_vector,
1556 average_velocity_norm / static_cast<double>(n_integration_points),
1557 KCC_Laplacian);
1558
1559 local_rhs.noalias() -= KCC_Laplacian * c;
1560
1561 local_Jac.noalias() += KCC_Laplacian;
1562 }
1563
1565 double const t, double const dt, Eigen::VectorXd const& local_x,
1566 std::vector<double>& local_M_data, std::vector<double>& local_K_data,
1567 std::vector<double>& local_b_data,
1568 int const transport_process_id) override
1569 {
1570 auto const local_C = local_x.template segment<concentration_size>(
1572 (transport_process_id - 1) * concentration_size);
1573
1575 local_M_data, concentration_size, concentration_size);
1577 local_K_data, concentration_size, concentration_size);
1579 local_b_data, concentration_size);
1580
1581 unsigned const n_integration_points =
1583
1586
1589
1590 auto const& medium =
1592 auto const component_id = transport_process_id - 1;
1593
1594 auto const& Ns =
1596 .NsHigherOrder<typename ShapeFunction::MeshElement>();
1597
1598 for (unsigned ip(0); ip < n_integration_points; ++ip)
1599 {
1600 auto& ip_data = _ip_data[ip];
1601 auto const w = ip_data.integration_weight;
1602 auto const& N = Ns[ip];
1603 auto& porosity = ip_data.porosity;
1604 auto const& porosity_prev = ip_data.porosity_prev;
1605 auto const chemical_system_id = ip_data.chemical_system_id;
1606
1607 double C_int_pt = 0.0;
1608 NumLib::shapeFunctionInterpolate(local_C, N, C_int_pt);
1609
1610 vars.concentration = C_int_pt;
1611
1612 auto const porosity_dot = (porosity - porosity_prev) / dt;
1613
1614 // porosity
1615 {
1616 vars_prev.porosity = porosity_prev;
1617
1618 porosity =
1620 ? porosity_prev
1622 .template value<double>(vars, vars_prev, pos, t,
1623 dt);
1624 }
1625
1626 local_M.noalias() += w * N.transpose() * porosity * N;
1627
1628 local_K.noalias() += w * N.transpose() * porosity_dot * N;
1629
1630 if (chemical_system_id == -1)
1631 {
1632 continue;
1633 }
1634
1635 auto const C_post_int_pt =
1637 component_id, chemical_system_id);
1638
1639 local_b.noalias() +=
1640 w * N.transpose() * porosity * (C_post_int_pt - C_int_pt) / dt;
1641 }
1642 }
1643
1644 std::vector<double> const& getIntPtDarcyVelocity(
1645 const double t,
1646 std::vector<GlobalVector*> const& x,
1647 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
1648 std::vector<double>& cache) const override
1649 {
1650 assert(x.size() == dof_table.size());
1651
1652 auto const n_processes = x.size();
1653 std::vector<std::vector<double>> local_x;
1654 local_x.reserve(n_processes);
1655
1656 for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
1657 {
1658 auto const indices =
1659 NumLib::getIndices(_element.getID(), *dof_table[process_id]);
1660 assert(!indices.empty());
1661 local_x.push_back(x[process_id]->get(indices));
1662 }
1663
1664 // only one process, must be monolithic.
1665 if (n_processes == 1)
1666 {
1667 auto const local_p = Eigen::Map<const NodalVectorType>(
1668 &local_x[0][pressure_index], pressure_size);
1669 auto const local_C = Eigen::Map<const NodalVectorType>(
1671 return calculateIntPtDarcyVelocity(t, local_p, local_C, cache);
1672 }
1673
1674 // multiple processes, must be staggered.
1675 {
1676 constexpr int pressure_process_id = 0;
1677 constexpr int concentration_process_id = 1;
1678 auto const local_p = Eigen::Map<const NodalVectorType>(
1679 &local_x[pressure_process_id][0], pressure_size);
1680 auto const local_C = Eigen::Map<const NodalVectorType>(
1681 &local_x[concentration_process_id][0], concentration_size);
1682 return calculateIntPtDarcyVelocity(t, local_p, local_C, cache);
1683 }
1684 }
1685
1686 std::vector<double> const& calculateIntPtDarcyVelocity(
1687 const double t,
1688 Eigen::Ref<const NodalVectorType> const& p_nodal_values,
1689 Eigen::Ref<const NodalVectorType> const& C_nodal_values,
1690 std::vector<double>& cache) const
1691 {
1692 auto const n_integration_points =
1694
1695 cache.clear();
1696 auto cache_mat = MathLib::createZeroedMatrix<
1697 Eigen::Matrix<double, GlobalDim, Eigen::Dynamic, Eigen::RowMajor>>(
1698 cache, GlobalDim, n_integration_points);
1699
1702
1703 auto const& b =
1706
1708
1709 auto const& medium =
1711 auto const& phase = medium.phase("AqueousLiquid");
1712
1713 auto const& Ns =
1715 .NsHigherOrder<typename ShapeFunction::MeshElement>();
1716
1717 for (unsigned ip = 0; ip < n_integration_points; ++ip)
1718 {
1719 auto const& ip_data = _ip_data[ip];
1720 auto const& dNdx = ip_data.dNdx;
1721 auto const& N = Ns[ip];
1722 auto const& porosity = ip_data.porosity;
1723
1724 double C_int_pt = 0.0;
1725 double p_int_pt = 0.0;
1726
1727 NumLib::shapeFunctionInterpolate(C_nodal_values, N, C_int_pt);
1728 NumLib::shapeFunctionInterpolate(p_nodal_values, N, p_int_pt);
1729
1730 vars.concentration = C_int_pt;
1731 vars.liquid_phase_pressure = p_int_pt;
1732 vars.porosity = porosity;
1733
1734 // TODO (naumov) Temporary value not used by current material
1735 // models. Need extension of secondary variables interface.
1736 double const dt = std::numeric_limits<double>::quiet_NaN();
1739 vars, pos, t, dt));
1741 .template value<double>(vars, pos, t, dt);
1742 GlobalDimMatrixType const K_over_mu = K / mu;
1743
1744 cache_mat.col(ip).noalias() = -K_over_mu * dNdx * p_nodal_values;
1746 {
1747 auto const rho_w =
1749 .template value<double>(vars, pos, t, dt);
1750 // here it is assumed that the vector b is directed 'downwards'
1751 cache_mat.col(ip).noalias() += K_over_mu * rho_w * b;
1752 }
1753 }
1754
1755 return cache;
1756 }
1757
1758 Eigen::Map<const Eigen::RowVectorXd> getShapeMatrix(
1759 const unsigned integration_point) const override
1760 {
1762 typename ShapeFunction::MeshElement>()[integration_point];
1763
1764 // assumes N is stored contiguously in memory
1765 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
1766 }
1767
1768 Eigen::Vector3d getFlux(MathLib::Point3d const& pnt_local_coords,
1769 double const t,
1770 std::vector<double> const& local_x) const override
1771 {
1772 auto const local_p = Eigen::Map<const NodalVectorType>(
1773 &local_x[pressure_index], pressure_size);
1774 auto const local_C = Eigen::Map<const NodalVectorType>(
1776
1777 // Eval shape matrices at given point
1778 // Note: Axial symmetry is set to false here, because we only need dNdx
1779 // here, which is not affected by axial symmetry.
1780 auto const shape_matrices =
1782 GlobalDim>(
1783 _element, false /*is_axially_symmetric*/,
1784 std::array{pnt_local_coords})[0];
1785
1788 auto const& b =
1791
1793
1794 auto const& medium =
1796 auto const& phase = medium.phase("AqueousLiquid");
1797
1798 // local_x contains the local concentration and pressure values
1799 double c_int_pt;
1800 NumLib::shapeFunctionInterpolate(local_C, shape_matrices.N, c_int_pt);
1801 vars.concentration = c_int_pt;
1802
1803 double p_int_pt;
1804 NumLib::shapeFunctionInterpolate(local_p, shape_matrices.N, p_int_pt);
1805 vars.liquid_phase_pressure = p_int_pt;
1806
1807 // TODO (naumov) Temporary value not used by current material models.
1808 // Need extension of secondary variables interface.
1809 double const dt = std::numeric_limits<double>::quiet_NaN();
1812 vars, pos, t, dt));
1813
1815 .template value<double>(vars, pos, t, dt);
1816 GlobalDimMatrixType const K_over_mu = K / mu;
1817
1818 GlobalDimVectorType q = -K_over_mu * shape_matrices.dNdx * local_p;
1819 auto const rho_w = phase[MaterialPropertyLib::PropertyType::density]
1820 .template value<double>(vars, pos, t, dt);
1822 {
1823 q += K_over_mu * rho_w * b;
1824 }
1825 Eigen::Vector3d flux(0.0, 0.0, 0.0);
1826 flux.head<GlobalDim>() = rho_w * q;
1827 return flux;
1828 }
1829
1831 double const t,
1832 double const /*dt*/,
1833 Eigen::VectorXd const& local_x,
1834 Eigen::VectorXd const& /*local_x_prev*/) override
1835 {
1836 auto const local_p =
1837 local_x.template segment<pressure_size>(pressure_index);
1838 auto const local_C = local_x.template segment<concentration_size>(
1840
1841 std::vector<double> ele_velocity;
1842 calculateIntPtDarcyVelocity(t, local_p, local_C, ele_velocity);
1843
1844 auto const n_integration_points =
1846 auto const ele_velocity_mat =
1847 MathLib::toMatrix(ele_velocity, GlobalDim, n_integration_points);
1848
1849 auto const ele_id = _element.getID();
1850 Eigen::Map<LocalVectorType>(
1851 &(*_process_data.mesh_prop_velocity)[ele_id * GlobalDim],
1852 GlobalDim) =
1853 ele_velocity_mat.rowwise().sum() / n_integration_points;
1854 }
1855
1857 std::size_t const ele_id) override
1858 {
1859 auto const n_integration_points =
1861
1863 {
1864 auto const& medium = *_process_data.media_map.getMedium(ele_id);
1865
1866 for (auto& ip_data : _ip_data)
1867 {
1868 ip_data.porosity = ip_data.porosity_prev;
1869
1871 ->updatePorosityPostReaction(ip_data.chemical_system_id,
1872 medium, ip_data.porosity);
1873 }
1874
1876 std::accumulate(_ip_data.begin(), _ip_data.end(), 0.,
1877 [](double const s, auto const& ip)
1878 { return s + ip.porosity; }) /
1879 n_integration_points;
1880 }
1881
1882 std::vector<GlobalIndexType> chemical_system_indices;
1883 chemical_system_indices.reserve(n_integration_points);
1884 std::transform(_ip_data.begin(), _ip_data.end(),
1885 std::back_inserter(chemical_system_indices),
1886 [](auto const& ip_data)
1887 { return ip_data.chemical_system_id; });
1888
1890 ele_id, chemical_system_indices);
1891 }
1892
1893 std::vector<double> const& getIntPtMolarFlux(
1894 const double t, std::vector<GlobalVector*> const& x,
1895 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_tables,
1896 std::vector<double>& cache, int const component_id) const override
1897 {
1898 std::vector<double> local_x_vec;
1899
1900 auto const n_processes = x.size();
1901 for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
1902 {
1903 auto const indices =
1904 NumLib::getIndices(_element.getID(), *dof_tables[process_id]);
1905 assert(!indices.empty());
1906 auto const local_solution = x[process_id]->get(indices);
1907 local_x_vec.insert(std::end(local_x_vec),
1908 std::begin(local_solution),
1909 std::end(local_solution));
1910 }
1911 auto const local_x = MathLib::toVector(local_x_vec);
1912
1913 auto const p = local_x.template segment<pressure_size>(pressure_index);
1914 auto const c = local_x.template segment<concentration_size>(
1916
1917 auto const n_integration_points =
1919
1920 cache.clear();
1921 auto cache_mat = MathLib::createZeroedMatrix<
1922 Eigen::Matrix<double, GlobalDim, Eigen::Dynamic, Eigen::RowMajor>>(
1923 cache, GlobalDim, n_integration_points);
1924
1927
1928 auto const& b =
1931
1933
1934 auto const& medium =
1936 auto const& phase = medium.phase("AqueousLiquid");
1937
1938 auto const& component = phase.component(
1939 _transport_process_variables[component_id].get().getName());
1940
1941 auto const& Ns =
1943 .NsHigherOrder<typename ShapeFunction::MeshElement>();
1944
1945 for (unsigned ip = 0; ip < n_integration_points; ++ip)
1946 {
1947 auto const& ip_data = _ip_data[ip];
1948 auto const& dNdx = ip_data.dNdx;
1949 auto const& N = Ns[ip];
1950 auto const& phi = ip_data.porosity;
1951
1952 double const p_ip = N.dot(p);
1953 double const c_ip = N.dot(c);
1954
1955 vars.concentration = c_ip;
1956 vars.liquid_phase_pressure = p_ip;
1957 vars.porosity = phi;
1958
1959 double const dt = std::numeric_limits<double>::quiet_NaN();
1960
1963 vars, pos, t, dt));
1965 .template value<double>(vars, pos, t, dt);
1966 auto const rho = phase[MaterialPropertyLib::PropertyType::density]
1967 .template value<double>(vars, pos, t, dt);
1968
1969 // Darcy flux
1970 GlobalDimVectorType const q =
1972 ? GlobalDimVectorType(-k / mu * (dNdx * p - rho * b))
1973 : GlobalDimVectorType(-k / mu * dNdx * p);
1974
1975 auto const alpha_T = medium.template value<double>(
1977 auto const alpha_L = medium.template value<double>(
1981 .value(vars, pos, t, dt));
1982
1983 // Hydrodynamic dispersion
1985 _process_data.stabilizer, _element.getID(), Dp, q, phi, alpha_T,
1986 alpha_L);
1987
1988 cache_mat.col(ip).noalias() = q * c_ip - D * dNdx * c;
1989 }
1990
1991 return cache;
1992 }
1993
1994 void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
1995 Eigen::VectorXd const& /*local_x_prev*/,
1996 double const /*t*/, double const /*dt*/,
1997 int const /*process_id*/) override
1998 {
1999 unsigned const n_integration_points =
2001
2002 for (unsigned ip = 0; ip < n_integration_points; ip++)
2003 {
2004 _ip_data[ip].pushBackState();
2005 }
2006 }
2007
2008private:
2011
2013 std::vector<std::reference_wrapper<ProcessVariable>> const
2015
2016 std::vector<IntegrationPointData<GlobalDimNodalMatrixType>> _ip_data;
2017
2019 MaterialPropertyLib::VariableArray const& vars, const double porosity,
2020 const double fluid_density, const double specific_heat_capacity_fluid,
2021 ParameterLib::SpatialPosition const& pos, double const t,
2022 double const dt)
2023 {
2024 auto const& medium =
2025 *_process_data.media_map.getMedium(this->_element.getID());
2026 auto const& solid_phase = medium.phase("Solid");
2027
2028 auto const specific_heat_capacity_solid =
2029 solid_phase
2030 .property(
2032 .template value<double>(vars, pos, t, dt);
2033
2034 auto const solid_density =
2035 solid_phase.property(MaterialPropertyLib::PropertyType::density)
2036 .template value<double>(vars, pos, t, dt);
2037
2038 return solid_density * specific_heat_capacity_solid * (1 - porosity) +
2039 fluid_density * specific_heat_capacity_fluid * porosity;
2040 }
2041
2044 const double fluid_density, const double specific_heat_capacity_fluid,
2045 const GlobalDimVectorType& velocity,
2046 ParameterLib::SpatialPosition const& pos, double const t,
2047 double const dt)
2048 {
2049 auto const& medium =
2051
2052 auto thermal_conductivity =
2054 medium
2055 .property(
2057 .value(vars, pos, t, dt));
2058
2059 auto const thermal_dispersivity_transversal =
2060 medium
2062 thermal_transversal_dispersivity)
2063 .template value<double>();
2064
2065 auto const thermal_dispersivity_longitudinal =
2066 medium
2068 thermal_longitudinal_dispersivity)
2069 .template value<double>();
2070
2071 // Thermal conductivity is moved outside and zero matrix is passed
2072 // instead due to multiplication with fluid's density times specific
2073 // heat capacity.
2074 return thermal_conductivity +
2075 fluid_density * specific_heat_capacity_fluid *
2078 GlobalDimMatrixType::Zero(GlobalDim, GlobalDim),
2079 velocity, 0 /* phi */, thermal_dispersivity_transversal,
2080 thermal_dispersivity_longitudinal);
2081 }
2082
2084 Eigen::VectorXd const& local_x)
2085 {
2086 NodalVectorType local_T;
2088 {
2090 {
2092 _element, t);
2093 }
2094 else
2095 {
2096 local_T = NodalVectorType::Zero(temperature_size);
2097 }
2098 }
2099 else
2100 {
2101 local_T =
2102 local_x.template segment<temperature_size>(temperature_index);
2103 }
2104 return local_T;
2105 }
2106};
2107
2108} // namespace ComponentTransport
2109} // namespace ProcessLib
GlobalMatrix::IndexType GlobalIndexType
std::string getName(std::string const &line)
Returns the name/title from the "Zone"-description.
virtual void updatePorosityPostReaction(GlobalIndexType const &, MaterialPropertyLib::Medium const &, double &)
virtual double getKineticPrefactor(std::size_t reaction_id) const
virtual void computeSecondaryVariable(std::size_t const, std::vector< GlobalIndexType > const &)
virtual void setChemicalSystemConcrete(std::vector< double > const &, GlobalIndexType const &, MaterialPropertyLib::Medium const *, MaterialPropertyLib::VariableArray const &, ParameterLib::SpatialPosition const &, double const, double const)
virtual void updateVolumeFractionPostReaction(GlobalIndexType const &, MaterialPropertyLib::Medium const &, ParameterLib::SpatialPosition const &, double const, double const, double const)
std::vector< GlobalIndexType > chemical_system_index_map
virtual Eigen::SparseMatrix< double > const * getStoichiometricMatrix() const
virtual double getConcentration(int const, GlobalIndexType const) const
virtual void initializeChemicalSystemConcrete(std::vector< double > const &, GlobalIndexType const &, MaterialPropertyLib::Medium const &, ParameterLib::SpatialPosition const &, double const)
Phase const & phase(std::size_t index) const
Definition Medium.cpp:33
Property const & property(PropertyType const &p) const
Definition Phase.cpp:53
Component const & component(std::size_t const &index) const
Definition Phase.cpp:33
int add(IndexType row, IndexType col, double val)
Definition EigenMatrix.h:87
Global vector based on Eigen vector.
Definition EigenVector.h:25
void add(IndexType rowId, double v)
add entry
Definition EigenVector.h:76
constexpr double getWeight() const
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:89
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
MathLib::RowColumnIndices< GlobalIndexType > RowColumnIndices
auto const & NsHigherOrder() const
void setCoordinates(MathLib::Point3d const &coordinates)
void setElementID(std::size_t element_id)
virtual std::vector< double > const & getIntPtDarcyVelocity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual void setChemicalSystemConcrete(Eigen::VectorXd const &, double const, double const)=0
virtual void postSpeciationCalculation(std::size_t const ele_id, double const t, double const dt)=0
virtual void computeReactionRelatedSecondaryVariable(std::size_t const ele_id)=0
void initializeChemicalSystem(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t)
void setChemicalSystem(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, double const dt)
virtual void assembleReactionEquationConcrete(double const t, double const dt, Eigen::VectorXd const &local_x, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data, int const transport_process_id)=0
void assembleReactionEquation(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, double const dt, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, int const process_id)
virtual void initializeChemicalSystemConcrete(Eigen::VectorXd const &, double const)=0
virtual std::vector< double > const & getIntPtMolarFlux(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache, int const component_id) const =0
typename ShapeMatricesType::GlobalDimVectorType GlobalDimVectorType
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
typename ShapeMatricesType::ShapeMatrices ShapeMatrices
void assembleWithJacobianHydraulicEquation(double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
void assembleHeatTransportEquation(double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > LocalMatrixType
void postTimestepConcrete(Eigen::VectorXd const &, Eigen::VectorXd const &, double const, double const, int const) override
std::vector< double > const & getIntPtMolarFlux(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< double > &cache, int const component_id) const override
void postSpeciationCalculation(std::size_t const ele_id, double const t, double const dt) override
NumLib::GenericIntegrationMethod const & _integration_method
void initializeChemicalSystemConcrete(Eigen::VectorXd const &local_x, double const t) override
void computeReactionRelatedSecondaryVariable(std::size_t const ele_id) override
std::vector< double > const & calculateIntPtDarcyVelocity(const double t, Eigen::Ref< const NodalVectorType > const &p_nodal_values, Eigen::Ref< const NodalVectorType > const &C_nodal_values, std::vector< double > &cache) const
void assembleBlockMatrices(GlobalDimVectorType const &b, int const component_id, double const t, double const dt, Eigen::Ref< const NodalVectorType > const &C_nodal_values, Eigen::Ref< const NodalVectorType > const &p_nodal_values, Eigen::Ref< LocalBlockMatrixType > KCC, Eigen::Ref< LocalBlockMatrixType > MCC, Eigen::Ref< LocalBlockMatrixType > MCp, Eigen::Ref< LocalBlockMatrixType > MpC, Eigen::Ref< LocalBlockMatrixType > Kpp, Eigen::Ref< LocalBlockMatrixType > Mpp, Eigen::Ref< LocalSegmentVectorType > Bp)
typename ShapeMatricesType::template MatrixType< pressure_size, pressure_size > LocalBlockMatrixType
typename ShapeMatricesType::GlobalDimMatrixType GlobalDimMatrixType
void assembleWithJacobianForStaggeredScheme(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_b_data, std::vector< double > &local_Jac_data) override
std::vector< IntegrationPointData< GlobalDimNodalMatrixType > > _ip_data
ComponentTransportProcessData const & _process_data
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix(const unsigned integration_point) const override
Provides the shape matrix at the given integration point.
ShapeMatrixPolicyType< ShapeFunction, GlobalDim > ShapeMatricesType
void computeSecondaryVariableConcrete(double const t, double const, Eigen::VectorXd const &local_x, Eigen::VectorXd const &) override
std::vector< std::reference_wrapper< ProcessVariable > > const _transport_process_variables
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)
typename ShapeMatricesType::GlobalDimNodalMatrixType GlobalDimNodalMatrixType
typename ShapeMatricesType::NodalRowVectorType NodalRowVectorType
std::vector< double > const & getIntPtDarcyVelocity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
void assembleComponentTransportEquation(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 > &, int const transport_process_id)
NodalVectorType getLocalTemperature(double const t, Eigen::VectorXd const &local_x)
Eigen::Vector3d getFlux(MathLib::Point3d const &pnt_local_coords, double const t, std::vector< double > const &local_x) const override
GlobalDimMatrixType getThermalConductivityDispersivity(MaterialPropertyLib::VariableArray const &vars, const double fluid_density, const double specific_heat_capacity_fluid, const GlobalDimVectorType &velocity, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
void assemble(double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data) override
void assembleWithJacobianComponentTransportEquation(double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data, int const component_id)
Eigen::Matrix< double, Eigen::Dynamic, 1 > LocalVectorType
double getHeatEnergyCoefficient(MaterialPropertyLib::VariableArray const &vars, const double porosity, const double fluid_density, const double specific_heat_capacity_fluid, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
void assembleReactionEquationConcrete(double const t, double const dt, Eigen::VectorXd const &local_x, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data, int const transport_process_id) override
LocalAssemblerData(MeshLib::Element const &element, std::size_t const local_matrix_size, NumLib::GenericIntegrationMethod const &integration_method, bool is_axially_symmetric, ComponentTransportProcessData const &process_data, std::vector< std::reference_wrapper< ProcessVariable > > const &transport_process_variables)
typename ShapeMatricesType::template VectorType< pressure_size > LocalSegmentVectorType
void assembleKCmCn(int const component_id, double const t, double const dt, Eigen::Ref< LocalBlockMatrixType > KCmCn, double const stoichiometric_coefficient, double const kinetic_prefactor)
void setChemicalSystemConcrete(Eigen::VectorXd const &local_x, double const t, double dt) override
typename ShapeMatricesType::NodalVectorType NodalVectorType
Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)
@ longitudinal_dispersivity
used to compute the hydrodynamic dispersion tensor.
@ transversal_dispersivity
used to compute the hydrodynamic dispersion tensor.
@ retardation_factor
specify retardation factor used in component transport process.
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< const Vector > toVector(std::vector< double > const &data, Eigen::VectorXd::Index size)
Creates an Eigen mapped vector from the given data vector.
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
Eigen::Map< const Matrix > toMatrix(std::vector< double > const &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
void assembleAdvectionMatrix(IPData const &ip_data_vector, NumLib::ShapeMatrixCache const &shape_matrix_cache, std::vector< FluxVectorType > const &ip_flux_vector, Eigen::MatrixBase< Derived > &laplacian_matrix)
std::vector< GlobalIndexType > getIndices(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > computeShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, PointContainer const &points)
Eigen::MatrixXd computeHydrodynamicDispersion(NumericalStabilization const &stabilizer, std::size_t const element_id, Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)
std::array< double, 3 > interpolateCoordinates(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
NumLib::ShapeMatrices< NodalRowVectorType, DimNodalMatrixType, DimMatrixType, GlobalDimNodalMatrixType > ShapeMatrices
MatrixType< GlobalDim, ShapeFunction::NPOINTS > GlobalDimNodalMatrixType
MatrixType< GlobalDim, GlobalDim > GlobalDimMatrixType
VectorType< GlobalDim > GlobalDimVectorType
VectorType< ShapeFunction::NPOINTS > NodalVectorType
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType
virtual Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > getNodalValuesOnElement(MeshLib::Element const &element, double const t) const
Returns a matrix of values for all nodes of the given element.
Definition Parameter.h:164
std::vector< Eigen::VectorXd > const projected_specific_body_force_vectors
Projected specific body force vector: R * R^T * b.
MaterialPropertyLib::MaterialSpatialDistributionMap media_map
NumLib::ShapeMatrixCache shape_matrix_cache
caches for each mesh element type the shape matrix
IntegrationPointData(GlobalDimNodalMatrixType const &dNdx_, double const &integration_weight_)