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 94 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 std::optional< VectorSegmentgetVectorDeformationSegment () 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 108 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 104 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ GlobalDimVectorType

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

Definition at line 109 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 100 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ LocalMatrixType

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

Definition at line 110 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ LocalVectorType

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

Definition at line 111 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ NodalMatrixType

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

Definition at line 106 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ NodalRowVectorType

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

Definition at line 102 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ NodalVectorType

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

Definition at line 107 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ ShapeMatrices

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

Definition at line 98 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

◆ ShapeMatricesType

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

Definition at line 97 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 114 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

120 : _element(element),
124 std::vector<double>(_integration_method.getNumberOfPoints())),
126 std::vector<double>(_integration_method.getNumberOfPoints())),
128 std::vector<double>(_integration_method.getNumberOfPoints())),
130 std::vector<double>(_integration_method.getNumberOfPoints())),
132 std::vector<double>(_integration_method.getNumberOfPoints()))
133 {
134 unsigned const n_integration_points =
135 _integration_method.getNumberOfPoints();
137 auto const shape_matrices =
141 for (unsigned ip = 0; ip < n_integration_points; ip++)
142 {
143 auto const& sm = shape_matrices[ip];
144 const double integration_factor = sm.integralMeasure * sm.detJ;
145 _ip_data.emplace_back(
146 sm.N, sm.dNdx,
147 sm.integralMeasure * sm.detJ *
148 _integration_method.getWeightedPoint(ip).getWeight(),
149 sm.N.transpose() * sm.N * integration_factor *
150 _integration_method.getWeightedPoint(ip).getWeight(),
151 sm.dNdx.transpose() * sm.dNdx * integration_factor *
152 _integration_method.getWeightedPoint(ip).getWeight());
153 }
154 }
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 27 of file ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h.

34{
37
38 auto const local_matrix_size = local_x.size();
39
41
48
49 auto Map =
58
67
76
85
88
89 auto Kap =
98
107
116
123
126 auto Bw =
128 auto Bc =
130 auto Be =
132
133 unsigned const n_integration_points =
134 _integration_method.getNumberOfPoints();
135
137 auto const pg_nodal_values =
139 auto const pc_nodal_values =
141
143
144 GlobalDimMatrixType const& I(
146
147 for (unsigned ip = 0; ip < n_integration_points; ip++)
148 {
149 auto const& ip_data = _ip_data[ip];
150 auto const& N = ip_data.N;
151 auto const& dNdx = ip_data.dNdx;
152 auto const& w = ip_data.integration_weight;
153 auto const& mass_operator = ip_data.mass_operator;
154 auto const& diffusion_operator = ip_data.diffusion_operator;
155 double pg_int_pt = 0.;
156 double pc_int_pt = 0.;
157 double Xc_int_pt = 0.;
158 double T_int_pt = 0.;
161
163 std::nullopt, _element.getID(),
166 _element, N))};
167
171 vars.temperature = T_int_pt;
172 vars.capillary_pressure = pc_int_pt;
173 vars.gas_phase_pressure = pg_int_pt;
174
175 auto const& medium =
176 *_process_data.media_map.getMedium(this->_element.getID());
177 auto const& liquid_phase = medium.phase("AqueousLiquid");
178 auto const& solid_phase = medium.phase("Solid");
179 auto const& gas_phase = medium.phase("Gas");
180
181 auto const& water_vapour_component = gas_phase.component("w");
182 auto const& dry_air_component = gas_phase.component("a");
183 auto const& contaminant_vapour_component = gas_phase.component("c");
185 liquid_phase.component("c");
186
187 auto const porosity =
189 .template value<double>(vars, pos, t, dt);
190
191 auto const water_mol_mass =
194 .template value<double>(vars, pos, t, dt);
195 auto const air_mol_mass =
198 .template value<double>(vars, pos, t, dt);
199 auto const contaminant_mol_mass =
202 .template value<double>(vars, pos, t, dt);
203
204 double const Sw =
206 .template value<double>(vars, pos, t, dt);
207
208 _saturation[ip] = Sw;
209 vars.liquid_saturation = Sw;
210
211 double const dSw_dpc =
213 .template dValue<double>(
215 pos, t, dt);
216
217 auto const density_water =
219 .template value<double>(vars, pos, t, dt);
220
221 // molar densities and derivatives
223 double const mol_density_wet = mol_density_water;
224
225 double const mol_density_nonwet =
227 double const mol_density_tot =
229
230 double const d_mol_density_nonwet_dpg =
233 double const d_mol_density_tot_dpc =
235 double const d_mol_density_tot_dpg =
237 double const d_mol_density_tot_dT = (1 - Sw) * d_mol_density_nonwet_dT;
238
239 // specific latent heat of evaporation
240 double const latent_heat_evaporation =
242 .property(
244 .template value<double>(vars, pos, t, dt);
245
246 vars.enthalpy_of_evaporation = latent_heat_evaporation;
247
248 // saturated vapour pressure
249 vars.molar_mass = air_mol_mass;
250 double const p_sat =
253 .template value<double>(vars, pos, t, dt);
254 double const dp_sat_dT =
257 .template dValue<double>(
259 dt);
260
261 // Kelvin-Laplace correction for menisci
262 double const K = std::exp(-pc_int_pt / mol_density_water /
264 double const dK_dT = pc_int_pt / mol_density_water /
266
267 // vapour pressure inside pore space (water partial pressure in gas
268 // phase)
269 double const p_vapour_nonwet = p_sat * K;
270 double const d_p_vapour_nonwet_dT = dp_sat_dT * K + p_sat * dK_dT;
271 double const d_p_vapour_nonwet_dpc =
274
275 // Henry constant of organic contaminant
276 double const henry_contam =
279 .template value<double>(vars, pos, t, dt);
283 .template dValue<double>(
285 dt);
286
287 // mass distribution coefficients of contam. and water
288 double const k_c = pg_int_pt * henry_contam / mol_density_wet;
289 double const k_w = pg_int_pt / p_vapour_nonwet;
290
291 // intermediate parameter
292 double const Ntot_c =
294 // phase-wise component molar fractions
295 double const x_contaminant_nonwet =
298 double const x_water_wet = 1 - x_contaminant_wet;
299 double const x_water_nonwet = x_water_wet / k_w;
301
305
306 double const d_kc_dpg = henry_contam / mol_density_wet;
307 double const d_kc_dT =
309
310 // derivatives of component molar fractions w.r.t. PVs
311 double const d_x_contaminant_nonwet_dpc =
315 double const d_x_contaminant_nonwet_dpg =
321 double const d_x_contaminant_nonwet_dT =
324 (1 - Sw) * d_mol_density_nonwet_dT) *
326
328 double const d_x_contaminant_wet_dpg =
331 double const d_x_contaminant_wet_dT =
333
338
339 double const d_x_water_nonwet_dpc =
342 pg_int_pt;
343 double const d_x_water_nonwet_dpg =
347 double const d_x_water_nonwet_dT =
350 pg_int_pt;
351
352 double const d_x_air_nonwet_dpc =
354 double const d_x_air_nonwet_dpg =
356 double const d_x_air_nonwet_dXc =
358 double const d_x_air_nonwet_dT =
360
361 // mass densities
362 double const density_contaminant_wet =
365
366 double const density_air_nonwet =
368 double const density_water_nonwet =
370 double const density_contaminant_nonwet =
372 double const density_nonwet = density_air_nonwet +
375
376 auto const density_solid =
378 .template value<double>(vars, pos, t, dt);
379
380 // derivatives of nonwet phase densities w.r.t. PVs
381 double const d_density_nonwet_dpg =
389 double const d_density_nonwet_dpc =
394 double const d_density_nonwet_dXc =
399 double const d_density_nonwet_dT =
407
408 double const mol_mass_nonwet =
411 // phase-wise component mass fractions
412 double const X_water_nonwet =
414 double const X_air_nonwet =
417
418 // spec. heat capacities
419 double const heat_capacity_dry_air =
421 .property(
423 .template value<double>(vars, pos, t, dt);
424 double const heat_capacity_water_vapour =
426 .property(
428 .template value<double>(vars, pos, t, dt);
431 .property(
433 .template value<double>(vars, pos, t, dt);
434
435 double const heat_capacity_water =
437 .property(
439 .template value<double>(vars, pos, t, dt);
440 double const heat_capacity_solid =
442 .property(
444 .template value<double>(vars, pos, t, dt);
445
446 // enthalpies of gaseous components
447 // Note: h^a_G = C^a_P * (T - T0) = C^a_V * (T - T0) + RT/M^a, thus
448 // "C^a_V" should be used in the following. Same for contaminant.
449 double const enthalpy_air_nonwet =
452 double const enthalpy_water_nonwet =
455 double const enthalpy_contaminant_nonwet =
459
460 // gas and liquid phase enthalpies
461 double const enthalpy_nonwet =
465 double const enthalpy_wet =
467
468 // gas and liquid phase internal energies
469 double const internal_energy_nonwet =
471 double const internal_energy_wet = enthalpy_wet;
472
473 // derivatives of enthalpies w.r.t. temperature
474 double const d_enthalpy_air_nonwet_dT =
479
480 double const d_enthalpy_nonwet_dT =
484
485 // Assemble M matrix
486 Map.noalias() += porosity * (1 - Sw) *
490 Mapc.noalias() +=
494 Max.noalias() += porosity * mol_density_nonwet * (1 - Sw) *
496 Mat.noalias() += porosity * (1 - Sw) *
500
501 Mwp.noalias() +=
502 porosity *
507 Mwpc.noalias() +=
508 porosity *
514 Mwx.noalias() +=
515 porosity *
519 Mwt.noalias() += porosity *
523
524 Mcp.noalias() +=
525 porosity *
530 Mcpc.noalias() +=
531 porosity *
537 Mcx.noalias() +=
538 porosity *
542 Mct.noalias() +=
543 porosity *
548
549 Mep.noalias() += porosity *
551 (1 - Sw) * mass_operator;
552 Mepc.noalias() += porosity *
557 (1 - Sw) * mass_operator;
559 (1 - Sw) * mass_operator;
560 Met.noalias() +=
566
567 // pore diffusion coefficients
568 double const diffusion_coeff_water_nonwet =
571 .template value<double>(vars, pos, t, dt);
575 .template value<double>(vars, pos, t, dt);
579 .template value<double>(vars, pos, t, dt);
580
581 // gas phase relative permeability, viscosity and mobility
582 double const k_rel_nonwet =
583 medium
586 .template value<double>(vars, pos, t, dt);
587 auto const mu_nonwet =
589 .template value<double>(vars, pos, t, dt);
590 double const lambda_nonwet = k_rel_nonwet / mu_nonwet;
591
592 // liquid phase relative permeability, viscosity and mobility
593 double const k_rel_wet =
594 medium
595 .property(
597 .template value<double>(vars, pos, t, dt);
598 auto const mu_wet =
600 .template value<double>(vars, pos, t, dt);
601 double const lambda_wet = k_rel_wet / mu_wet;
602
603 // intrinsic permeability
604 auto const permeability =
607 .value(vars, pos, t, dt));
608
609 // gravity
610 auto const& b = _process_data.specific_body_force;
611
612 // gas and liquid phase velocities
614 _process_data.has_gravity
618 density_wet * b))
621
622 laplace_operator.noalias() = dNdx.transpose() * permeability * dNdx * w;
623
624 // mechanical dispersivities
626 medium.template value<double>(
629 medium.template value<double>(
631
632 double const velocity_wet_magnitude = velocity_wet.norm();
639 I +
643 velocity_wet.transpose())
648 I);
649
650 auto const dispersion_operator =
651 dNdx.transpose() * hydrodynamic_dispersion * dNdx * w;
652
653 // Assemble K matrix
654 // The sum of all diffusive fluxes in either phase must equal to zero
655 Kap.noalias() +=
658 (1 - Sw) * porosity * mol_density_nonwet *
663 Kapc.noalias() +=
664 -(1 - Sw) * porosity * mol_density_nonwet *
668 Kax.noalias() +=
669 -(1 - Sw) * porosity * mol_density_nonwet *
673 Kat.noalias() +=
674 -(1 - Sw) * porosity * mol_density_nonwet *
678
679 Kwp.noalias() +=
683 porosity *
689 Kwpc.noalias() +=
691 porosity *
697 Kwx.noalias() +=
698 porosity *
704 Kwt.noalias() +=
705 porosity *
711
712 Kcp.noalias() +=
717 porosity * (1 - Sw) * mol_density_nonwet *
720 Kcpc.noalias() +=
724 porosity * (1 - Sw) * mol_density_nonwet *
727 Kcx.noalias() +=
729 porosity * (1 - Sw) * mol_density_nonwet *
732 Kct.noalias() +=
734 porosity * (1 - Sw) * mol_density_nonwet *
737
741 Kepc.noalias() +=
743
744 if (medium.hasProperty(
746 {
747 auto const lambda =
748 medium
749 .property(
750 MaterialPropertyLib::PropertyType::thermal_conductivity)
751 .value(vars, pos, t, dt);
752
753 GlobalDimMatrixType const heat_conductivity_unsaturated =
754 MaterialPropertyLib::formEigenTensor<GlobalDim>(lambda);
755
756 Ket.noalias() +=
757 dNdx.transpose() * heat_conductivity_unsaturated * dNdx * w;
758 }
759 else
760 {
761 auto const thermal_conductivity_solid =
762 solid_phase
763 .property(
764 MaterialPropertyLib::PropertyType::thermal_conductivity)
765 .value(vars, pos, t, dt);
766
767 auto const thermal_conductivity_fluid =
768 liquid_phase
769 .property(
770 MaterialPropertyLib::PropertyType::thermal_conductivity)
771 .template value<double>(vars, pos, t, dt) *
772 Sw;
773
774 GlobalDimMatrixType const heat_conductivity_unsaturated =
775 MaterialPropertyLib::formEffectiveThermalConductivity<
776 GlobalDim>(thermal_conductivity_solid,
777 thermal_conductivity_fluid, porosity);
778
779 Ket.noalias() +=
780 dNdx.transpose() * heat_conductivity_unsaturated * dNdx * w;
781 }
782
783 if (_process_data.has_gravity)
784 {
785 NodalVectorType gravity_operator =
786 dNdx.transpose() * permeability * b * w;
787 Ba.noalias() += (mol_density_nonwet * x_air_nonwet * lambda_nonwet *
788 density_nonwet) *
789 gravity_operator;
790 Bw.noalias() +=
791 (mol_density_wet * x_water_wet * lambda_wet * density_wet +
792 mol_density_nonwet * x_water_nonwet * lambda_nonwet *
793 density_nonwet) *
794 gravity_operator;
795 Bc.noalias() += (mol_density_wet * x_contaminant_wet * lambda_wet *
796 density_wet +
797 mol_density_nonwet * x_contaminant_nonwet *
798 lambda_nonwet * density_nonwet) *
799 gravity_operator;
800 Be.noalias() +=
801 (lambda_nonwet * density_nonwet * density_nonwet *
802 enthalpy_nonwet +
803 lambda_wet * density_wet * density_wet * enthalpy_wet) *
804 gravity_operator;
805 } // end of has gravity
806 }
807 if (_process_data.has_mass_lumping)
808 {
809 Map = Map.colwise().sum().eval().asDiagonal();
810 Mapc = Mapc.colwise().sum().eval().asDiagonal();
811 Max = Max.colwise().sum().eval().asDiagonal();
812 Mat = Mat.colwise().sum().eval().asDiagonal();
813 Mwp = Mwp.colwise().sum().eval().asDiagonal();
814 Mwpc = Mwpc.colwise().sum().eval().asDiagonal();
815 Mwx = Mwx.colwise().sum().eval().asDiagonal();
816 Mwt = Mwt.colwise().sum().eval().asDiagonal();
817 Mcp = Mcp.colwise().sum().eval().asDiagonal();
818 Mcpc = Mcpc.colwise().sum().eval().asDiagonal();
819 Mcx = Mcx.colwise().sum().eval().asDiagonal();
820 Mct = Mct.colwise().sum().eval().asDiagonal();
821 Mep = Mep.colwise().sum().eval().asDiagonal();
822 Mepc = Mepc.colwise().sum().eval().asDiagonal();
823 Mex = Mex.colwise().sum().eval().asDiagonal();
824 Met = Met.colwise().sum().eval().asDiagonal();
825 } // end of mass-lumping
826}
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 163 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.

165 {
166 auto const& N = _ip_data[integration_point].N;
167
168 // assumes N is stored contiguously in memory
169 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
170 }

References _ip_data.

Member Data Documentation

◆ _element

template<typename ShapeFunction, int GlobalDim>
MeshLib::Element const& ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::_element
private

◆ _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

template<typename ShapeFunction, int GlobalDim>
NumLib::GenericIntegrationMethod const& ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::_integration_method
private

◆ _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

template<typename ShapeFunction, int GlobalDim>
ThermalTwoPhaseFlowWithPPProcessData const& ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::_process_data
private

◆ _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 242 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 247 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 243 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 248 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 241 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 246 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 244 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 249 of file ThermalTwoPhaseFlowWithPPLocalAssembler.h.


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