OGS
ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim > Class Template Reference

Detailed Description

template<typename ShapeFunction, int GlobalDim>
class ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >

Definition at line 38 of file MonolithicHTFEM.h.

#include <MonolithicHTFEM.h>

Inheritance diagram for ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >:
[legend]
Collaboration diagram for ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >:
[legend]

Public Member Functions

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

Private Types

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

Additional Inherited Members

- Protected Member Functions inherited from ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >
double getHeatEnergyCoefficient (MaterialPropertyLib::VariableArray const &vars, const double porosity, const double fluid_density, const double specific_heat_capacity_fluid, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
 
GlobalDimMatrixType getThermalConductivityDispersivity (MaterialPropertyLib::VariableArray const &vars, const double fluid_density, const double specific_heat_capacity_fluid, const GlobalDimVectorType &velocity, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
 
std::vector< double > const & getIntPtDarcyVelocityLocal (const double t, std::vector< double > const &local_x, std::vector< double > &cache) const
 
- Protected Attributes inherited from ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >
MeshLib::Element const & _element
 
HTProcessData const & _process_data
 
NumLib::GenericIntegrationMethod const & _integration_method
 
std::vector< IntegrationPointData< GlobalDimNodalMatrixType > > _ip_data
 
- Static Protected Attributes inherited from ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >
static const int pressure_index = ShapeFunction::NPOINTS
 
static const int pressure_size = ShapeFunction::NPOINTS
 
static const int temperature_index = 0
 
static const int temperature_size = ShapeFunction::NPOINTS
 

Member Typedef Documentation

◆ GlobalDimMatrixType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType
private

Definition at line 55 of file MonolithicHTFEM.h.

◆ GlobalDimVectorType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType
private

Definition at line 54 of file MonolithicHTFEM.h.

◆ LocalMatrixType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::LocalMatrixType
private
Initial value:
typename ShapeMatricesType::template MatrixType<
NUM_NODAL_DOF * ShapeFunction::NPOINTS,
NUM_NODAL_DOF * ShapeFunction::NPOINTS>
const unsigned NUM_NODAL_DOF

Definition at line 43 of file MonolithicHTFEM.h.

◆ LocalVectorType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::LocalVectorType
private
Initial value:
typename ShapeMatricesType::template VectorType<NUM_NODAL_DOF *
ShapeFunction::NPOINTS>

Definition at line 46 of file MonolithicHTFEM.h.

◆ NodalMatrixType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
private

Definition at line 51 of file MonolithicHTFEM.h.

◆ NodalRowVectorType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType
private

Definition at line 52 of file MonolithicHTFEM.h.

◆ NodalVectorType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::NodalVectorType = typename ShapeMatricesType::NodalVectorType
private

Definition at line 50 of file MonolithicHTFEM.h.

◆ ShapeMatrices

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
private

Definition at line 41 of file MonolithicHTFEM.h.

◆ ShapeMatricesType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
private

Definition at line 40 of file MonolithicHTFEM.h.

Constructor & Destructor Documentation

◆ MonolithicHTFEM()

template<typename ShapeFunction , int GlobalDim>
ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::MonolithicHTFEM ( MeshLib::Element const & element,
std::size_t const local_matrix_size,
NumLib::GenericIntegrationMethod const & integration_method,
bool is_axially_symmetric,
HTProcessData const & process_data )
inline

Definition at line 58 of file MonolithicHTFEM.h.

64 element, local_matrix_size, integration_method,
65 is_axially_symmetric, process_data, NUM_NODAL_DOF)
66 {
67 }
HTFEM(MeshLib::Element const &element, std::size_t const local_matrix_size, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, HTProcessData const &process_data, const unsigned dof_per_node)
Definition HTFEM.h:48

Member Function Documentation

◆ assemble()

template<typename ShapeFunction , int GlobalDim>
void ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::assemble ( double const t,
double const dt,
std::vector< double > const & local_x,
std::vector< double > const & ,
std::vector< double > & local_M_data,
std::vector< double > & local_K_data,
std::vector< double > & local_b_data )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 69 of file MonolithicHTFEM.h.

75 {
76 auto const local_matrix_size = local_x.size();
77 // This assertion is valid only if all nodal d.o.f. use the same shape
78 // matrices.
79 assert(local_matrix_size == ShapeFunction::NPOINTS * NUM_NODAL_DOF);
80
82 local_M_data, local_matrix_size, local_matrix_size);
84 local_K_data, local_matrix_size, local_matrix_size);
86 local_b_data, local_matrix_size);
87
88 auto KTT = local_K.template block<temperature_size, temperature_size>(
90 auto MTT = local_M.template block<temperature_size, temperature_size>(
92 auto Kpp = local_K.template block<pressure_size, pressure_size>(
94 auto Mpp = local_M.template block<pressure_size, pressure_size>(
96 auto Bp = local_b.template block<pressure_size, 1>(pressure_index, 0);
97
98 auto const& process_data = this->_process_data;
99
101 pos.setElementID(this->_element.getID());
102
103 auto p_nodal_values = Eigen::Map<const NodalVectorType>(
104 &local_x[pressure_index], pressure_size);
105
106 auto const& medium =
107 *process_data.media_map.getMedium(this->_element.getID());
108 auto const& liquid_phase = medium.phase("AqueousLiquid");
109 auto const& solid_phase = medium.phase("Solid");
110
111 auto const& b =
112 process_data
113 .projected_specific_body_force_vectors[this->_element.getID()];
114
116
117 unsigned const n_integration_points =
119
120 std::vector<GlobalDimVectorType> ip_flux_vector;
121 double average_velocity_norm = 0.0;
122 ip_flux_vector.reserve(n_integration_points);
123
124 auto const& Ns =
125 process_data.shape_matrix_cache
126 .template NsHigherOrder<typename ShapeFunction::MeshElement>();
127
128 for (unsigned ip(0); ip < n_integration_points; ip++)
129 {
130 pos.setIntegrationPoint(ip);
131
132 auto const& ip_data = this->_ip_data[ip];
133 auto const& dNdx = ip_data.dNdx;
134 auto const& N = Ns[ip];
135 auto const& w = ip_data.integration_weight;
136
137 double T_int_pt = 0.0;
138 double p_int_pt = 0.0;
139 // Order matters: First T, then P!
140 NumLib::shapeFunctionInterpolate(local_x, N, T_int_pt, p_int_pt);
141
142 vars.temperature = T_int_pt;
143 vars.liquid_phase_pressure = p_int_pt;
144
145 vars.liquid_saturation = 1.0;
146 // \todo the argument to getValue() has to be changed for non
147 // constant storage model
148 auto const specific_storage =
150 .template value<double>(vars, pos, t, dt);
151
152 auto const porosity =
154 .template value<double>(vars, pos, t, dt);
155 vars.porosity = porosity;
156
157 auto const intrinsic_permeability =
159 medium
160 .property(
162 .value(vars, pos, t, dt));
163
164 auto const specific_heat_capacity_fluid =
165 liquid_phase
167 .template value<double>(vars, pos, t, dt);
168
169 // Use the fluid density model to compute the density
170 auto const fluid_density =
171 liquid_phase
173 .template value<double>(vars, pos, t, dt);
174
175 vars.density = fluid_density;
176 // Use the viscosity model to compute the viscosity
177 auto const viscosity =
178 liquid_phase
180 .template value<double>(vars, pos, t, dt);
181 GlobalDimMatrixType K_over_mu = intrinsic_permeability / viscosity;
182
183 GlobalDimVectorType const velocity =
184 process_data.has_gravity
185 ? GlobalDimVectorType(-K_over_mu * (dNdx * p_nodal_values -
186 fluid_density * b))
187 : GlobalDimVectorType(-K_over_mu * dNdx * p_nodal_values);
188
189 // matrix assembly
190 GlobalDimMatrixType const thermal_conductivity_dispersivity =
192 vars, fluid_density, specific_heat_capacity_fluid, velocity,
193 pos, t, dt);
194
195 KTT.noalias() +=
196 dNdx.transpose() * thermal_conductivity_dispersivity * dNdx * w;
197
198 ip_flux_vector.emplace_back(velocity * fluid_density *
199 specific_heat_capacity_fluid);
200 average_velocity_norm += velocity.norm();
201
202 Kpp.noalias() += w * dNdx.transpose() * K_over_mu * dNdx;
203 MTT.noalias() += w *
205 vars, porosity, fluid_density,
206 specific_heat_capacity_fluid, pos, t, dt) *
207 N.transpose() * N;
208 Mpp.noalias() += w * N.transpose() * specific_storage * N;
209 if (process_data.has_gravity)
210 {
211 Bp += w * fluid_density * dNdx.transpose() * K_over_mu * b;
212 }
213 /* with Oberbeck-Boussing assumption density difference only exists
214 * in buoyancy effects */
215 }
216
218 process_data.stabilizer, this->_ip_data,
219 process_data.shape_matrix_cache, ip_flux_vector,
220 average_velocity_norm / static_cast<double>(n_integration_points),
221 KTT);
222 }
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:89
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
NumLib::GenericIntegrationMethod const & _integration_method
Definition HTFEM.h:171
static const int temperature_index
Definition HTFEM.h:325
double getHeatEnergyCoefficient(MaterialPropertyLib::VariableArray const &vars, const double porosity, const double fluid_density, const double specific_heat_capacity_fluid, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
Definition HTFEM.h:174
static const int pressure_size
Definition HTFEM.h:324
GlobalDimMatrixType getThermalConductivityDispersivity(MaterialPropertyLib::VariableArray const &vars, const double fluid_density, const double specific_heat_capacity_fluid, const GlobalDimVectorType &velocity, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
Definition HTFEM.h:198
MeshLib::Element const & _element
Definition HTFEM.h:168
HTProcessData const & _process_data
Definition HTFEM.h:169
std::vector< IntegrationPointData< GlobalDimNodalMatrixType > > _ip_data
Definition HTFEM.h:172
static const int pressure_index
Definition HTFEM.h:323
typename ShapeMatricesType::GlobalDimVectorType GlobalDimVectorType
typename ShapeMatricesType::GlobalDimMatrixType GlobalDimMatrixType
Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
void assembleAdvectionMatrix(IPData const &ip_data_vector, NumLib::ShapeMatrixCache const &shape_matrix_cache, std::vector< FluxVectorType > const &ip_flux_vector, Eigen::MatrixBase< Derived > &laplacian_matrix)
double fluid_density(const double p, const double T, const double x)

References ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::_element, ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::_integration_method, ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::_ip_data, ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::_process_data, NumLib::detail::assembleAdvectionMatrix(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::formEigenTensor(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getHeatEnergyCoefficient(), MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getThermalConductivityDispersivity(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, ProcessLib::HT::NUM_NODAL_DOF, MaterialPropertyLib::permeability, MaterialPropertyLib::porosity, MaterialPropertyLib::VariableArray::porosity, ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::pressure_index, ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::pressure_size, ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::storage, MaterialPropertyLib::VariableArray::temperature, ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::temperature_index, and MaterialPropertyLib::viscosity.

◆ getIntPtDarcyVelocity()

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

Implements ProcessLib::HT::HTLocalAssemblerInterface.

Definition at line 224 of file MonolithicHTFEM.h.

229 {
230 int const process_id = 0; // monolithic case.
231 auto const indices =
232 NumLib::getIndices(this->_element.getID(), *dof_table[process_id]);
233 assert(!indices.empty());
234 auto const& local_x = x[process_id]->get(indices);
235
236 return this->getIntPtDarcyVelocityLocal(t, local_x, cache);
237 }
std::vector< double > const & getIntPtDarcyVelocityLocal(const double t, std::vector< double > const &local_x, std::vector< double > &cache) const
Definition HTFEM.h:239
std::vector< GlobalIndexType > getIndices(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)

References ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::_element, MeshLib::Element::getID(), NumLib::getIndices(), and ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocityLocal().


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