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 21 of file ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h.

28{
31
32 auto const local_matrix_size = local_x.size();
33
35
42
43 auto Map =
52
61
70
79
82
83 auto Kap =
92
101
110
117
120 auto Bw =
122 auto Bc =
124 auto Be =
126
127 unsigned const n_integration_points =
128 _integration_method.getNumberOfPoints();
129
131 auto const pg_nodal_values =
133 auto const pc_nodal_values =
135
137
138 GlobalDimMatrixType const& I(
140
141 for (unsigned ip = 0; ip < n_integration_points; ip++)
142 {
143 auto const& ip_data = _ip_data[ip];
144 auto const& N = ip_data.N;
145 auto const& dNdx = ip_data.dNdx;
146 auto const& w = ip_data.integration_weight;
147 auto const& mass_operator = ip_data.mass_operator;
148 auto const& diffusion_operator = ip_data.diffusion_operator;
149 double pg_int_pt = 0.;
150 double pc_int_pt = 0.;
151 double Xc_int_pt = 0.;
152 double T_int_pt = 0.;
155
157 std::nullopt, _element.getID(),
160 _element, N))};
161
165 vars.temperature = T_int_pt;
166 vars.capillary_pressure = pc_int_pt;
167 vars.gas_phase_pressure = pg_int_pt;
168
169 auto const& medium =
170 *_process_data.media_map.getMedium(this->_element.getID());
171 auto const& liquid_phase =
173 auto const& solid_phase =
175 auto const& gas_phase =
177
178 auto const& water_vapour_component = gas_phase.component("w");
179 auto const& dry_air_component = gas_phase.component("a");
180 auto const& contaminant_vapour_component = gas_phase.component("c");
182 liquid_phase.component("c");
183
184 auto const porosity =
186 .template value<double>(vars, pos, t, dt);
187
188 auto const water_mol_mass =
191 .template value<double>(vars, pos, t, dt);
192 auto const air_mol_mass =
195 .template value<double>(vars, pos, t, dt);
196 auto const contaminant_mol_mass =
199 .template value<double>(vars, pos, t, dt);
200
201 double const Sw =
203 .template value<double>(vars, pos, t, dt);
204
205 _saturation[ip] = Sw;
206 vars.liquid_saturation = Sw;
207
208 double const dSw_dpc =
210 .template dValue<double>(
212 pos, t, dt);
213
214 auto const density_water =
216 .template value<double>(vars, pos, t, dt);
217
218 // molar densities and derivatives
220 double const mol_density_wet = mol_density_water;
221
222 double const mol_density_nonwet =
224 double const mol_density_tot =
226
227 double const d_mol_density_nonwet_dpg =
230 double const d_mol_density_tot_dpc =
232 double const d_mol_density_tot_dpg =
234 double const d_mol_density_tot_dT = (1 - Sw) * d_mol_density_nonwet_dT;
235
236 // specific latent heat of evaporation
237 double const latent_heat_evaporation =
239 .property(
241 .template value<double>(vars, pos, t, dt);
242
243 vars.enthalpy_of_evaporation = latent_heat_evaporation;
244
245 // saturated vapour pressure
246 vars.molar_mass = air_mol_mass;
247 double const p_sat =
250 .template value<double>(vars, pos, t, dt);
251 double const dp_sat_dT =
254 .template dValue<double>(
256 dt);
257
258 // Kelvin-Laplace correction for menisci
259 double const K = std::exp(-pc_int_pt / mol_density_water /
261 double const dK_dT = pc_int_pt / mol_density_water /
263
264 // vapour pressure inside pore space (water partial pressure in gas
265 // phase)
266 double const p_vapour_nonwet = p_sat * K;
267 double const d_p_vapour_nonwet_dT = dp_sat_dT * K + p_sat * dK_dT;
268 double const d_p_vapour_nonwet_dpc =
271
272 // Henry constant of organic contaminant
273 double const henry_contam =
276 .template value<double>(vars, pos, t, dt);
280 .template dValue<double>(
282 dt);
283
284 // mass distribution coefficients of contam. and water
285 double const k_c = pg_int_pt * henry_contam / mol_density_wet;
286 double const k_w = pg_int_pt / p_vapour_nonwet;
287
288 // intermediate parameter
289 double const Ntot_c =
291 // phase-wise component molar fractions
292 double const x_contaminant_nonwet =
295 double const x_water_wet = 1 - x_contaminant_wet;
296 double const x_water_nonwet = x_water_wet / k_w;
298
302
303 double const d_kc_dpg = henry_contam / mol_density_wet;
304 double const d_kc_dT =
306
307 // derivatives of component molar fractions w.r.t. PVs
308 double const d_x_contaminant_nonwet_dpc =
312 double const d_x_contaminant_nonwet_dpg =
318 double const d_x_contaminant_nonwet_dT =
321 (1 - Sw) * d_mol_density_nonwet_dT) *
323
325 double const d_x_contaminant_wet_dpg =
328 double const d_x_contaminant_wet_dT =
330
335
336 double const d_x_water_nonwet_dpc =
339 pg_int_pt;
340 double const d_x_water_nonwet_dpg =
344 double const d_x_water_nonwet_dT =
347 pg_int_pt;
348
349 double const d_x_air_nonwet_dpc =
351 double const d_x_air_nonwet_dpg =
353 double const d_x_air_nonwet_dXc =
355 double const d_x_air_nonwet_dT =
357
358 // mass densities
359 double const density_contaminant_wet =
362
363 double const density_air_nonwet =
365 double const density_water_nonwet =
367 double const density_contaminant_nonwet =
369 double const density_nonwet = density_air_nonwet +
372
373 auto const density_solid =
375 .template value<double>(vars, pos, t, dt);
376
377 // derivatives of nonwet phase densities w.r.t. PVs
378 double const d_density_nonwet_dpg =
386 double const d_density_nonwet_dpc =
391 double const d_density_nonwet_dXc =
396 double const d_density_nonwet_dT =
404
405 double const mol_mass_nonwet =
408 // phase-wise component mass fractions
409 double const X_water_nonwet =
411 double const X_air_nonwet =
414
415 // spec. heat capacities
416 double const heat_capacity_dry_air =
418 .property(
420 .template value<double>(vars, pos, t, dt);
421 double const heat_capacity_water_vapour =
423 .property(
425 .template value<double>(vars, pos, t, dt);
428 .property(
430 .template value<double>(vars, pos, t, dt);
431
432 double const heat_capacity_water =
434 .property(
436 .template value<double>(vars, pos, t, dt);
437 double const heat_capacity_solid =
439 .property(
441 .template value<double>(vars, pos, t, dt);
442
443 // enthalpies of gaseous components
444 // Note: h^a_G = C^a_P * (T - T0) = C^a_V * (T - T0) + RT/M^a, thus
445 // "C^a_V" should be used in the following. Same for contaminant.
446 double const enthalpy_air_nonwet =
449 double const enthalpy_water_nonwet =
452 double const enthalpy_contaminant_nonwet =
456
457 // gas and liquid phase enthalpies
458 double const enthalpy_nonwet =
462 double const enthalpy_wet =
464
465 // gas and liquid phase internal energies
466 double const internal_energy_nonwet =
468 double const internal_energy_wet = enthalpy_wet;
469
470 // derivatives of enthalpies w.r.t. temperature
471 double const d_enthalpy_air_nonwet_dT =
476
477 double const d_enthalpy_nonwet_dT =
481
482 // Assemble M matrix
483 Map.noalias() += porosity * (1 - Sw) *
487 Mapc.noalias() +=
491 Max.noalias() += porosity * mol_density_nonwet * (1 - Sw) *
493 Mat.noalias() += porosity * (1 - Sw) *
497
498 Mwp.noalias() +=
499 porosity *
504 Mwpc.noalias() +=
505 porosity *
511 Mwx.noalias() +=
512 porosity *
516 Mwt.noalias() += porosity *
520
521 Mcp.noalias() +=
522 porosity *
527 Mcpc.noalias() +=
528 porosity *
534 Mcx.noalias() +=
535 porosity *
539 Mct.noalias() +=
540 porosity *
545
546 Mep.noalias() += porosity *
548 (1 - Sw) * mass_operator;
549 Mepc.noalias() += porosity *
554 (1 - Sw) * mass_operator;
556 (1 - Sw) * mass_operator;
557 Met.noalias() +=
563
564 // pore diffusion coefficients
565 double const diffusion_coeff_water_nonwet =
568 .template value<double>(vars, pos, t, dt);
572 .template value<double>(vars, pos, t, dt);
576 .template value<double>(vars, pos, t, dt);
577
578 // gas phase relative permeability, viscosity and mobility
579 double const k_rel_nonwet =
580 medium
583 .template value<double>(vars, pos, t, dt);
584 auto const mu_nonwet =
586 .template value<double>(vars, pos, t, dt);
587 double const lambda_nonwet = k_rel_nonwet / mu_nonwet;
588
589 // liquid phase relative permeability, viscosity and mobility
590 double const k_rel_wet =
591 medium
592 .property(
594 .template value<double>(vars, pos, t, dt);
595 auto const mu_wet =
597 .template value<double>(vars, pos, t, dt);
598 double const lambda_wet = k_rel_wet / mu_wet;
599
600 // intrinsic permeability
601 auto const permeability =
604 .value(vars, pos, t, dt));
605
606 // gravity
607 auto const& b = _process_data.specific_body_force;
608
609 // gas and liquid phase velocities
611 _process_data.has_gravity
615 density_wet * b))
618
619 laplace_operator.noalias() = dNdx.transpose() * permeability * dNdx * w;
620
621 // mechanical dispersivities
623 medium.template value<double>(
626 medium.template value<double>(
628
629 double const velocity_wet_magnitude = velocity_wet.norm();
636 I +
640 velocity_wet.transpose())
645 I);
646
647 auto const dispersion_operator =
648 dNdx.transpose() * hydrodynamic_dispersion * dNdx * w;
649
650 // Assemble K matrix
651 // The sum of all diffusive fluxes in either phase must equal to zero
652 Kap.noalias() +=
655 (1 - Sw) * porosity * mol_density_nonwet *
660 Kapc.noalias() +=
661 -(1 - Sw) * porosity * mol_density_nonwet *
665 Kax.noalias() +=
666 -(1 - Sw) * porosity * mol_density_nonwet *
670 Kat.noalias() +=
671 -(1 - Sw) * porosity * mol_density_nonwet *
675
676 Kwp.noalias() +=
680 porosity *
686 Kwpc.noalias() +=
688 porosity *
694 Kwx.noalias() +=
695 porosity *
701 Kwt.noalias() +=
702 porosity *
708
709 Kcp.noalias() +=
714 porosity * (1 - Sw) * mol_density_nonwet *
717 Kcpc.noalias() +=
721 porosity * (1 - Sw) * mol_density_nonwet *
724 Kcx.noalias() +=
726 porosity * (1 - Sw) * mol_density_nonwet *
729 Kct.noalias() +=
731 porosity * (1 - Sw) * mol_density_nonwet *
734
738 Kepc.noalias() +=
740
741 if (medium.hasProperty(
743 {
744 auto const lambda =
745 medium
746 .property(
747 MaterialPropertyLib::PropertyType::thermal_conductivity)
748 .value(vars, pos, t, dt);
749
750 GlobalDimMatrixType const heat_conductivity_unsaturated =
751 MaterialPropertyLib::formEigenTensor<GlobalDim>(lambda);
752
753 Ket.noalias() +=
754 dNdx.transpose() * heat_conductivity_unsaturated * dNdx * w;
755 }
756 else
757 {
758 auto const thermal_conductivity_solid =
759 solid_phase
760 .property(
761 MaterialPropertyLib::PropertyType::thermal_conductivity)
762 .value(vars, pos, t, dt);
763
764 auto const thermal_conductivity_fluid =
765 liquid_phase
766 .property(
767 MaterialPropertyLib::PropertyType::thermal_conductivity)
768 .template value<double>(vars, pos, t, dt) *
769 Sw;
770
771 GlobalDimMatrixType const heat_conductivity_unsaturated =
772 MaterialPropertyLib::formEffectiveThermalConductivity<
773 GlobalDim>(thermal_conductivity_solid,
774 thermal_conductivity_fluid, porosity);
775
776 Ket.noalias() +=
777 dNdx.transpose() * heat_conductivity_unsaturated * dNdx * w;
778 }
779
780 if (_process_data.has_gravity)
781 {
782 NodalVectorType gravity_operator =
783 dNdx.transpose() * permeability * b * w;
784 Ba.noalias() += (mol_density_nonwet * x_air_nonwet * lambda_nonwet *
785 density_nonwet) *
786 gravity_operator;
787 Bw.noalias() +=
788 (mol_density_wet * x_water_wet * lambda_wet * density_wet +
789 mol_density_nonwet * x_water_nonwet * lambda_nonwet *
790 density_nonwet) *
791 gravity_operator;
792 Bc.noalias() += (mol_density_wet * x_contaminant_wet * lambda_wet *
793 density_wet +
794 mol_density_nonwet * x_contaminant_nonwet *
795 lambda_nonwet * density_nonwet) *
796 gravity_operator;
797 Be.noalias() +=
798 (lambda_nonwet * density_nonwet * density_nonwet *
799 enthalpy_nonwet +
800 lambda_wet * density_wet * density_wet * enthalpy_wet) *
801 gravity_operator;
802 } // end of has gravity
803 }
804 if (_process_data.has_mass_lumping)
805 {
806 Map = Map.colwise().sum().eval().asDiagonal();
807 Mapc = Mapc.colwise().sum().eval().asDiagonal();
808 Max = Max.colwise().sum().eval().asDiagonal();
809 Mat = Mat.colwise().sum().eval().asDiagonal();
810 Mwp = Mwp.colwise().sum().eval().asDiagonal();
811 Mwpc = Mwpc.colwise().sum().eval().asDiagonal();
812 Mwx = Mwx.colwise().sum().eval().asDiagonal();
813 Mwt = Mwt.colwise().sum().eval().asDiagonal();
814 Mcp = Mcp.colwise().sum().eval().asDiagonal();
815 Mcpc = Mcpc.colwise().sum().eval().asDiagonal();
816 Mcx = Mcx.colwise().sum().eval().asDiagonal();
817 Mct = Mct.colwise().sum().eval().asDiagonal();
818 Mep = Mep.colwise().sum().eval().asDiagonal();
819 Mepc = Mepc.colwise().sum().eval().asDiagonal();
820 Mex = Mex.colwise().sum().eval().asDiagonal();
821 Met = Met.colwise().sum().eval().asDiagonal();
822 } // end of mass-lumping
823}
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, MaterialPropertyLib::AqueousLiquid, 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::Gas, 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::Solid, 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: