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

Detailed Description

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

Definition at line 94 of file HTFEM.h.

#include <HTFEM.h>

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

Public Member Functions

 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)
void initializeConcrete () override
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
virtual std::vector< double > const & getIntPtDarcyVelocity (const double, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &) const =0
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 assemble (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
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.
virtual int getNumberOfVectorElementsForDeformation () const
Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default

Protected Member Functions

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

MeshLib::Element const & _element
HTProcessData const & _process_data
NumLib::GenericIntegrationMethod const & _integration_method
std::vector< IntegrationPointData< GlobalDimNodalMatrixType > > _ip_data

Static Protected Attributes

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

Private Types

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

Member Typedef Documentation

◆ GlobalDimMatrixType

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

Definition at line 105 of file HTFEM.h.

◆ GlobalDimNodalMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::GlobalDimNodalMatrixType
private
Initial value:
MatrixType< GlobalDim, ShapeFunction::NPOINTS > GlobalDimNodalMatrixType

Definition at line 103 of file HTFEM.h.

◆ GlobalDimVectorType

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

Definition at line 102 of file HTFEM.h.

◆ NodalRowVectorType

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

Definition at line 100 of file HTFEM.h.

◆ NodalVectorType

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

Definition at line 99 of file HTFEM.h.

◆ ShapeMatrices

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

Definition at line 97 of file HTFEM.h.

◆ ShapeMatricesType

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

Definition at line 96 of file HTFEM.h.

Constructor & Destructor Documentation

◆ HTFEM()

template<typename ShapeFunction, int GlobalDim>
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 )
inline

Definition at line 108 of file HTFEM.h.

118 {
119 // This assertion is valid only if all nodal d.o.f. use the same shape
120 // matrices.
124
125 unsigned const n_integration_points =
126 _integration_method.getNumberOfPoints();
128
130 pos.setElementID(_element.getID());
131
132 double const aperture_size = _process_data.aperture_size(0.0, pos)[0];
133
134 auto const shape_matrices =
138
139 for (unsigned ip = 0; ip < n_integration_points; ip++)
140 {
141 _ip_data.emplace_back(
143 _integration_method.getWeightedPoint(ip).getWeight() *
144 shape_matrices[ip].integralMeasure *
146 }
147 }
NumLib::GenericIntegrationMethod const & _integration_method
Definition HTFEM.h:270
ShapeMatrixPolicyType< ShapeFunction, GlobalDim > ShapeMatricesType
Definition HTFEM.h:96
MeshLib::Element const & _element
Definition HTFEM.h:267
HTProcessData const & _process_data
Definition HTFEM.h:268
std::vector< IntegrationPointData< GlobalDimNodalMatrixType > > _ip_data
Definition HTFEM.h:271

References ProcessLib::HT::HTLocalAssemblerInterface::HTLocalAssemblerInterface(), _element, _integration_method, _ip_data, _process_data, NumLib::initShapeMatrices(), and ParameterLib::SpatialPosition::setElementID().

Referenced by ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::MonolithicHTFEM(), and ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::StaggeredHTFEM().

Member Function Documentation

◆ getFlux()

template<typename ShapeFunction, int GlobalDim>
Eigen::Vector3d ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getFlux ( MathLib::Point3d const & pnt_local_coords,
double const t,
std::vector< double > const & local_x ) const
inlineoverridevirtual

Computes the flux in the point pnt_local_coords that is given in local coordinates using the values from local_x.

Implements ProcessLib::HT::HTLocalAssemblerInterface.

Definition at line 199 of file HTFEM.h.

202 {
203 // Eval shape matrices at given point
204 // Note: Axial symmetry is set to false here, because we only need dNdx
205 // here, which is not affected by axial symmetry.
206 auto const shape_matrices =
208 GlobalDim>(
209 _element, false /*is_axially_symmetric*/,
211
213 pos.setElementID(this->_element.getID());
214
216
217 // local_x contains the local temperature and pressure values
218 double T_int_pt = 0.0;
219 double p_int_pt = 0.0;
221 p_int_pt);
222
223 vars.temperature = T_int_pt;
224 vars.liquid_phase_pressure = p_int_pt;
225
226 auto const& medium =
227 *_process_data.media_map.getMedium(_element.getID());
228 auto const& liquid_phase =
230
231 // TODO (naumov) Temporary value not used by current material models.
232 // Need extension of secondary variables interface.
234 // fetch permeability, viscosity, density
237 .value(vars, pos, t, dt));
238
239 auto const mu =
241 .template value<double>(vars, pos, t, dt);
243
248
249 if (this->_process_data.has_gravity)
250 {
251 auto const rho_w =
254 .template value<double>(vars, pos, t, dt);
255 auto const b =
256 this->_process_data.projected_specific_body_force_vectors
257 [this->_element.getID()];
258 q += K_over_mu * rho_w * b;
259 }
260
262 flux.head<GlobalDim>() = q;
263 return flux;
264 }
typename ShapeMatricesType::GlobalDimMatrixType GlobalDimMatrixType
Definition HTFEM.h:105
typename ShapeMatricesType::GlobalDimVectorType GlobalDimVectorType
Definition HTFEM.h:102
constexpr Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)

References _element, _process_data, MaterialPropertyLib::AqueousLiquid, NumLib::computeShapeMatrices(), MaterialPropertyLib::density, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::permeability, ParameterLib::SpatialPosition::setElementID(), NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::VariableArray::temperature, and MaterialPropertyLib::viscosity.

◆ getHeatEnergyCoefficient()

template<typename ShapeFunction, int GlobalDim>
double ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::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 )
inlineprotected

◆ getIntPtDarcyVelocityLocal()

template<typename ShapeFunction, int GlobalDim>
std::vector< double > const & ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocityLocal ( const double t,
std::vector< double > const & local_x,
std::vector< double > & cache ) const
inlineprotected

Definition at line 339 of file HTFEM.h.

342 {
344 local_x.data() + pressure_index,
347 local_x.data() + temperature_index,
349
350 auto const n_integration_points =
351 _integration_method.getNumberOfPoints();
352
353 cache.clear();
357
359 pos.setElementID(_element.getID());
360
362
365
366 auto const& medium =
367 *_process_data.media_map.getMedium(_element.getID());
368 auto const& liquid_phase =
370
371 auto const& Ns =
372 _process_data.shape_matrix_cache
373 .NsHigherOrder<typename ShapeFunction::MeshElement>();
374
375 for (unsigned ip = 0; ip < n_integration_points; ++ip)
376 {
377 auto const& ip_data = _ip_data[ip];
378 auto const& dNdx = ip_data.dNdx;
379 auto const& N = Ns[ip];
380
381 double T_int_pt = 0.0;
382 double p_int_pt = 0.0;
385
386 vars.temperature = T_int_pt;
387 vars.liquid_phase_pressure = p_int_pt;
388
389 // TODO (naumov) Temporary value not used by current material
390 // models. Need extension of secondary variables interface.
394 .value(vars, pos, t, dt));
395
396 auto const mu =
399 .template value<double>(vars, pos, t, dt);
401
402 cache_mat.col(ip).noalias() = -K_over_mu * dNdx * p_nodal_values;
403
404 if (_process_data.has_gravity)
405 {
406 auto const rho_w =
409 .template value<double>(vars, pos, t, dt);
410 auto const b =
411 _process_data.projected_specific_body_force_vectors
412 [_element.getID()];
413 // here it is assumed that the vector b is directed 'downwards'
414 cache_mat.col(ip).noalias() += K_over_mu * rho_w * b;
415 }
416 }
417
418 return cache;
419 }
static const int temperature_index
Definition HTFEM.h:424
static const int temperature_size
Definition HTFEM.h:425
static const int pressure_size
Definition HTFEM.h:423
static const int pressure_index
Definition HTFEM.h:422

References _element, _integration_method, _ip_data, _process_data, MaterialPropertyLib::AqueousLiquid, MathLib::createZeroedMatrix(), MaterialPropertyLib::density, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::permeability, pressure_index, pressure_size, ParameterLib::SpatialPosition::setElementID(), NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::VariableArray::temperature, temperature_index, temperature_size, and MaterialPropertyLib::viscosity.

Referenced by ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), and ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity().

◆ getShapeMatrix()

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

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 187 of file HTFEM.h.

189 {
190 auto const& N = _process_data.shape_matrix_cache.NsHigherOrder<
192
193 // assumes N is stored contiguously in memory
194 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
195 }

References _process_data.

◆ getThermalConductivityDispersivity()

template<typename ShapeFunction, int GlobalDim>
GlobalDimMatrixType ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::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 )
inlineprotected

Definition at line 298 of file HTFEM.h.

304 {
305 auto const& medium =
306 *_process_data.media_map.getMedium(_element.getID());
307
310 medium
311 .property(
313 .value(vars, pos, t, dt));
314
316 medium
319 .template value<double>();
320
322 medium
325 .template value<double>();
326
327 // Thermal conductivity is moved outside and zero matrix is passed
328 // instead due to multiplication with fluid's density times specific
329 // heat capacity.
330 return thermal_conductivity +
333 _process_data.stabilizer, _element.getID(),
337 }
Eigen::MatrixXd computeHydrodynamicDispersion(NumericalStabilization const &stabilizer, std::size_t const element_id, Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)

References _element, _process_data, NumLib::computeHydrodynamicDispersion(), MaterialPropertyLib::formEigenTensor(), and MaterialPropertyLib::thermal_conductivity.

Referenced by ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::assemble(), and ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::assembleHeatTransportEquation().

◆ initializeConcrete()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::initializeConcrete ( )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 149 of file HTFEM.h.

150 {
151 auto const& medium =
152 *_process_data.media_map.getMedium(_element.getID());
153 auto const& solid_phase =
155
156 // The Biot coefficient is read only together with the solid thermal
157 // expansivity, see evalEffectiveThermalExpansivity().
158 if (!solid_phase.hasProperty(
160 {
161 return;
162 }
163
165 vars.liquid_saturation = 1.0;
166
167 auto const& Ns =
168 _process_data.shape_matrix_cache
170
171 unsigned const n_integration_points =
172 _integration_method.getNumberOfPoints();
173 for (unsigned ip = 0; ip < n_integration_points; ip++)
174 {
176 std::nullopt, _element.getID(),
180 Ns[ip]))};
181
182 checkBiotStorageRelation(0.0 /* t */, 0.0 /* dt */, pos, vars,
184 }
185 }
void checkBiotStorageRelation(double const t, double const dt, ParameterLib::SpatialPosition const &pos, MaterialPropertyLib::VariableArray const &vars, MaterialPropertyLib::Medium const &medium, MaterialPropertyLib::Phase const &solid_phase)
Definition HTFEM.cpp:83

References _element, _integration_method, _process_data, ProcessLib::HT::checkBiotStorageRelation(), NumLib::interpolateCoordinates(), MaterialPropertyLib::VariableArray::liquid_saturation, MaterialPropertyLib::Solid, and MaterialPropertyLib::thermal_expansivity.

Member Data Documentation

◆ _element

◆ _integration_method

◆ _ip_data

◆ _process_data

◆ pressure_index

◆ pressure_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::pressure_size = ShapeFunction::NPOINTS
staticprotected

◆ temperature_index

◆ temperature_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::temperature_size = ShapeFunction::NPOINTS
staticprotected

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