Loading [MathJax]/extensions/tex2jax.js
OGS
ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim > Class Template Reference

Detailed Description

template<typename ShapeFunction, int GlobalDim>
class ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >

Definition at line 36 of file ThermoRichardsFlowFEM.h.

#include <ThermoRichardsFlowFEM.h>

Inheritance diagram for ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >:
[legend]
Collaboration diagram for ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >:
[legend]

Public Types

using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
using GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType
using GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType
using IpData = IntegrationPointData<ShapeMatricesType>

Public Member Functions

 ThermoRichardsFlowLocalAssembler (ThermoRichardsFlowLocalAssembler const &)=delete
 ThermoRichardsFlowLocalAssembler (ThermoRichardsFlowLocalAssembler &&)=delete
 ThermoRichardsFlowLocalAssembler (MeshLib::Element const &e, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, ThermoRichardsFlowProcessData &process_data)
std::size_t setIPDataInitialConditions (std::string_view const name, double const *values, int const integration_order) override
void setInitialConditionsConcrete (Eigen::VectorXd const local_x, double const t, int const process_id) override
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_rhs_data, std::vector< double > &local_Jac_data) override
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_rhs_data) override
void initializeConcrete () override
void postTimestepConcrete (Eigen::VectorXd const &, Eigen::VectorXd const &, double const, double const, int const) override
void computeSecondaryVariableConcrete (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev) 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 & getIntPtDarcyVelocity (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
std::vector< double > getSaturation () const override
std::vector< double > const & getIntPtSaturation (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
std::vector< double > getPorosity () const override
std::vector< double > const & getIntPtPorosity (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
std::vector< double > const & getIntPtDryDensitySolid (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) 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 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 Member Functions

unsigned getNumberOfIntegrationPoints () const override

Private Attributes

ThermoRichardsFlowProcessData_process_data
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
NumLib::GenericIntegrationMethod const & _integration_method
MeshLib::Element const & _element
bool const _is_axially_symmetric

Static Private Attributes

static const int temperature_index = 0
static const int temperature_size = ShapeFunction::NPOINTS
static const int pressure_index = temperature_size
static const int pressure_size = ShapeFunction::NPOINTS

Member Typedef Documentation

◆ GlobalDimMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType

Definition at line 43 of file ThermoRichardsFlowFEM.h.

◆ GlobalDimVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType

Definition at line 44 of file ThermoRichardsFlowFEM.h.

◆ IpData

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::IpData = IntegrationPointData<ShapeMatricesType>

Definition at line 46 of file ThermoRichardsFlowFEM.h.

◆ ShapeMatricesType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>

Definition at line 41 of file ThermoRichardsFlowFEM.h.

Constructor & Destructor Documentation

◆ ThermoRichardsFlowLocalAssembler() [1/3]

template<typename ShapeFunction, int GlobalDim>
ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ThermoRichardsFlowLocalAssembler ( ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim > const & )
delete

◆ ThermoRichardsFlowLocalAssembler() [2/3]

template<typename ShapeFunction, int GlobalDim>
ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ThermoRichardsFlowLocalAssembler ( ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim > && )
delete

◆ ThermoRichardsFlowLocalAssembler() [3/3]

template<typename ShapeFunction, int GlobalDim>
ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ThermoRichardsFlowLocalAssembler ( MeshLib::Element const & e,
std::size_t const ,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
ThermoRichardsFlowProcessData & process_data )

Definition at line 34 of file ThermoRichardsFlowFEM-impl.h.

43 _element(e),
45{
46 unsigned const n_integration_points =
47 _integration_method.getNumberOfPoints();
48
50
51 auto const shape_matrices =
54
55 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
56
57 for (unsigned ip = 0; ip < n_integration_points; ip++)
58 {
59 auto const& sm = shape_matrices[ip];
60 _ip_data.emplace_back();
61 auto& ip_data = _ip_data[ip];
62 _ip_data[ip].integration_weight =
63 _integration_method.getWeightedPoint(ip).getWeight() *
64 sm.integralMeasure * sm.detJ;
65
66 ip_data.N = sm.N;
67 ip_data.dNdx = sm.dNdx;
68
70 std::nullopt, _element.getID(),
73 _element, sm.N))};
74 // Initial porosity. Could be read from integration point data or mesh.
77 std::numeric_limits<double>::quiet_NaN() /* t independent */);
78 }
79}
ShapeMatrixPolicyType< ShapeFunction, GlobalDim > ShapeMatricesType
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)

References _element, _integration_method, _ip_data, _is_axially_symmetric, _process_data, NumLib::initShapeMatrices(), NumLib::interpolateCoordinates(), and MaterialPropertyLib::porosity.

Member Function Documentation

◆ assemble()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< 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_rhs_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 687 of file ThermoRichardsFlowFEM-impl.h.

691{
694
698 auto const p_L = Eigen::Map<
701
702 auto const p_L_prev = Eigen::Map<
705
710
715
719
720 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
721 auto const& liquid_phase = medium.phase("AqueousLiquid");
722 auto const& solid_phase = medium.phase("Solid");
723 MPL::Phase const* gas_phase =
724 medium.hasPhase("Gas") ? &medium.phase("Gas") : nullptr;
727
728 unsigned const n_integration_points =
729 _integration_method.getNumberOfPoints();
730 for (unsigned ip = 0; ip < n_integration_points; ip++)
731 {
732 auto const& w = _ip_data[ip].integration_weight;
733
734 auto const& N = _ip_data[ip].N;
735 auto const& dNdx = _ip_data[ip].dNdx;
736
738 std::nullopt, _element.getID(),
741 _element, N))};
742
743 double T_ip;
745
746 double p_cap_ip;
748
749 double p_cap_prev_ip;
751
752 variables.capillary_pressure = p_cap_ip;
753 variables.liquid_phase_pressure = -p_cap_ip;
754 // setting pG to 1 atm
755 // TODO : rewrite equations s.t. p_L = pG-p_cap
756 variables.gas_phase_pressure = 1.0e5;
757 variables.temperature = T_ip;
758
759 auto& S_L = _ip_data[ip].saturation;
760 auto const S_L_prev = _ip_data[ip].saturation_prev;
761 auto const alpha =
764
765 auto& solid_elasticity = *_process_data.simplified_elasticity;
766 // TODO (buchwaldj)
767 // is bulk_modulus good name for bulk modulus of solid skeleton?
768 auto const beta_S =
769 solid_elasticity.bulkCompressibilityFromYoungsModulus(
771 auto const beta_SR = (1 - alpha) * beta_S;
772 variables.grain_compressibility = beta_SR;
773
774 auto const rho_LR =
777 auto const& b = _process_data.specific_body_force;
778
779 double const drho_LR_dp =
782 dt);
783 auto const beta_LR = drho_LR_dp / rho_LR;
784
787 variables.liquid_saturation = S_L;
788 variables_prev.liquid_saturation = S_L_prev;
789
790 // tangent derivative for Jacobian
791 double const dS_L_dp_cap =
794 dt);
795 // secant derivative from time discretization for storage
796 // use tangent, if secant is not available
797 double const DeltaS_L_Deltap_cap =
801
802 auto chi_S_L = S_L;
803 auto chi_S_L_prev = S_L_prev;
805 {
806 auto const chi = [&medium, x_position, t, dt](double const S_L)
807 {
808 MPL::VariableArray variables;
809 variables.liquid_saturation = S_L;
810 return medium[MPL::PropertyType::bishops_effective_stress]
811 .template value<double>(variables, x_position, t, dt);
812 };
813 chi_S_L = chi(S_L);
815 }
816 // TODO (buchwaldj)
817 // should solid_grain_pressure or effective_pore_pressure remain?
818 // double const p_FR = -chi_S_L * p_cap_ip;
819 // variables.solid_grain_pressure = p_FR;
820
821 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
822 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
823
824 auto& phi = _ip_data[ip].porosity;
825 { // Porosity update
826
827 variables_prev.porosity = _ip_data[ip].porosity_prev;
830 variables.porosity = phi;
831 }
832
833 if (alpha < phi)
834 {
835 OGS_FATAL(
836 "ThermoRichardsFlow: Biot-coefficient {} is smaller than "
837 "porosity {} in element/integration point {}/{}.",
838 alpha, phi, _element.getID(), ip);
839 }
840
841 auto const K_pT_thermal_osmosis =
842 (solid_phase.hasProperty(
849
850 double const k_rel =
852 .template value<double>(variables, x_position, t, dt);
853 auto const mu =
856
859 t, dt));
860
863
864 // Consider anisotropic thermal expansion.
865 // Read in 3x3 tensor. 2D case also requires expansion coeff. for z-
866 // component.
873
874 auto const rho_SR =
877
878 //
879 // pressure equation, pressure part.
880 //
881 local_K
884 .noalias() += dNdx.transpose() * k_rel * rho_Ki_over_mu * dNdx * w;
885
886 const double alphaB_minus_phi = alpha - phi;
887 double const a0 = alphaB_minus_phi * beta_SR;
888 double const specific_storage_a_p =
889 S_L * (phi * beta_LR + S_L * a0 +
890 chi_S_L * alpha * alpha *
891 solid_elasticity.storageContribution(
893 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
894
895 local_M
898 .noalias() += N.transpose() * rho_LR *
901 N * w;
902
903 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
904 dNdx.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
905
906 //
907 // pressure equation, temperature part.
908 //
911 x_position, t, dt);
912 const double eff_thermal_expansion =
916 alpha * solid_elasticity.thermalExpansivityContribution(
919
920 local_K
923 .noalias() +=
924 dNdx.transpose() * rho_LR * K_pT_thermal_osmosis * dNdx * w;
925
926 local_M
929 .noalias() -=
930 N.transpose() * rho_LR * eff_thermal_expansion * N * w;
931
932 //
933 // temperature equation.
934 //
935 {
938 .template value<double>(variables, x_position, t, dt);
939
943 .template value<double>(variables, x_position, t, dt);
944
945 local_M
948 .noalias() +=
949 w *
952 N.transpose() * N;
953
954 auto const thermal_conductivity =
959
961 -Ki_over_mu * k_rel * (dNdx * p_L - rho_LR * b) -
963
964 local_K
967 .noalias() += (dNdx.transpose() * thermal_conductivity * dNdx +
968 N.transpose() * velocity_L.transpose() * dNdx *
970 w;
971 local_K
974 .noalias() +=
975 dNdx.transpose() * T_ip * K_pT_thermal_osmosis * dNdx * w;
976 }
977 if (gas_phase && S_L < 1.0)
978 {
979 variables.density = rho_LR;
980
981 double const rho_wv =
983 .template value<double>(variables, x_position, t, dt);
984
985 double const drho_wv_dT =
987 .template dValue<double>(variables,
989 x_position, t, dt);
990 double const drho_wv_dp =
992 .template dValue<double>(
994 x_position, t, dt);
995 auto const f_Tv =
997 ->property(
999 .template value<double>(variables, x_position, t, dt);
1000
1001 variables.porosity = phi;
1002 auto const tortuosity =
1004 .template value<double>(variables, x_position, t, dt);
1005 double const D_v =
1006 phi * (1.0 - S_L) * tortuosity *
1008 .template value<double>(variables, x_position, t, dt);
1009
1010 double const f_Tv_D_Tv = f_Tv * D_v * drho_wv_dT;
1011 double const D_pv = D_v * drho_wv_dp;
1012
1013 GlobalDimVectorType const grad_T = dNdx * T;
1017 double const specific_heat_capacity_vapour =
1019 .template value<double>(variables, x_position, t, dt);
1020
1021 local_M
1024 .noalias() +=
1025 w * (rho_wv * specific_heat_capacity_vapour * (1 - S_L) * phi) *
1026 N.transpose() * N;
1027
1028 local_K
1031 .noalias() += N.transpose() * vapour_flux.transpose() * dNdx *
1033
1035 phi * (rho_wv * dS_L_dp_cap + (1 - S_L) * drho_wv_dp);
1036 local_M
1039 .noalias() +=
1040 N.transpose() * storage_coefficient_by_water_vapor * N * w;
1041
1042 double const vapor_expansion_factor = phi * (1 - S_L) * drho_wv_dT;
1043 local_M
1046 .noalias() += N.transpose() * vapor_expansion_factor * N * w;
1047
1049 .noalias() -= f_Tv_D_Tv * dNdx.transpose() * (dNdx * T) * w;
1050
1051 local_K
1054 .noalias() += dNdx.transpose() * D_pv * dNdx * w;
1055
1056 //
1057 // Latent heat term
1058 //
1060 {
1061 double const factor = phi * (1 - S_L) / rho_LR;
1062 // The volumetric latent heat of vaporization of liquid water
1063 double const L0 =
1065 .template value<double>(variables, x_position, t, dt) *
1066 rho_LR;
1067
1068 double const drho_LR_dT =
1070 .template dValue<double>(variables,
1072 x_position, t, dt);
1073
1074 double const rho_wv_over_rho_L = rho_wv / rho_LR;
1075 local_M
1078 .noalias() +=
1079 factor * L0 *
1081 N.transpose() * N * w;
1082
1083 local_M
1086 .noalias() +=
1087 (factor * L0 *
1090 N.transpose() * N * w;
1091
1092 // temperature equation, temperature part
1093 local_K
1096 .noalias() +=
1097 L0 * f_Tv_D_Tv * dNdx.transpose() * dNdx * w / rho_LR;
1098 // temperature equation, pressure part
1099 local_K
1102 .noalias() +=
1103 L0 * D_pv * dNdx.transpose() * dNdx * w / rho_LR;
1104 }
1105 }
1106 }
1107
1108 if (_process_data.apply_mass_lumping)
1109 {
1112 Mpp = Mpp.colwise().sum().eval().asDiagonal();
1113 }
1114}
#define OGS_FATAL(...)
Definition Error.h:26
typename ShapeMatricesType::GlobalDimVectorType GlobalDimVectorType
typename ShapeMatricesType::GlobalDimMatrixType GlobalDimMatrixType
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(MaterialPropertyLib::PropertyDataType const &values)
Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)
double getLiquidThermalExpansivity(Phase const &phase, VariableArray const &vars, const double density, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)

References _element, _integration_method, _ip_data, _process_data, MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::VariableArray::capillary_pressure, MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::diffusion, MaterialPropertyLib::VariableArray::effective_pore_pressure, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::formEigenTensor< 3 >(), MaterialPropertyLib::VariableArray::gas_phase_pressure, MaterialPropertyLib::getLiquidThermalExpansivity(), MaterialPropertyLib::VariableArray::grain_compressibility, MaterialPropertyLib::Phase::hasProperty(), NumLib::interpolateCoordinates(), MaterialPropertyLib::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, OGS_FATAL, MaterialPropertyLib::permeability, MaterialPropertyLib::porosity, MaterialPropertyLib::VariableArray::porosity, pressure_index, pressure_size, MaterialPropertyLib::Phase::property(), MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::specific_latent_heat, MaterialPropertyLib::temperature, MaterialPropertyLib::VariableArray::temperature, temperature_index, temperature_size, MaterialPropertyLib::thermal_diffusion_enhancement_factor, MaterialPropertyLib::thermal_expansivity, MaterialPropertyLib::thermal_osmosis_coefficient, MaterialPropertyLib::tortuosity, and MaterialPropertyLib::viscosity.

◆ assembleWithJacobian()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleWithJacobian ( double const t,
double const dt,
std::vector< double > const & local_x,
std::vector< double > const & local_x_prev,
std::vector< double > & local_rhs_data,
std::vector< double > & local_Jac_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 154 of file ThermoRichardsFlowFEM-impl.h.

160{
163
167 auto const p_L = Eigen::Map<
170
171 auto const T_prev =
175 auto const p_L_prev = Eigen::Map<
178
183
187
213
216
219
220 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
221 auto const& liquid_phase = medium.phase("AqueousLiquid");
222 auto const& solid_phase = medium.phase("Solid");
223 MPL::Phase const* gas_phase =
224 medium.hasPhase("Gas") ? &medium.phase("Gas") : nullptr;
227
228 unsigned const n_integration_points =
229 _integration_method.getNumberOfPoints();
230 for (unsigned ip = 0; ip < n_integration_points; ip++)
231 {
232 auto const& w = _ip_data[ip].integration_weight;
233
234 auto const& N = _ip_data[ip].N;
235 auto const& dNdx = _ip_data[ip].dNdx;
236
238 std::nullopt, _element.getID(),
241 _element, N))};
242
243 double T_ip;
245
246 double p_cap_ip;
248
249 double p_cap_prev_ip;
251
252 variables.capillary_pressure = p_cap_ip;
253 variables.liquid_phase_pressure = -p_cap_ip;
254 // setting pG to 1 atm
255 // TODO : rewrite equations s.t. p_L = pG-p_cap
256 variables.gas_phase_pressure = 1.0e5;
257 variables.temperature = T_ip;
258
259 auto& S_L = _ip_data[ip].saturation;
260 auto const S_L_prev = _ip_data[ip].saturation_prev;
261 auto const alpha =
264
265 auto& solid_elasticity = *_process_data.simplified_elasticity;
266 // TODO (buchwaldj)
267 // is bulk_modulus good name for bulk modulus of solid skeleton?
268 auto const beta_S =
269 solid_elasticity.bulkCompressibilityFromYoungsModulus(
271 auto const beta_SR = (1 - alpha) * beta_S;
272 variables.grain_compressibility = beta_SR;
273
274 auto const rho_LR =
277 variables.density = rho_LR;
278 auto const& b = _process_data.specific_body_force;
279
280 double const drho_LR_dp =
283 dt);
284 auto const beta_LR = drho_LR_dp / rho_LR;
285
288 variables.liquid_saturation = S_L;
289 variables_prev.liquid_saturation = S_L_prev;
290
291 // tangent derivative for Jacobian
292 double const dS_L_dp_cap =
295 dt);
296 // secant derivative from time discretization for storage
297 // use tangent, if secant is not available
298 double const DeltaS_L_Deltap_cap =
302
303 auto chi_S_L = S_L;
304 auto chi_S_L_prev = S_L_prev;
305 auto dchi_dS_L = 1.0;
307 {
308 auto const chi = [&medium, x_position, t, dt](double const S_L)
309 {
310 MPL::VariableArray variables;
311 variables.liquid_saturation = S_L;
312 return medium[MPL::PropertyType::bishops_effective_stress]
313 .template value<double>(variables, x_position, t, dt);
314 };
315 chi_S_L = chi(S_L);
317
319 .template dValue<double>(
321 x_position, t, dt);
322 }
323 // TODO (buchwaldj)
324 // should solid_grain_pressure or effective_pore_pressure remain?
325 // double const p_FR = -chi_S_L * p_cap_ip;
326 // variables.solid_grain_pressure = p_FR;
327
328 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
329 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
330
331 auto& phi = _ip_data[ip].porosity;
332 { // Porosity update
333
334 variables_prev.porosity = _ip_data[ip].porosity_prev;
337 variables.porosity = phi;
338 }
339
340 if (alpha < phi)
341 {
342 OGS_FATAL(
343 "ThermoRichardsFlow: Biot-coefficient {} is smaller than "
344 "porosity {} in element/integration point {}/{}.",
345 alpha, phi, _element.getID(), ip);
346 }
347
348 double const k_rel =
350 .template value<double>(variables, x_position, t, dt);
351 auto const mu =
354
357 t, dt));
358
361
362 auto const K_pT_thermal_osmosis =
363 (solid_phase.hasProperty(
370
371 // Consider anisotropic thermal expansion.
372 // Read in 3x3 tensor. 2D case also requires expansion coeff. for z-
373 // component.
380
381 auto const rho_SR =
384
385 //
386 // pressure equation, pressure part.
387 //
388 laplace_p.noalias() +=
389 dNdx.transpose() * k_rel * rho_Ki_over_mu * dNdx * w;
390 laplace_T.noalias() +=
391 dNdx.transpose() * rho_LR * K_pT_thermal_osmosis * dNdx * w;
392 const double alphaB_minus_phi = alpha - phi;
393 double const a0 = alphaB_minus_phi * beta_SR;
394 double const specific_storage_a_p =
395 S_L * (phi * beta_LR + S_L * a0 +
396 chi_S_L * alpha * alpha *
397 solid_elasticity.storageContribution(
399 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
400
401 double const dspecific_storage_a_p_dp_cap =
402 dS_L_dp_cap * (phi * beta_LR + 2 * S_L * a0 +
403 alpha * alpha *
404 solid_elasticity.storageContribution(
406 (chi_S_L + dchi_dS_L * S_L));
407 double const dspecific_storage_a_S_dp_cap =
408 -a0 * (S_L + p_cap_ip * dS_L_dp_cap);
409
410 storage_p_a_p.noalias() +=
411 N.transpose() * rho_LR * specific_storage_a_p * N * w;
412
413 storage_p_a_S.noalias() -= N.transpose() * rho_LR *
415 N * w;
416
420 .noalias() += N.transpose() * (p_cap_ip - p_cap_prev_ip) / dt *
422
423 storage_p_a_S_Jpp.noalias() -=
424 N.transpose() * rho_LR *
427 dt * N * w;
428
429 double const dk_rel_dS_L =
431 .template dValue<double>(variables,
433 x_position, t, dt);
438 .noalias() += dNdx.transpose() * rho_Ki_over_mu * grad_p_cap *
440
444 .noalias() += dNdx.transpose() * rho_LR * rho_Ki_over_mu * b *
446
447 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
448 dNdx.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
449
450 //
451 // pressure equation, temperature part.
452 //
455 x_position, t, dt);
456 const double eff_thermal_expansion =
460 alpha * solid_elasticity.thermalExpansivityContribution(
463 M_pT.noalias() -=
464 N.transpose() * rho_LR * eff_thermal_expansion * N * w;
465
466 //
467 // temperature equation.
468 //
469 {
472 .template value<double>(variables, x_position, t, dt);
473
477 .template value<double>(variables, x_position, t, dt);
478
479 M_TT.noalias() +=
480 w *
483 N.transpose() * N;
484
485 auto const thermal_conductivity =
490
492 -Ki_over_mu * k_rel * (dNdx * p_L - rho_LR * b) -
494
495 K_TT.noalias() += (dNdx.transpose() * thermal_conductivity * dNdx +
496 N.transpose() * velocity_L.transpose() * dNdx *
498 w;
499
500 //
501 // temperature equation, pressure part
502 //
503 K_Tp.noalias() +=
504 dNdx.transpose() * T_ip * K_pT_thermal_osmosis * dNdx * w;
506 N.transpose() * (dNdx * T).transpose() *
507 k_rel * Ki_over_mu * dNdx * w;
508
510 N.transpose() * velocity_L.dot(dNdx * T) /
512 }
513 if (gas_phase && S_L < 1.0)
514 {
515 variables.density = rho_LR;
516
517 double const rho_wv =
519 .template value<double>(variables, x_position, t, dt);
520
521 double const drho_wv_dT =
523 .template dValue<double>(variables,
525 x_position, t, dt);
526 double const drho_wv_dp =
528 .template dValue<double>(
530 x_position, t, dt);
531 auto const f_Tv =
533 ->property(
535 .template value<double>(variables, x_position, t, dt);
536
537 variables.porosity = phi;
538 auto const tortuosity =
540 .template value<double>(variables, x_position, t, dt);
541 double const D_v =
542 phi * (1.0 - S_L) * tortuosity *
544 .template value<double>(variables, x_position, t, dt);
545
546 double const f_Tv_D_Tv = f_Tv * D_v * drho_wv_dT;
547 double const D_pv = D_v * drho_wv_dp;
548
552 double const specific_heat_capacity_vapour =
554 .template value<double>(variables, x_position, t, dt);
555
556 M_TT.noalias() +=
558 N.transpose() * N;
559
560 K_TT.noalias() += N.transpose() * vapour_flux.transpose() * dNdx *
562
564 phi * (rho_wv * dS_L_dp_cap + (1 - S_L) * drho_wv_dp);
565
566 storage_p_a_p.noalias() +=
567 N.transpose() * storage_coefficient_by_water_vapor * N * w;
568
569 double const vapor_expansion_factor = phi * (1 - S_L) * drho_wv_dT;
570 M_pT.noalias() += N.transpose() * vapor_expansion_factor * N * w;
571
575 .noalias() += dNdx.transpose() * f_Tv_D_Tv * dNdx * w;
576
578 .noalias() -= f_Tv_D_Tv * dNdx.transpose() * (dNdx * T) * w;
579
580 laplace_p.noalias() += dNdx.transpose() * D_pv * dNdx * w;
581
582 //
583 // Latent heat term
584 //
586 {
587 double const factor = phi * (1 - S_L) / rho_LR;
588 // The volumetric latent heat of vaporization of liquid water
589 double const L0 =
591 .template value<double>(variables, x_position, t, dt) *
592 rho_LR;
593
594 double const drho_LR_dT =
596 .template dValue<double>(variables,
598 x_position, t, dt);
599
600 double const rho_wv_over_rho_L = rho_wv / rho_LR;
601 M_TT.noalias() +=
602 factor * L0 *
604 N.transpose() * N * w;
605
606 M_Tp.noalias() +=
607 (factor * L0 *
610 N.transpose() * N * w;
611
612 // temperature equation, temperature part
613 K_TT.noalias() +=
614 L0 * f_Tv_D_Tv * dNdx.transpose() * dNdx * w / rho_LR;
615 // temperature equation, pressure part
616 K_Tp.noalias() +=
617 L0 * D_pv * dNdx.transpose() * dNdx * w / rho_LR;
618 }
619 }
620 }
621
622 if (_process_data.apply_mass_lumping)
623 {
624 storage_p_a_p = storage_p_a_p.colwise().sum().eval().asDiagonal();
625 storage_p_a_S = storage_p_a_S.colwise().sum().eval().asDiagonal();
627 storage_p_a_S_Jpp.colwise().sum().eval().asDiagonal();
628 }
629
630 //
631 // -- Jacobian
632 //
633 // temperature equation.
637 .noalias() += M_TT / dt + K_TT;
638 // temperature equation, pressure part
642 .noalias() += K_Tp + dK_TT_dp;
643
644 // pressure equation, pressure part.
648 .noalias() += laplace_p + storage_p_a_p / dt + storage_p_a_S_Jpp;
649
650 // pressure equation, temperature part (contributed by thermal expansion).
654 .noalias() += M_pT / dt + laplace_T;
655
656 //
657 // -- Residual
658 //
659 // temperature equation
661 M_TT * (T - T_prev) / dt + K_TT * T;
663 K_Tp * p_L;
664
665 // pressure equation
666 local_rhs.template segment<pressure_size>(pressure_index).noalias() -=
667 laplace_p * p_L + laplace_T * T +
669 M_pT * (T - T_prev) / dt;
670 if (gas_phase)
671 {
673 {
674 // Jacobian: temperature equation, pressure part
678 .noalias() += M_Tp / dt;
679 // RHS: temperature part
681 .noalias() -= M_Tp * (p_L - p_L_prev) / dt;
682 }
683 }
684}
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType

References _element, _integration_method, _ip_data, _process_data, MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::VariableArray::capillary_pressure, MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::diffusion, MaterialPropertyLib::VariableArray::effective_pore_pressure, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::formEigenTensor< 3 >(), MaterialPropertyLib::VariableArray::gas_phase_pressure, MaterialPropertyLib::getLiquidThermalExpansivity(), MaterialPropertyLib::VariableArray::grain_compressibility, MaterialPropertyLib::Phase::hasProperty(), NumLib::interpolateCoordinates(), MaterialPropertyLib::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::liquid_saturation, MaterialPropertyLib::VariableArray::liquid_saturation, OGS_FATAL, MaterialPropertyLib::permeability, MaterialPropertyLib::porosity, MaterialPropertyLib::VariableArray::porosity, pressure_index, pressure_size, MaterialPropertyLib::Phase::property(), MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::specific_latent_heat, MaterialPropertyLib::temperature, MaterialPropertyLib::VariableArray::temperature, temperature_index, temperature_size, MaterialPropertyLib::thermal_diffusion_enhancement_factor, MaterialPropertyLib::thermal_expansivity, MaterialPropertyLib::thermal_osmosis_coefficient, MaterialPropertyLib::tortuosity, and MaterialPropertyLib::viscosity.

◆ computeSecondaryVariableConcrete()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete ( double const t,
double const dt,
Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 1197 of file ThermoRichardsFlowFEM-impl.h.

1201{
1202 auto const T =
1204
1205 auto const p_L = local_x.template segment<pressure_size>(pressure_index);
1206
1207 auto p_L_prev =
1209
1210 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
1211 auto const& liquid_phase = medium.phase("AqueousLiquid");
1212 auto const& solid_phase = medium.phase("Solid");
1215
1216 unsigned const n_integration_points =
1217 _integration_method.getNumberOfPoints();
1218
1219 double saturation_avg = 0;
1220 double porosity_avg = 0;
1221
1222 for (unsigned ip = 0; ip < n_integration_points; ip++)
1223 {
1224 auto const& N = _ip_data[ip].N;
1225
1227 std::nullopt, _element.getID(),
1230 _element, N))};
1231
1232 double T_ip;
1234
1235 double p_cap_ip;
1237
1238 double p_cap_prev_ip;
1240
1241 variables.capillary_pressure = p_cap_ip;
1242 variables.liquid_phase_pressure = -p_cap_ip;
1243 // setting pG to 1 atm
1244 // TODO : rewrite equations s.t. p_L = pG-p_cap
1245 variables.gas_phase_pressure = 1.0e5;
1246
1247 variables.temperature = T_ip;
1248
1249 auto& S_L = _ip_data[ip].saturation;
1250 auto const S_L_prev = _ip_data[ip].saturation_prev;
1253 variables.liquid_saturation = S_L;
1254 variables_prev.liquid_saturation = S_L_prev;
1255
1256 auto chi_S_L = S_L;
1257 auto chi_S_L_prev = S_L_prev;
1259 {
1260 auto const chi = [&medium, x_position, t, dt](double const S_L)
1261 {
1263 variables.liquid_saturation = S_L;
1265 .template value<double>(variables, x_position, t, dt);
1266 };
1267 chi_S_L = chi(S_L);
1269 }
1270 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
1271 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
1272
1273 auto const alpha =
1276
1277 auto& solid_elasticity = *_process_data.simplified_elasticity;
1278 auto const beta_S =
1279 solid_elasticity.bulkCompressibilityFromYoungsModulus(
1281 auto const beta_SR = (1 - alpha) * beta_S;
1282 variables.grain_compressibility = beta_SR;
1283
1284 auto& phi = _ip_data[ip].porosity;
1285 { // Porosity update
1286 variables_prev.porosity = _ip_data[ip].porosity_prev;
1289 variables.porosity = phi;
1290 }
1291
1292 auto const mu =
1295 auto const rho_LR =
1298
1301 t, dt));
1302
1303 double const k_rel =
1305 .template value<double>(variables, x_position, t, dt);
1306
1308
1309 auto const rho_SR =
1312 _ip_data[ip].dry_density_solid = (1 - phi) * rho_SR;
1313
1314 auto const& b = _process_data.specific_body_force;
1315
1316 auto const K_pT_thermal_osmosis =
1317 (solid_phase.hasProperty(
1324
1325 // Compute the velocity
1326 auto const& dNdx = _ip_data[ip].dNdx;
1327 _ip_data[ip].v_darcy.noalias() = -K_over_mu * dNdx * p_L -
1329 rho_LR * K_over_mu * b;
1330
1332 porosity_avg += phi;
1333 }
1336
1337 (*_process_data.element_saturation)[_element.getID()] = saturation_avg;
1338 (*_process_data.element_porosity)[_element.getID()] = porosity_avg;
1339}

References _element, _integration_method, _ip_data, _process_data, MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, MaterialPropertyLib::VariableArray::capillary_pressure, MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::effective_pore_pressure, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::VariableArray::gas_phase_pressure, MaterialPropertyLib::VariableArray::grain_compressibility, NumLib::interpolateCoordinates(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, MaterialPropertyLib::permeability, MaterialPropertyLib::porosity, MaterialPropertyLib::VariableArray::porosity, pressure_index, MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::VariableArray::temperature, temperature_index, MaterialPropertyLib::thermal_osmosis_coefficient, and MaterialPropertyLib::viscosity.

◆ getIntPtDarcyVelocity()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::ThermoRichardsFlow::LocalAssemblerInterface.

Definition at line 1118 of file ThermoRichardsFlowFEM-impl.h.

1124{
1125 unsigned const n_integration_points =
1126 _integration_method.getNumberOfPoints();
1127
1128 cache.clear();
1132
1133 for (unsigned ip = 0; ip < n_integration_points; ip++)
1134 {
1135 cache_matrix.col(ip).noalias() = _ip_data[ip].v_darcy;
1136 }
1137
1138 return cache;
1139}

References _integration_method, _ip_data, and MathLib::createZeroedMatrix().

◆ getIntPtDryDensitySolid()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::getIntPtDryDensitySolid ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::ThermoRichardsFlow::LocalAssemblerInterface.

Definition at line 1185 of file ThermoRichardsFlowFEM-impl.h.

1191{
1194}
std::vector< double > const & getIntegrationPointScalarData(IntegrationPointDataVector const &ip_data_vector, MemberType IpData::*const member, std::vector< double > &cache)

References _ip_data, ProcessLib::ThermoRichardsFlow::IntegrationPointData< ShapeMatricesType >::dry_density_solid, and ProcessLib::getIntegrationPointScalarData().

◆ getIntPtPorosity()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::getIntPtPorosity ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

◆ getIntPtSaturation()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::getIntPtSaturation ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

◆ getNumberOfIntegrationPoints()

template<typename ShapeFunction, int GlobalDim>
unsigned ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::getNumberOfIntegrationPoints ( ) const
overrideprivatevirtual

Implements ProcessLib::ThermoRichardsFlow::LocalAssemblerInterface.

Definition at line 1343 of file ThermoRichardsFlowFEM-impl.h.

1344{
1345 return _integration_method.getNumberOfPoints();
1346}

References _integration_method, and getNumberOfIntegrationPoints().

Referenced by getNumberOfIntegrationPoints().

◆ getPorosity()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::getPorosity ( ) const
overridevirtual

Implements ProcessLib::ThermoRichardsFlow::LocalAssemblerInterface.

Definition at line 1164 of file ThermoRichardsFlowFEM-impl.h.

1165{
1167 getIntPtPorosity(0, {}, {}, result);
1168 return result;
1169}
std::vector< double > const & getIntPtPorosity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

References getIntPtPorosity().

◆ getSaturation()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::getSaturation ( ) const
overridevirtual

Implements ProcessLib::ThermoRichardsFlow::LocalAssemblerInterface.

Definition at line 1143 of file ThermoRichardsFlowFEM-impl.h.

1144{
1146 getIntPtSaturation(0, {}, {}, result);
1147 return result;
1148}
std::vector< double > const & getIntPtSaturation(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

References getIntPtSaturation(), and getSaturation().

Referenced by getSaturation().

◆ getShapeMatrix()

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

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 113 of file ThermoRichardsFlowFEM.h.

115 {
116 auto const& N = _ip_data[integration_point].N;
117
118 // assumes N is stored contiguously in memory
119 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
120 }

References _ip_data.

◆ initializeConcrete()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::initializeConcrete ( )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 83 of file ThermoRichardsFlowFEM.h.

84 {
85 unsigned const n_integration_points =
86 _integration_method.getNumberOfPoints();
87
88 for (unsigned ip = 0; ip < n_integration_points; ip++)
89 {
90 auto& ip_data = _ip_data[ip];
91 ip_data.pushBackState();
92 }
93 }

References _integration_method, and _ip_data.

◆ postTimestepConcrete()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::postTimestepConcrete ( Eigen::VectorXd const & ,
Eigen::VectorXd const & ,
double const ,
double const ,
int const  )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 95 of file ThermoRichardsFlowFEM.h.

99 {
100 unsigned const n_integration_points =
101 _integration_method.getNumberOfPoints();
102
103 for (unsigned ip = 0; ip < n_integration_points; ip++)
104 {
105 _ip_data[ip].pushBackState();
106 }
107 }

References _integration_method, and _ip_data.

◆ setInitialConditionsConcrete()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::setInitialConditionsConcrete ( Eigen::VectorXd const local_x,
double const t,
int const process_id )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 111 of file ThermoRichardsFlowFEM-impl.h.

115{
117
118 auto const p_L = local_x.template segment<pressure_size>(pressure_index);
119
120 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
122
123 unsigned const n_integration_points =
124 _integration_method.getNumberOfPoints();
125 for (unsigned ip = 0; ip < n_integration_points; ip++)
126 {
127 auto const& N = _ip_data[ip].N;
128
130 std::nullopt, _element.getID(),
133 _element, N))};
134
135 double p_cap_ip;
137
138 variables.capillary_pressure = p_cap_ip;
139 variables.liquid_phase_pressure = -p_cap_ip;
140 // setting pG to 1 atm
141 // TODO : rewrite equations s.t. p_L = pG-p_cap
142 variables.gas_phase_pressure = 1.0e5;
143
144 // Note: temperature dependent saturation model is not considered so
145 // far.
146 _ip_data[ip].saturation_prev =
150 }
151}

References _element, _integration_method, _ip_data, _process_data, MaterialPropertyLib::VariableArray::capillary_pressure, MaterialPropertyLib::VariableArray::gas_phase_pressure, NumLib::interpolateCoordinates(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, pressure_index, pressure_size, MaterialPropertyLib::saturation, NumLib::detail::shapeFunctionInterpolate(), and temperature_size.

◆ setIPDataInitialConditions()

template<typename ShapeFunction, int GlobalDim>
std::size_t ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::setIPDataInitialConditions ( std::string_view const name,
double const * values,
int const integration_order )
overridevirtual
Returns
the number of read integration points.

Implements ProcessLib::ThermoRichardsFlow::LocalAssemblerInterface.

Definition at line 82 of file ThermoRichardsFlowFEM-impl.h.

86{
88 static_cast<int>(_integration_method.getIntegrationOrder()))
89 {
91 "Setting integration point initial conditions; The integration "
92 "order of the local assembler for element {:d} is different "
93 "from the integration order in the initial condition.",
94 _element.getID());
95 }
96
97 if (name == "saturation")
98 {
101 }
102 if (name == "porosity")
103 {
106 }
107 return 0;
108}
std::size_t setIntegrationPointScalarData(double const *values, IntegrationPointDataVector &ip_data_vector, MemberType IpData::*const member)

References _element, _integration_method, _ip_data, OGS_FATAL, ProcessLib::ThermoRichardsFlow::IntegrationPointData< ShapeMatricesType >::porosity, ProcessLib::ThermoRichardsFlow::IntegrationPointData< ShapeMatricesType >::saturation, and ProcessLib::setIntegrationPointScalarData().

Member Data Documentation

◆ _element

◆ _integration_method

◆ _ip_data

◆ _is_axially_symmetric

template<typename ShapeFunction, int GlobalDim>
bool const ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::_is_axially_symmetric
private

Definition at line 158 of file ThermoRichardsFlowFEM.h.

Referenced by ThermoRichardsFlowLocalAssembler().

◆ _process_data

◆ pressure_index

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::pressure_index = temperature_size
staticprivate

◆ pressure_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::pressure_size = ShapeFunction::NPOINTS
staticprivate

◆ temperature_index

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::temperature_index = 0
staticprivate

◆ temperature_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::temperature_size = ShapeFunction::NPOINTS
staticprivate

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