OGS
ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim > Class Template Reference

Detailed Description

template<typename ShapeFunction, int GlobalDim>
class ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >

Definition at line 87 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

#include <ThermalTwoPhaseFlowWithPPLocalAssembler.h>

Inheritance diagram for ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >:
[legend]
Collaboration diagram for ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >:
[legend]

Public Member Functions

 ThermalTwoPhaseFlowWithPPLocalAssembler (MeshLib::Element const &element, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, ThermalTwoPhaseFlowWithPPProcessData const &process_data)
void assemble (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data) override
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const override
 Provides the shape matrix at the given integration point.
std::vector< double > const & getIntPtSaturation (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &) const override
std::vector< double > const & getIntPtWettingPressure (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &) const override
std::vector< double > const & getIntPtLiquidMolFracContaminant (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &) const override
std::vector< double > const & getIntPtGasMolFracWater (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &) const override
std::vector< double > const & getIntPtGasMolFracContaminant (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &) const override
Public Member Functions inherited from ProcessLib::LocalAssemblerInterface
virtual ~LocalAssemblerInterface ()=default
virtual void setInitialConditions (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, int const process_id)
virtual void initialize (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
virtual void preAssemble (double const, double const, std::vector< double > const &)
virtual 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)
virtual void assembleWithJacobian (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
virtual 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)
virtual void computeSecondaryVariable (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
virtual void preTimestep (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
virtual void postTimestep (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
void postNonLinearSolver (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< double > const &) const
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< std::vector< double > > const &) const
 Fits to staggered scheme.
virtual int getNumberOfVectorElementsForDeformation () const
Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default

Private Types

using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
using LocalAssemblerTraits
using NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType
using GlobalDimNodalMatrixType
using NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
using NodalVectorType = typename ShapeMatricesType::NodalVectorType
using GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType
using GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType
using LocalMatrixType = typename LocalAssemblerTraits::LocalMatrix
using LocalVectorType = typename LocalAssemblerTraits::LocalVector

Private Attributes

MeshLib::Element const & _element
NumLib::GenericIntegrationMethod const & _integration_method
ThermalTwoPhaseFlowWithPPProcessData const & _process_data
std::vector< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType, NodalMatrixType >, Eigen::aligned_allocator< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType, NodalMatrixType > > > _ip_data
std::vector< double > _saturation
std::vector< double > _pressure_wetting
std::vector< double > _liquid_molar_fraction_contaminant
std::vector< double > _gas_molar_fraction_water
std::vector< double > _gas_molar_fraction_contaminant

Static Private Attributes

static const int nonwet_pressure_matrix_index = 0
static const int cap_pressure_matrix_index = ShapeFunction::NPOINTS
static const int contaminant_matrix_index = 2 * ShapeFunction::NPOINTS
static const int temperature_matrix_index = 3 * ShapeFunction::NPOINTS
static const int nonwet_pressure_size = ShapeFunction::NPOINTS
static const int cap_pressure_size = ShapeFunction::NPOINTS
static const int contaminant_size = ShapeFunction::NPOINTS
static const int temperature_size = ShapeFunction::NPOINTS

Member Typedef Documentation

◆ GlobalDimMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType
private

Definition at line 101 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ GlobalDimNodalMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::GlobalDimNodalMatrixType
private
Initial value:
MatrixType< GlobalDim, ShapeFunction::NPOINTS > GlobalDimNodalMatrixType

Definition at line 97 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ GlobalDimVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType
private

Definition at line 102 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ LocalAssemblerTraits

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::LocalAssemblerTraits
private
Initial value:
ShapeMatricesType, ShapeFunction::NPOINTS, NUM_NODAL_DOF, GlobalDim>
ShapeMatrixPolicyType< ShapeFunction, GlobalDim > ShapeMatricesType
detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim > LocalAssemblerTraits

Definition at line 93 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ LocalMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::LocalMatrixType = typename LocalAssemblerTraits::LocalMatrix
private

Definition at line 103 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ LocalVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::LocalVectorType = typename LocalAssemblerTraits::LocalVector
private

Definition at line 104 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ NodalMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
private

Definition at line 99 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ NodalRowVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType
private

Definition at line 95 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ NodalVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::NodalVectorType = typename ShapeMatricesType::NodalVectorType
private

Definition at line 100 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ ShapeMatrices

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
private

Definition at line 91 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ ShapeMatricesType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
private

Definition at line 90 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

Constructor & Destructor Documentation

◆ ThermalTwoPhaseFlowWithPPLocalAssembler()

template<typename ShapeFunction, int GlobalDim>
ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::ThermalTwoPhaseFlowWithPPLocalAssembler ( MeshLib::Element const & element,
std::size_t const ,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
ThermalTwoPhaseFlowWithPPProcessData const & process_data )
inline

Definition at line 107 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

113 : _element(element),
117 std::vector<double>(_integration_method.getNumberOfPoints())),
119 std::vector<double>(_integration_method.getNumberOfPoints())),
121 std::vector<double>(_integration_method.getNumberOfPoints())),
123 std::vector<double>(_integration_method.getNumberOfPoints())),
125 std::vector<double>(_integration_method.getNumberOfPoints()))
126 {
127 unsigned const n_integration_points =
128 _integration_method.getNumberOfPoints();
130 auto const shape_matrices =
134 for (unsigned ip = 0; ip < n_integration_points; ip++)
135 {
136 auto const& sm = shape_matrices[ip];
137 const double integration_factor = sm.integralMeasure * sm.detJ;
138 _ip_data.emplace_back(
139 sm.N, sm.dNdx,
140 sm.integralMeasure * sm.detJ *
141 _integration_method.getWeightedPoint(ip).getWeight(),
142 sm.N.transpose() * sm.N * integration_factor *
143 _integration_method.getWeightedPoint(ip).getWeight(),
144 sm.dNdx.transpose() * sm.dNdx * integration_factor *
145 _integration_method.getWeightedPoint(ip).getWeight());
146 }
147 }
std::vector< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType, NodalMatrixType >, Eigen::aligned_allocator< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType, NodalMatrixType > > > _ip_data

References _element, _gas_molar_fraction_contaminant, _gas_molar_fraction_water, _integration_method, _ip_data, _liquid_molar_fraction_contaminant, _pressure_wetting, _process_data, _saturation, and NumLib::initShapeMatrices().

Member Function Documentation

◆ assemble()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::assemble ( double const t,
double const dt,
std::vector< double > const & local_x,
std::vector< double > const & local_x_prev,
std::vector< double > & local_M_data,
std::vector< double > & local_K_data,
std::vector< double > & local_b_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 20 of file ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h.

27{
30
31 auto const local_matrix_size = local_x.size();
32
34
41
42 auto Map =
51
60
69
78
81
82 auto Kap =
91
100
109
116
119 auto Bw =
121 auto Bc =
123 auto Be =
125
126 unsigned const n_integration_points =
127 _integration_method.getNumberOfPoints();
128
130 auto const pg_nodal_values =
132 auto const pc_nodal_values =
134
136
137 GlobalDimMatrixType const& I(
139
140 for (unsigned ip = 0; ip < n_integration_points; ip++)
141 {
142 auto const& ip_data = _ip_data[ip];
143 auto const& N = ip_data.N;
144 auto const& dNdx = ip_data.dNdx;
145 auto const& w = ip_data.integration_weight;
146 auto const& mass_operator = ip_data.mass_operator;
147 auto const& diffusion_operator = ip_data.diffusion_operator;
148 double pg_int_pt = 0.;
149 double pc_int_pt = 0.;
150 double Xc_int_pt = 0.;
151 double T_int_pt = 0.;
154
156 std::nullopt, _element.getID(),
159 _element, N))};
160
164 vars.temperature = T_int_pt;
165 vars.capillary_pressure = pc_int_pt;
166 vars.gas_phase_pressure = pg_int_pt;
167
168 auto const& medium =
169 *_process_data.media_map.getMedium(this->_element.getID());
170 auto const& liquid_phase = medium.phase("AqueousLiquid");
171 auto const& solid_phase = medium.phase("Solid");
172 auto const& gas_phase = medium.phase("Gas");
173
174 auto const& water_vapour_component = gas_phase.component("w");
175 auto const& dry_air_component = gas_phase.component("a");
176 auto const& contaminant_vapour_component = gas_phase.component("c");
178 liquid_phase.component("c");
179
180 auto const porosity =
182 .template value<double>(vars, pos, t, dt);
183
184 auto const water_mol_mass =
187 .template value<double>(vars, pos, t, dt);
188 auto const air_mol_mass =
191 .template value<double>(vars, pos, t, dt);
192 auto const contaminant_mol_mass =
195 .template value<double>(vars, pos, t, dt);
196
197 double const Sw =
199 .template value<double>(vars, pos, t, dt);
200
201 _saturation[ip] = Sw;
202 vars.liquid_saturation = Sw;
203
204 double const dSw_dpc =
206 .template dValue<double>(
208 pos, t, dt);
209
210 auto const density_water =
212 .template value<double>(vars, pos, t, dt);
213
214 // molar densities and derivatives
216 double const mol_density_wet = mol_density_water;
217
218 double const mol_density_nonwet =
220 double const mol_density_tot =
222
223 double const d_mol_density_nonwet_dpg =
226 double const d_mol_density_tot_dpc =
228 double const d_mol_density_tot_dpg =
230 double const d_mol_density_tot_dT = (1 - Sw) * d_mol_density_nonwet_dT;
231
232 // specific latent heat of evaporation
233 double const latent_heat_evaporation =
235 .property(
237 .template value<double>(vars, pos, t, dt);
238
239 vars.enthalpy_of_evaporation = latent_heat_evaporation;
240
241 // saturated vapour pressure
242 vars.molar_mass = air_mol_mass;
243 double const p_sat =
246 .template value<double>(vars, pos, t, dt);
247 double const dp_sat_dT =
250 .template dValue<double>(
252 dt);
253
254 // Kelvin-Laplace correction for menisci
255 double const K = std::exp(-pc_int_pt / mol_density_water /
257 double const dK_dT = pc_int_pt / mol_density_water /
259
260 // vapour pressure inside pore space (water partial pressure in gas
261 // phase)
262 double const p_vapour_nonwet = p_sat * K;
263 double const d_p_vapour_nonwet_dT = dp_sat_dT * K + p_sat * dK_dT;
264 double const d_p_vapour_nonwet_dpc =
267
268 // Henry constant of organic contaminant
269 double const henry_contam =
272 .template value<double>(vars, pos, t, dt);
276 .template dValue<double>(
278 dt);
279
280 // mass distribution coefficients of contam. and water
281 double const k_c = pg_int_pt * henry_contam / mol_density_wet;
282 double const k_w = pg_int_pt / p_vapour_nonwet;
283
284 // intermediate parameter
285 double const Ntot_c =
287 // phase-wise component molar fractions
288 double const x_contaminant_nonwet =
291 double const x_water_wet = 1 - x_contaminant_wet;
292 double const x_water_nonwet = x_water_wet / k_w;
294
298
299 double const d_kc_dpg = henry_contam / mol_density_wet;
300 double const d_kc_dT =
302
303 // derivatives of component molar fractions w.r.t. PVs
304 double const d_x_contaminant_nonwet_dpc =
308 double const d_x_contaminant_nonwet_dpg =
314 double const d_x_contaminant_nonwet_dT =
317 (1 - Sw) * d_mol_density_nonwet_dT) *
319
321 double const d_x_contaminant_wet_dpg =
324 double const d_x_contaminant_wet_dT =
326
331
332 double const d_x_water_nonwet_dpc =
335 pg_int_pt;
336 double const d_x_water_nonwet_dpg =
340 double const d_x_water_nonwet_dT =
343 pg_int_pt;
344
345 double const d_x_air_nonwet_dpc =
347 double const d_x_air_nonwet_dpg =
349 double const d_x_air_nonwet_dXc =
351 double const d_x_air_nonwet_dT =
353
354 // mass densities
355 double const density_contaminant_wet =
358
359 double const density_air_nonwet =
361 double const density_water_nonwet =
363 double const density_contaminant_nonwet =
365 double const density_nonwet = density_air_nonwet +
368
369 auto const density_solid =
371 .template value<double>(vars, pos, t, dt);
372
373 // derivatives of nonwet phase densities w.r.t. PVs
374 double const d_density_nonwet_dpg =
382 double const d_density_nonwet_dpc =
387 double const d_density_nonwet_dXc =
392 double const d_density_nonwet_dT =
400
401 double const mol_mass_nonwet =
404 // phase-wise component mass fractions
405 double const X_water_nonwet =
407 double const X_air_nonwet =
410
411 // spec. heat capacities
412 double const heat_capacity_dry_air =
414 .property(
416 .template value<double>(vars, pos, t, dt);
417 double const heat_capacity_water_vapour =
419 .property(
421 .template value<double>(vars, pos, t, dt);
424 .property(
426 .template value<double>(vars, pos, t, dt);
427
428 double const heat_capacity_water =
430 .property(
432 .template value<double>(vars, pos, t, dt);
433 double const heat_capacity_solid =
435 .property(
437 .template value<double>(vars, pos, t, dt);
438
439 // enthalpies of gaseous components
440 // Note: h^a_G = C^a_P * (T - T0) = C^a_V * (T - T0) + RT/M^a, thus
441 // "C^a_V" should be used in the following. Same for contaminant.
442 double const enthalpy_air_nonwet =
445 double const enthalpy_water_nonwet =
448 double const enthalpy_contaminant_nonwet =
452
453 // gas and liquid phase enthalpies
454 double const enthalpy_nonwet =
458 double const enthalpy_wet =
460
461 // gas and liquid phase internal energies
462 double const internal_energy_nonwet =
464 double const internal_energy_wet = enthalpy_wet;
465
466 // derivatives of enthalpies w.r.t. temperature
467 double const d_enthalpy_air_nonwet_dT =
472
473 double const d_enthalpy_nonwet_dT =
477
478 // Assemble M matrix
479 Map.noalias() += porosity * (1 - Sw) *
483 Mapc.noalias() +=
487 Max.noalias() += porosity * mol_density_nonwet * (1 - Sw) *
489 Mat.noalias() += porosity * (1 - Sw) *
493
494 Mwp.noalias() +=
495 porosity *
500 Mwpc.noalias() +=
501 porosity *
507 Mwx.noalias() +=
508 porosity *
512 Mwt.noalias() += porosity *
516
517 Mcp.noalias() +=
518 porosity *
523 Mcpc.noalias() +=
524 porosity *
530 Mcx.noalias() +=
531 porosity *
535 Mct.noalias() +=
536 porosity *
541
542 Mep.noalias() += porosity *
544 (1 - Sw) * mass_operator;
545 Mepc.noalias() += porosity *
550 (1 - Sw) * mass_operator;
552 (1 - Sw) * mass_operator;
553 Met.noalias() +=
559
560 // pore diffusion coefficients
561 double const diffusion_coeff_water_nonwet =
564 .template value<double>(vars, pos, t, dt);
568 .template value<double>(vars, pos, t, dt);
572 .template value<double>(vars, pos, t, dt);
573
574 // gas phase relative permeability, viscosity and mobility
575 double const k_rel_nonwet =
576 medium
579 .template value<double>(vars, pos, t, dt);
580 auto const mu_nonwet =
582 .template value<double>(vars, pos, t, dt);
583 double const lambda_nonwet = k_rel_nonwet / mu_nonwet;
584
585 // liquid phase relative permeability, viscosity and mobility
586 double const k_rel_wet =
587 medium
588 .property(
590 .template value<double>(vars, pos, t, dt);
591 auto const mu_wet =
593 .template value<double>(vars, pos, t, dt);
594 double const lambda_wet = k_rel_wet / mu_wet;
595
596 // intrinsic permeability
597 auto const permeability =
600 .value(vars, pos, t, dt));
601
602 // gravity
603 auto const& b = _process_data.specific_body_force;
604
605 // gas and liquid phase velocities
607 _process_data.has_gravity
611 density_wet * b))
614
615 laplace_operator.noalias() = dNdx.transpose() * permeability * dNdx * w;
616
617 // mechanical dispersivities
619 medium.template value<double>(
622 medium.template value<double>(
624
625 double const velocity_wet_magnitude = velocity_wet.norm();
632 I +
636 velocity_wet.transpose())
641 I);
642
643 auto const dispersion_operator =
644 dNdx.transpose() * hydrodynamic_dispersion * dNdx * w;
645
646 // Assemble K matrix
647 // The sum of all diffusive fluxes in either phase must equal to zero
648 Kap.noalias() +=
651 (1 - Sw) * porosity * mol_density_nonwet *
656 Kapc.noalias() +=
657 -(1 - Sw) * porosity * mol_density_nonwet *
661 Kax.noalias() +=
662 -(1 - Sw) * porosity * mol_density_nonwet *
666 Kat.noalias() +=
667 -(1 - Sw) * porosity * mol_density_nonwet *
671
672 Kwp.noalias() +=
676 porosity *
682 Kwpc.noalias() +=
684 porosity *
690 Kwx.noalias() +=
691 porosity *
697 Kwt.noalias() +=
698 porosity *
704
705 Kcp.noalias() +=
710 porosity * (1 - Sw) * mol_density_nonwet *
713 Kcpc.noalias() +=
717 porosity * (1 - Sw) * mol_density_nonwet *
720 Kcx.noalias() +=
722 porosity * (1 - Sw) * mol_density_nonwet *
725 Kct.noalias() +=
727 porosity * (1 - Sw) * mol_density_nonwet *
730
734 Kepc.noalias() +=
736
737 if (medium.hasProperty(
739 {
740 auto const lambda =
741 medium
742 .property(
743 MaterialPropertyLib::PropertyType::thermal_conductivity)
744 .value(vars, pos, t, dt);
745
746 GlobalDimMatrixType const heat_conductivity_unsaturated =
747 MaterialPropertyLib::formEigenTensor<GlobalDim>(lambda);
748
749 Ket.noalias() +=
750 dNdx.transpose() * heat_conductivity_unsaturated * dNdx * w;
751 }
752 else
753 {
754 auto const thermal_conductivity_solid =
755 solid_phase
756 .property(
757 MaterialPropertyLib::PropertyType::thermal_conductivity)
758 .value(vars, pos, t, dt);
759
760 auto const thermal_conductivity_fluid =
761 liquid_phase
762 .property(
763 MaterialPropertyLib::PropertyType::thermal_conductivity)
764 .template value<double>(vars, pos, t, dt) *
765 Sw;
766
767 GlobalDimMatrixType const heat_conductivity_unsaturated =
768 MaterialPropertyLib::formEffectiveThermalConductivity<
769 GlobalDim>(thermal_conductivity_solid,
770 thermal_conductivity_fluid, porosity);
771
772 Ket.noalias() +=
773 dNdx.transpose() * heat_conductivity_unsaturated * dNdx * w;
774 }
775
776 if (_process_data.has_gravity)
777 {
778 NodalVectorType gravity_operator =
779 dNdx.transpose() * permeability * b * w;
780 Ba.noalias() += (mol_density_nonwet * x_air_nonwet * lambda_nonwet *
781 density_nonwet) *
782 gravity_operator;
783 Bw.noalias() +=
784 (mol_density_wet * x_water_wet * lambda_wet * density_wet +
785 mol_density_nonwet * x_water_nonwet * lambda_nonwet *
786 density_nonwet) *
787 gravity_operator;
788 Bc.noalias() += (mol_density_wet * x_contaminant_wet * lambda_wet *
789 density_wet +
790 mol_density_nonwet * x_contaminant_nonwet *
791 lambda_nonwet * density_nonwet) *
792 gravity_operator;
793 Be.noalias() +=
794 (lambda_nonwet * density_nonwet * density_nonwet *
795 enthalpy_nonwet +
796 lambda_wet * density_wet * density_wet * enthalpy_wet) *
797 gravity_operator;
798 } // end of has gravity
799 }
800 if (_process_data.has_mass_lumping)
801 {
802 Map = Map.colwise().sum().eval().asDiagonal();
803 Mapc = Mapc.colwise().sum().eval().asDiagonal();
804 Max = Max.colwise().sum().eval().asDiagonal();
805 Mat = Mat.colwise().sum().eval().asDiagonal();
806 Mwp = Mwp.colwise().sum().eval().asDiagonal();
807 Mwpc = Mwpc.colwise().sum().eval().asDiagonal();
808 Mwx = Mwx.colwise().sum().eval().asDiagonal();
809 Mwt = Mwt.colwise().sum().eval().asDiagonal();
810 Mcp = Mcp.colwise().sum().eval().asDiagonal();
811 Mcpc = Mcpc.colwise().sum().eval().asDiagonal();
812 Mcx = Mcx.colwise().sum().eval().asDiagonal();
813 Mct = Mct.colwise().sum().eval().asDiagonal();
814 Mep = Mep.colwise().sum().eval().asDiagonal();
815 Mepc = Mepc.colwise().sum().eval().asDiagonal();
816 Mex = Mex.colwise().sum().eval().asDiagonal();
817 Met = Met.colwise().sum().eval().asDiagonal();
818 } // end of mass-lumping
819}
constexpr Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)

References _element, _gas_molar_fraction_contaminant, _gas_molar_fraction_water, _integration_method, _ip_data, _liquid_molar_fraction_contaminant, _pressure_wetting, _process_data, _saturation, cap_pressure_matrix_index, MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::VariableArray::capillary_pressure, MaterialLib::PhysicalConstant::CelsiusZeroInKelvin, contaminant_matrix_index, MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::enthalpy_of_evaporation, MaterialPropertyLib::formEffectiveThermalConductivity(), MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::VariableArray::gas_phase_pressure, MaterialPropertyLib::henry_coefficient, MaterialLib::PhysicalConstant::IdealGasConstant, NumLib::interpolateCoordinates(), MaterialPropertyLib::VariableArray::liquid_saturation, MaterialPropertyLib::longitudinal_dispersivity, MaterialPropertyLib::molar_mass, MaterialPropertyLib::VariableArray::molar_mass, nonwet_pressure_matrix_index, ProcessLib::ThermalTwoPhaseFlowWithPP::NUM_NODAL_DOF, MaterialPropertyLib::permeability, MaterialPropertyLib::pore_diffusion, MaterialPropertyLib::porosity, MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::specific_latent_heat, MaterialPropertyLib::temperature, MaterialPropertyLib::VariableArray::temperature, temperature_matrix_index, MaterialPropertyLib::thermal_conductivity, MaterialPropertyLib::transversal_dispersivity, MaterialPropertyLib::vapour_pressure, and MaterialPropertyLib::viscosity.

◆ getIntPtGasMolFracContaminant()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::getIntPtGasMolFracContaminant ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > &  ) const
inlineoverridevirtual

◆ getIntPtGasMolFracWater()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::getIntPtGasMolFracWater ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > &  ) const
inlineoverridevirtual

◆ getIntPtLiquidMolFracContaminant()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::getIntPtLiquidMolFracContaminant ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > &  ) const
inlineoverridevirtual

◆ getIntPtSaturation()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::getIntPtSaturation ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > &  ) const
inlineoverridevirtual

◆ getIntPtWettingPressure()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::getIntPtWettingPressure ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > &  ) const
inlineoverridevirtual

◆ getShapeMatrix()

template<typename ShapeFunction, int GlobalDim>
Eigen::Map< const Eigen::RowVectorXd > ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::getShapeMatrix ( const unsigned integration_point) const
inlineoverridevirtual

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 156 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

158 {
159 auto const& N = _ip_data[integration_point].N;
160
161 // assumes N is stored contiguously in memory
162 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
163 }

References _ip_data.

Member Data Documentation

◆ _element

◆ _gas_molar_fraction_contaminant

template<typename ShapeFunction, int GlobalDim>
std::vector<double> ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::_gas_molar_fraction_contaminant
private

◆ _gas_molar_fraction_water

template<typename ShapeFunction, int GlobalDim>
std::vector<double> ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::_gas_molar_fraction_water
private

◆ _integration_method

◆ _ip_data

◆ _liquid_molar_fraction_contaminant

template<typename ShapeFunction, int GlobalDim>
std::vector<double> ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::_liquid_molar_fraction_contaminant
private

◆ _pressure_wetting

template<typename ShapeFunction, int GlobalDim>
std::vector<double> ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::_pressure_wetting
private

◆ _process_data

◆ _saturation

template<typename ShapeFunction, int GlobalDim>
std::vector<double> ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::_saturation
private

◆ cap_pressure_matrix_index

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::cap_pressure_matrix_index = ShapeFunction::NPOINTS
staticprivate

Definition at line 235 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

Referenced by assemble().

◆ cap_pressure_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::cap_pressure_size = ShapeFunction::NPOINTS
staticprivate

Definition at line 240 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ contaminant_matrix_index

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::contaminant_matrix_index = 2 * ShapeFunction::NPOINTS
staticprivate

Definition at line 236 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

Referenced by assemble().

◆ contaminant_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::contaminant_size = ShapeFunction::NPOINTS
staticprivate

Definition at line 241 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ nonwet_pressure_matrix_index

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::nonwet_pressure_matrix_index = 0
staticprivate

Definition at line 234 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

Referenced by assemble().

◆ nonwet_pressure_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::nonwet_pressure_size = ShapeFunction::NPOINTS
staticprivate

Definition at line 239 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ temperature_matrix_index

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::temperature_matrix_index = 3 * ShapeFunction::NPOINTS
staticprivate

Definition at line 237 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

Referenced by assemble().

◆ temperature_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::temperature_size = ShapeFunction::NPOINTS
staticprivate

Definition at line 242 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.


The documentation for this class was generated from the following files: