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 29 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 int getNumberOfVectorElementsForDeformation () 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 36 of file ThermoRichardsFlowFEM.h.

◆ GlobalDimVectorType

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

Definition at line 37 of file ThermoRichardsFlowFEM.h.

◆ IpData

◆ ShapeMatricesType

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

Definition at line 34 of file ThermoRichardsFlowFEM.h.

Constructor & Destructor Documentation

◆ ThermoRichardsFlowLocalAssembler() [1/3]

◆ 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 28 of file ThermoRichardsFlowFEM-impl.h.

37 _element(e),
39{
40 unsigned const n_integration_points =
41 _integration_method.getNumberOfPoints();
42
44
45 auto const shape_matrices =
48
49 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
50
51 for (unsigned ip = 0; ip < n_integration_points; ip++)
52 {
53 auto const& sm = shape_matrices[ip];
54 _ip_data.emplace_back();
55 auto& ip_data = _ip_data[ip];
56 _ip_data[ip].integration_weight =
57 _integration_method.getWeightedPoint(ip).getWeight() *
58 sm.integralMeasure * sm.detJ;
59
60 ip_data.N = sm.N;
61 ip_data.dNdx = sm.dNdx;
62
64 std::nullopt, _element.getID(),
67 _element, sm.N))};
68 // Initial porosity. Could be read from integration point data or mesh.
71 std::numeric_limits<double>::quiet_NaN() /* t independent */);
72 }
73}
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 681 of file ThermoRichardsFlowFEM-impl.h.

685{
688
692 auto const p_L = Eigen::Map<
695
696 auto const p_L_prev = Eigen::Map<
699
704
709
713
714 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
715 auto const& liquid_phase = medium.phase("AqueousLiquid");
716 auto const& solid_phase = medium.phase("Solid");
717 MPL::Phase const* gas_phase =
718 medium.hasPhase("Gas") ? &medium.phase("Gas") : nullptr;
721
722 unsigned const n_integration_points =
723 _integration_method.getNumberOfPoints();
724 for (unsigned ip = 0; ip < n_integration_points; ip++)
725 {
726 auto const& w = _ip_data[ip].integration_weight;
727
728 auto const& N = _ip_data[ip].N;
729 auto const& dNdx = _ip_data[ip].dNdx;
730
732 std::nullopt, _element.getID(),
735 _element, N))};
736
737 double T_ip;
739
740 double p_cap_ip;
742
743 double p_cap_prev_ip;
745
746 variables.capillary_pressure = p_cap_ip;
747 variables.liquid_phase_pressure = -p_cap_ip;
748 // setting pG to 1 atm
749 // TODO : rewrite equations s.t. p_L = pG-p_cap
750 variables.gas_phase_pressure = 1.0e5;
751 variables.temperature = T_ip;
752
753 auto& S_L = _ip_data[ip].saturation;
754 auto const S_L_prev = _ip_data[ip].saturation_prev;
755 auto const alpha =
758
759 auto& solid_elasticity = *_process_data.simplified_elasticity;
760 // TODO (buchwaldj)
761 // is bulk_modulus good name for bulk modulus of solid skeleton?
762 auto const beta_S =
763 solid_elasticity.bulkCompressibilityFromYoungsModulus(
765 auto const beta_SR = (1 - alpha) * beta_S;
766 variables.grain_compressibility = beta_SR;
767
768 auto const rho_LR =
771 auto const& b = _process_data.specific_body_force;
772
773 double const drho_LR_dp =
776 dt);
777 auto const beta_LR = drho_LR_dp / rho_LR;
778
781 variables.liquid_saturation = S_L;
782 variables_prev.liquid_saturation = S_L_prev;
783
784 // tangent derivative for Jacobian
785 double const dS_L_dp_cap =
788 dt);
789 // secant derivative from time discretization for storage
790 // use tangent, if secant is not available
791 double const DeltaS_L_Deltap_cap =
795
796 auto chi_S_L = S_L;
797 auto chi_S_L_prev = S_L_prev;
799 {
800 auto const chi = [&medium, x_position, t, dt](double const S_L)
801 {
802 MPL::VariableArray variables;
803 variables.liquid_saturation = S_L;
804 return medium[MPL::PropertyType::bishops_effective_stress]
805 .template value<double>(variables, x_position, t, dt);
806 };
807 chi_S_L = chi(S_L);
809 }
810 // TODO (buchwaldj)
811 // should solid_grain_pressure or effective_pore_pressure remain?
812 // double const p_FR = -chi_S_L * p_cap_ip;
813 // variables.solid_grain_pressure = p_FR;
814
815 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
816 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
817
818 auto& phi = _ip_data[ip].porosity;
819 { // Porosity update
820
821 variables_prev.porosity = _ip_data[ip].porosity_prev;
824 variables.porosity = phi;
825 }
826
827 if (alpha < phi)
828 {
829 OGS_FATAL(
830 "ThermoRichardsFlow: Biot-coefficient {} is smaller than "
831 "porosity {} in element/integration point {}/{}.",
832 alpha, phi, _element.getID(), ip);
833 }
834
835 auto const K_pT_thermal_osmosis =
836 (solid_phase.hasProperty(
843
844 double const k_rel =
846 .template value<double>(variables, x_position, t, dt);
847 auto const mu =
850
853 t, dt));
854
857
858 // Consider anisotropic thermal expansion.
859 // Read in 3x3 tensor. 2D case also requires expansion coeff. for z-
860 // component.
867
868 auto const rho_SR =
871
872 //
873 // pressure equation, pressure part.
874 //
875 local_K
878 .noalias() += dNdx.transpose() * k_rel * rho_Ki_over_mu * dNdx * w;
879
880 const double alphaB_minus_phi = alpha - phi;
881 double const a0 = alphaB_minus_phi * beta_SR;
882 double const specific_storage_a_p =
883 S_L * (phi * beta_LR + S_L * a0 +
884 chi_S_L * alpha * alpha *
885 solid_elasticity.storageContribution(
887 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
888
889 local_M
892 .noalias() += N.transpose() * rho_LR *
895 N * w;
896
897 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
898 dNdx.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
899
900 //
901 // pressure equation, temperature part.
902 //
905 x_position, t, dt);
906 const double eff_thermal_expansion =
910 alpha * solid_elasticity.thermalExpansivityContribution(
913
914 local_K
917 .noalias() +=
918 dNdx.transpose() * rho_LR * K_pT_thermal_osmosis * dNdx * w;
919
920 local_M
923 .noalias() -=
924 N.transpose() * rho_LR * eff_thermal_expansion * N * w;
925
926 //
927 // temperature equation.
928 //
929 {
932 .template value<double>(variables, x_position, t, dt);
933
937 .template value<double>(variables, x_position, t, dt);
938
939 local_M
942 .noalias() +=
943 w *
946 N.transpose() * N;
947
948 auto const thermal_conductivity =
953
955 -Ki_over_mu * k_rel * (dNdx * p_L - rho_LR * b) -
957
958 local_K
961 .noalias() += (dNdx.transpose() * thermal_conductivity * dNdx +
962 N.transpose() * velocity_L.transpose() * dNdx *
964 w;
965 local_K
968 .noalias() +=
969 dNdx.transpose() * T_ip * K_pT_thermal_osmosis * dNdx * w;
970 }
971 if (gas_phase && S_L < 1.0)
972 {
973 variables.density = rho_LR;
974
975 double const rho_wv =
977 .template value<double>(variables, x_position, t, dt);
978
979 double const drho_wv_dT =
981 .template dValue<double>(variables,
983 x_position, t, dt);
984 double const drho_wv_dp =
986 .template dValue<double>(
988 x_position, t, dt);
989 auto const f_Tv =
991 ->property(
993 .template value<double>(variables, x_position, t, dt);
994
995 variables.porosity = phi;
996 auto const tortuosity =
998 .template value<double>(variables, x_position, t, dt);
999 double const D_v =
1000 phi * (1.0 - S_L) * tortuosity *
1002 .template value<double>(variables, x_position, t, dt);
1003
1004 double const f_Tv_D_Tv = f_Tv * D_v * drho_wv_dT;
1005 double const D_pv = D_v * drho_wv_dp;
1006
1007 GlobalDimVectorType const grad_T = dNdx * T;
1011 double const specific_heat_capacity_vapour =
1013 .template value<double>(variables, x_position, t, dt);
1014
1015 local_M
1018 .noalias() +=
1019 w * (rho_wv * specific_heat_capacity_vapour * (1 - S_L) * phi) *
1020 N.transpose() * N;
1021
1022 local_K
1025 .noalias() += N.transpose() * vapour_flux.transpose() * dNdx *
1027
1029 phi * (rho_wv * dS_L_dp_cap + (1 - S_L) * drho_wv_dp);
1030 local_M
1033 .noalias() +=
1034 N.transpose() * storage_coefficient_by_water_vapor * N * w;
1035
1036 double const vapor_expansion_factor = phi * (1 - S_L) * drho_wv_dT;
1037 local_M
1040 .noalias() += N.transpose() * vapor_expansion_factor * N * w;
1041
1043 .noalias() -= f_Tv_D_Tv * dNdx.transpose() * (dNdx * T) * w;
1044
1045 local_K
1048 .noalias() += dNdx.transpose() * D_pv * dNdx * w;
1049
1050 //
1051 // Latent heat term
1052 //
1054 {
1055 double const factor = phi * (1 - S_L) / rho_LR;
1056 // The volumetric latent heat of vaporization of liquid water
1057 double const L0 =
1059 .template value<double>(variables, x_position, t, dt) *
1060 rho_LR;
1061
1062 double const drho_LR_dT =
1064 .template dValue<double>(variables,
1066 x_position, t, dt);
1067
1068 double const rho_wv_over_rho_L = rho_wv / rho_LR;
1069 local_M
1072 .noalias() +=
1073 factor * L0 *
1075 N.transpose() * N * w;
1076
1077 local_M
1080 .noalias() +=
1081 (factor * L0 *
1084 N.transpose() * N * w;
1085
1086 // temperature equation, temperature part
1087 local_K
1090 .noalias() +=
1091 L0 * f_Tv_D_Tv * dNdx.transpose() * dNdx * w / rho_LR;
1092 // temperature equation, pressure part
1093 local_K
1096 .noalias() +=
1097 L0 * D_pv * dNdx.transpose() * dNdx * w / rho_LR;
1098 }
1099 }
1100 }
1101
1102 if (_process_data.apply_mass_lumping)
1103 {
1106 Mpp = Mpp.colwise().sum().eval().asDiagonal();
1107 }
1108}
#define OGS_FATAL(...)
Definition Error.h:19
typename ShapeMatricesType::GlobalDimVectorType GlobalDimVectorType
typename ShapeMatricesType::GlobalDimMatrixType GlobalDimMatrixType
constexpr Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(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 148 of file ThermoRichardsFlowFEM-impl.h.

154{
157
161 auto const p_L = Eigen::Map<
164
165 auto const T_prev =
169 auto const p_L_prev = Eigen::Map<
172
177
181
207
210
213
214 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
215 auto const& liquid_phase = medium.phase("AqueousLiquid");
216 auto const& solid_phase = medium.phase("Solid");
217 MPL::Phase const* gas_phase =
218 medium.hasPhase("Gas") ? &medium.phase("Gas") : nullptr;
221
222 unsigned const n_integration_points =
223 _integration_method.getNumberOfPoints();
224 for (unsigned ip = 0; ip < n_integration_points; ip++)
225 {
226 auto const& w = _ip_data[ip].integration_weight;
227
228 auto const& N = _ip_data[ip].N;
229 auto const& dNdx = _ip_data[ip].dNdx;
230
232 std::nullopt, _element.getID(),
235 _element, N))};
236
237 double T_ip;
239
240 double p_cap_ip;
242
243 double p_cap_prev_ip;
245
246 variables.capillary_pressure = p_cap_ip;
247 variables.liquid_phase_pressure = -p_cap_ip;
248 // setting pG to 1 atm
249 // TODO : rewrite equations s.t. p_L = pG-p_cap
250 variables.gas_phase_pressure = 1.0e5;
251 variables.temperature = T_ip;
252
253 auto& S_L = _ip_data[ip].saturation;
254 auto const S_L_prev = _ip_data[ip].saturation_prev;
255 auto const alpha =
258
259 auto& solid_elasticity = *_process_data.simplified_elasticity;
260 // TODO (buchwaldj)
261 // is bulk_modulus good name for bulk modulus of solid skeleton?
262 auto const beta_S =
263 solid_elasticity.bulkCompressibilityFromYoungsModulus(
265 auto const beta_SR = (1 - alpha) * beta_S;
266 variables.grain_compressibility = beta_SR;
267
268 auto const rho_LR =
271 variables.density = rho_LR;
272 auto const& b = _process_data.specific_body_force;
273
274 double const drho_LR_dp =
277 dt);
278 auto const beta_LR = drho_LR_dp / rho_LR;
279
282 variables.liquid_saturation = S_L;
283 variables_prev.liquid_saturation = S_L_prev;
284
285 // tangent derivative for Jacobian
286 double const dS_L_dp_cap =
289 dt);
290 // secant derivative from time discretization for storage
291 // use tangent, if secant is not available
292 double const DeltaS_L_Deltap_cap =
296
297 auto chi_S_L = S_L;
298 auto chi_S_L_prev = S_L_prev;
299 auto dchi_dS_L = 1.0;
301 {
302 auto const chi = [&medium, x_position, t, dt](double const S_L)
303 {
304 MPL::VariableArray variables;
305 variables.liquid_saturation = S_L;
306 return medium[MPL::PropertyType::bishops_effective_stress]
307 .template value<double>(variables, x_position, t, dt);
308 };
309 chi_S_L = chi(S_L);
311
313 .template dValue<double>(
315 x_position, t, dt);
316 }
317 // TODO (buchwaldj)
318 // should solid_grain_pressure or effective_pore_pressure remain?
319 // double const p_FR = -chi_S_L * p_cap_ip;
320 // variables.solid_grain_pressure = p_FR;
321
322 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
323 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
324
325 auto& phi = _ip_data[ip].porosity;
326 { // Porosity update
327
328 variables_prev.porosity = _ip_data[ip].porosity_prev;
331 variables.porosity = phi;
332 }
333
334 if (alpha < phi)
335 {
336 OGS_FATAL(
337 "ThermoRichardsFlow: Biot-coefficient {} is smaller than "
338 "porosity {} in element/integration point {}/{}.",
339 alpha, phi, _element.getID(), ip);
340 }
341
342 double const k_rel =
344 .template value<double>(variables, x_position, t, dt);
345 auto const mu =
348
351 t, dt));
352
355
356 auto const K_pT_thermal_osmosis =
357 (solid_phase.hasProperty(
364
365 // Consider anisotropic thermal expansion.
366 // Read in 3x3 tensor. 2D case also requires expansion coeff. for z-
367 // component.
374
375 auto const rho_SR =
378
379 //
380 // pressure equation, pressure part.
381 //
382 laplace_p.noalias() +=
383 dNdx.transpose() * k_rel * rho_Ki_over_mu * dNdx * w;
384 laplace_T.noalias() +=
385 dNdx.transpose() * rho_LR * K_pT_thermal_osmosis * dNdx * w;
386 const double alphaB_minus_phi = alpha - phi;
387 double const a0 = alphaB_minus_phi * beta_SR;
388 double const specific_storage_a_p =
389 S_L * (phi * beta_LR + S_L * a0 +
390 chi_S_L * alpha * alpha *
391 solid_elasticity.storageContribution(
393 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
394
395 double const dspecific_storage_a_p_dp_cap =
396 dS_L_dp_cap * (phi * beta_LR + 2 * S_L * a0 +
397 alpha * alpha *
398 solid_elasticity.storageContribution(
400 (chi_S_L + dchi_dS_L * S_L));
401 double const dspecific_storage_a_S_dp_cap =
402 -a0 * (S_L + p_cap_ip * dS_L_dp_cap);
403
404 storage_p_a_p.noalias() +=
405 N.transpose() * rho_LR * specific_storage_a_p * N * w;
406
407 storage_p_a_S.noalias() -= N.transpose() * rho_LR *
409 N * w;
410
414 .noalias() += N.transpose() * (p_cap_ip - p_cap_prev_ip) / dt *
416
417 storage_p_a_S_Jpp.noalias() -=
418 N.transpose() * rho_LR *
421 dt * N * w;
422
423 double const dk_rel_dS_L =
425 .template dValue<double>(variables,
427 x_position, t, dt);
432 .noalias() += dNdx.transpose() * rho_Ki_over_mu * grad_p_cap *
434
438 .noalias() += dNdx.transpose() * rho_LR * rho_Ki_over_mu * b *
440
441 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
442 dNdx.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
443
444 //
445 // pressure equation, temperature part.
446 //
449 x_position, t, dt);
450 const double eff_thermal_expansion =
454 alpha * solid_elasticity.thermalExpansivityContribution(
457 M_pT.noalias() -=
458 N.transpose() * rho_LR * eff_thermal_expansion * N * w;
459
460 //
461 // temperature equation.
462 //
463 {
466 .template value<double>(variables, x_position, t, dt);
467
471 .template value<double>(variables, x_position, t, dt);
472
473 M_TT.noalias() +=
474 w *
477 N.transpose() * N;
478
479 auto const thermal_conductivity =
484
486 -Ki_over_mu * k_rel * (dNdx * p_L - rho_LR * b) -
488
489 K_TT.noalias() += (dNdx.transpose() * thermal_conductivity * dNdx +
490 N.transpose() * velocity_L.transpose() * dNdx *
492 w;
493
494 //
495 // temperature equation, pressure part
496 //
497 K_Tp.noalias() +=
498 dNdx.transpose() * T_ip * K_pT_thermal_osmosis * dNdx * w;
500 N.transpose() * (dNdx * T).transpose() *
501 k_rel * Ki_over_mu * dNdx * w;
502
504 N.transpose() * velocity_L.dot(dNdx * T) /
506 }
507 if (gas_phase && S_L < 1.0)
508 {
509 variables.density = rho_LR;
510
511 double const rho_wv =
513 .template value<double>(variables, x_position, t, dt);
514
515 double const drho_wv_dT =
517 .template dValue<double>(variables,
519 x_position, t, dt);
520 double const drho_wv_dp =
522 .template dValue<double>(
524 x_position, t, dt);
525 auto const f_Tv =
527 ->property(
529 .template value<double>(variables, x_position, t, dt);
530
531 variables.porosity = phi;
532 auto const tortuosity =
534 .template value<double>(variables, x_position, t, dt);
535 double const D_v =
536 phi * (1.0 - S_L) * tortuosity *
538 .template value<double>(variables, x_position, t, dt);
539
540 double const f_Tv_D_Tv = f_Tv * D_v * drho_wv_dT;
541 double const D_pv = D_v * drho_wv_dp;
542
546 double const specific_heat_capacity_vapour =
548 .template value<double>(variables, x_position, t, dt);
549
550 M_TT.noalias() +=
552 N.transpose() * N;
553
554 K_TT.noalias() += N.transpose() * vapour_flux.transpose() * dNdx *
556
558 phi * (rho_wv * dS_L_dp_cap + (1 - S_L) * drho_wv_dp);
559
560 storage_p_a_p.noalias() +=
561 N.transpose() * storage_coefficient_by_water_vapor * N * w;
562
563 double const vapor_expansion_factor = phi * (1 - S_L) * drho_wv_dT;
564 M_pT.noalias() += N.transpose() * vapor_expansion_factor * N * w;
565
569 .noalias() += dNdx.transpose() * f_Tv_D_Tv * dNdx * w;
570
572 .noalias() -= f_Tv_D_Tv * dNdx.transpose() * (dNdx * T) * w;
573
574 laplace_p.noalias() += dNdx.transpose() * D_pv * dNdx * w;
575
576 //
577 // Latent heat term
578 //
580 {
581 double const factor = phi * (1 - S_L) / rho_LR;
582 // The volumetric latent heat of vaporization of liquid water
583 double const L0 =
585 .template value<double>(variables, x_position, t, dt) *
586 rho_LR;
587
588 double const drho_LR_dT =
590 .template dValue<double>(variables,
592 x_position, t, dt);
593
594 double const rho_wv_over_rho_L = rho_wv / rho_LR;
595 M_TT.noalias() +=
596 factor * L0 *
598 N.transpose() * N * w;
599
600 M_Tp.noalias() +=
601 (factor * L0 *
604 N.transpose() * N * w;
605
606 // temperature equation, temperature part
607 K_TT.noalias() +=
608 L0 * f_Tv_D_Tv * dNdx.transpose() * dNdx * w / rho_LR;
609 // temperature equation, pressure part
610 K_Tp.noalias() +=
611 L0 * D_pv * dNdx.transpose() * dNdx * w / rho_LR;
612 }
613 }
614 }
615
616 if (_process_data.apply_mass_lumping)
617 {
618 storage_p_a_p = storage_p_a_p.colwise().sum().eval().asDiagonal();
619 storage_p_a_S = storage_p_a_S.colwise().sum().eval().asDiagonal();
621 storage_p_a_S_Jpp.colwise().sum().eval().asDiagonal();
622 }
623
624 //
625 // -- Jacobian
626 //
627 // temperature equation.
631 .noalias() += M_TT / dt + K_TT;
632 // temperature equation, pressure part
636 .noalias() += K_Tp + dK_TT_dp;
637
638 // pressure equation, pressure part.
642 .noalias() += laplace_p + storage_p_a_p / dt + storage_p_a_S_Jpp;
643
644 // pressure equation, temperature part (contributed by thermal expansion).
648 .noalias() += M_pT / dt + laplace_T;
649
650 //
651 // -- Residual
652 //
653 // temperature equation
655 M_TT * (T - T_prev) / dt + K_TT * T;
657 K_Tp * p_L;
658
659 // pressure equation
660 local_rhs.template segment<pressure_size>(pressure_index).noalias() -=
661 laplace_p * p_L + laplace_T * T +
663 M_pT * (T - T_prev) / dt;
664 if (gas_phase)
665 {
667 {
668 // Jacobian: temperature equation, pressure part
672 .noalias() += M_Tp / dt;
673 // RHS: temperature part
675 .noalias() -= M_Tp * (p_L - p_L_prev) / dt;
676 }
677 }
678}
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 1191 of file ThermoRichardsFlowFEM-impl.h.

1195{
1196 auto const T =
1198
1199 auto const p_L = local_x.template segment<pressure_size>(pressure_index);
1200
1201 auto p_L_prev =
1203
1204 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
1205 auto const& liquid_phase = medium.phase("AqueousLiquid");
1206 auto const& solid_phase = medium.phase("Solid");
1209
1210 unsigned const n_integration_points =
1211 _integration_method.getNumberOfPoints();
1212
1213 double saturation_avg = 0;
1214 double porosity_avg = 0;
1215
1216 for (unsigned ip = 0; ip < n_integration_points; ip++)
1217 {
1218 auto const& N = _ip_data[ip].N;
1219
1221 std::nullopt, _element.getID(),
1224 _element, N))};
1225
1226 double T_ip;
1228
1229 double p_cap_ip;
1231
1232 double p_cap_prev_ip;
1234
1235 variables.capillary_pressure = p_cap_ip;
1236 variables.liquid_phase_pressure = -p_cap_ip;
1237 // setting pG to 1 atm
1238 // TODO : rewrite equations s.t. p_L = pG-p_cap
1239 variables.gas_phase_pressure = 1.0e5;
1240
1241 variables.temperature = T_ip;
1242
1243 auto& S_L = _ip_data[ip].saturation;
1244 auto const S_L_prev = _ip_data[ip].saturation_prev;
1247 variables.liquid_saturation = S_L;
1248 variables_prev.liquid_saturation = S_L_prev;
1249
1250 auto chi_S_L = S_L;
1251 auto chi_S_L_prev = S_L_prev;
1253 {
1254 auto const chi = [&medium, x_position, t, dt](double const S_L)
1255 {
1257 variables.liquid_saturation = S_L;
1259 .template value<double>(variables, x_position, t, dt);
1260 };
1261 chi_S_L = chi(S_L);
1263 }
1264 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
1265 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
1266
1267 auto const alpha =
1270
1271 auto& solid_elasticity = *_process_data.simplified_elasticity;
1272 auto const beta_S =
1273 solid_elasticity.bulkCompressibilityFromYoungsModulus(
1275 auto const beta_SR = (1 - alpha) * beta_S;
1276 variables.grain_compressibility = beta_SR;
1277
1278 auto& phi = _ip_data[ip].porosity;
1279 { // Porosity update
1280 variables_prev.porosity = _ip_data[ip].porosity_prev;
1283 variables.porosity = phi;
1284 }
1285
1286 auto const mu =
1289 auto const rho_LR =
1292
1295 t, dt));
1296
1297 double const k_rel =
1299 .template value<double>(variables, x_position, t, dt);
1300
1302
1303 auto const rho_SR =
1306 _ip_data[ip].dry_density_solid = (1 - phi) * rho_SR;
1307
1308 auto const& b = _process_data.specific_body_force;
1309
1310 auto const K_pT_thermal_osmosis =
1311 (solid_phase.hasProperty(
1318
1319 // Compute the velocity
1320 auto const& dNdx = _ip_data[ip].dNdx;
1321 _ip_data[ip].v_darcy.noalias() = -K_over_mu * dNdx * p_L -
1323 rho_LR * K_over_mu * b;
1324
1326 porosity_avg += phi;
1327 }
1330
1331 (*_process_data.element_saturation)[_element.getID()] = saturation_avg;
1332 (*_process_data.element_porosity)[_element.getID()] = porosity_avg;
1333}

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 1112 of file ThermoRichardsFlowFEM-impl.h.

1118{
1119 unsigned const n_integration_points =
1120 _integration_method.getNumberOfPoints();
1121
1122 cache.clear();
1126
1127 for (unsigned ip = 0; ip < n_integration_points; ip++)
1128 {
1129 cache_matrix.col(ip).noalias() = _ip_data[ip].v_darcy;
1130 }
1131
1132 return cache;
1133}

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

◆ 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 1337 of file ThermoRichardsFlowFEM-impl.h.

1338{
1339 return _integration_method.getNumberOfPoints();
1340}

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 1158 of file ThermoRichardsFlowFEM-impl.h.

1159{
1161 getIntPtPorosity(0, {}, {}, result);
1162 return result;
1163}
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 1137 of file ThermoRichardsFlowFEM-impl.h.

1138{
1140 getIntPtSaturation(0, {}, {}, result);
1141 return result;
1142}
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 106 of file ThermoRichardsFlowFEM.h.

108 {
109 auto const& N = _ip_data[integration_point].N;
110
111 // assumes N is stored contiguously in memory
112 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
113 }

References _ip_data.

◆ initializeConcrete()

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

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 76 of file ThermoRichardsFlowFEM.h.

77 {
78 unsigned const n_integration_points =
79 _integration_method.getNumberOfPoints();
80
81 for (unsigned ip = 0; ip < n_integration_points; ip++)
82 {
83 auto& ip_data = _ip_data[ip];
84 ip_data.pushBackState();
85 }
86 }

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 88 of file ThermoRichardsFlowFEM.h.

92 {
93 unsigned const n_integration_points =
94 _integration_method.getNumberOfPoints();
95
96 for (unsigned ip = 0; ip < n_integration_points; ip++)
97 {
98 _ip_data[ip].pushBackState();
99 }
100 }

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 105 of file ThermoRichardsFlowFEM-impl.h.

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

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 76 of file ThermoRichardsFlowFEM-impl.h.

80{
82 static_cast<int>(_integration_method.getIntegrationOrder()))
83 {
85 "Setting integration point initial conditions; The integration "
86 "order of the local assembler for element {:d} is different "
87 "from the integration order in the initial condition.",
88 _element.getID());
89 }
90
91 if (name == "saturation")
92 {
95 }
96 if (name == "porosity")
97 {
100 }
101 return 0;
102}
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 151 of file ThermoRichardsFlowFEM.h.

Referenced by ThermoRichardsFlowLocalAssembler().

◆ _process_data

◆ pressure_index

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