OGS
ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod > Class Template Reference

Detailed Description

template<typename ShapeFunction, typename IntegrationMethod>
class ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >

Definition at line 29 of file HeatTransportBHELocalAssemblerSoil.h.

#include <HeatTransportBHELocalAssemblerSoil.h>

Inheritance diagram for ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >:
[legend]
Collaboration diagram for ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >:
[legend]

Public Types

using ShapeMatricesType = ShapeMatrixPolicyType< ShapeFunction, 3 >
 
using NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
 
using NodalVectorType = typename ShapeMatricesType::NodalVectorType
 
using NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType
 
using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
 
using GlobalDimNodalMatrixType = typename ShapeMatricesType::GlobalDimNodalMatrixType
 

Public Member Functions

 HeatTransportBHELocalAssemblerSoil (HeatTransportBHELocalAssemblerSoil const &)=delete
 
 HeatTransportBHELocalAssemblerSoil (HeatTransportBHELocalAssemblerSoil &&)=delete
 
 HeatTransportBHELocalAssemblerSoil (MeshLib::Element const &e, bool is_axially_symmetric, unsigned const integration_order, HeatTransportBHEProcessData &process_data)
 
void assemble (double const, double const, std::vector< double > const &, std::vector< double > const &, std::vector< double > &, std::vector< double > &, std::vector< double > &) override
 
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const override
 Provides the shape matrix at the given integration point. More...
 
- Public Member Functions inherited from ProcessLib::LocalAssemblerInterface
virtual ~LocalAssemblerInterface ()=default
 
void setInitialConditions (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, bool const use_monolithic_scheme, 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_xdot, 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_xdot, const double dxdot_dx, const double dx_dx, std::vector< double > &local_M_data, std::vector< double > &local_K_data, 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_xdot, const double dxdot_dx, const double dx_dx, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, 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_dot, 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, double const t, double const dt)
 
void postNonLinearSolver (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, GlobalVector const &xdot, double const t, double const dt, bool const use_monolithic_scheme, int const process_id)
 
virtual std::vector< double > interpolateNodalValuesToIntegrationPoints (std::vector< double > const &)
 
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. More...
 
- Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default
 

Private Attributes

HeatTransportBHEProcessData_process_data
 
std::vector< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType >, Eigen::aligned_allocator< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType > > > _ip_data
 
IntegrationMethod const _integration_method
 
std::vector< ShapeMatrices, Eigen::aligned_allocator< ShapeMatrices > > _shape_matrices
 
std::size_t const _element_id
 
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data
 

Member Typedef Documentation

◆ GlobalDimNodalMatrixType

template<typename ShapeFunction , typename IntegrationMethod >
using ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::GlobalDimNodalMatrixType = typename ShapeMatricesType::GlobalDimNodalMatrixType

Definition at line 40 of file HeatTransportBHELocalAssemblerSoil.h.

◆ NodalMatrixType

template<typename ShapeFunction , typename IntegrationMethod >
using ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::NodalMatrixType = typename ShapeMatricesType::NodalMatrixType

Definition at line 35 of file HeatTransportBHELocalAssemblerSoil.h.

◆ NodalRowVectorType

template<typename ShapeFunction , typename IntegrationMethod >
using ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType

Definition at line 37 of file HeatTransportBHELocalAssemblerSoil.h.

◆ NodalVectorType

template<typename ShapeFunction , typename IntegrationMethod >
using ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::NodalVectorType = typename ShapeMatricesType::NodalVectorType

Definition at line 36 of file HeatTransportBHELocalAssemblerSoil.h.

◆ ShapeMatrices

template<typename ShapeFunction , typename IntegrationMethod >
using ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::ShapeMatrices = typename ShapeMatricesType::ShapeMatrices

Definition at line 39 of file HeatTransportBHELocalAssemblerSoil.h.

◆ ShapeMatricesType

template<typename ShapeFunction , typename IntegrationMethod >
using ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, 3 >

Definition at line 33 of file HeatTransportBHELocalAssemblerSoil.h.

Constructor & Destructor Documentation

◆ HeatTransportBHELocalAssemblerSoil() [1/3]

template<typename ShapeFunction , typename IntegrationMethod >
ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::HeatTransportBHELocalAssemblerSoil ( HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod > const &  )
delete

◆ HeatTransportBHELocalAssemblerSoil() [2/3]

template<typename ShapeFunction , typename IntegrationMethod >
ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::HeatTransportBHELocalAssemblerSoil ( HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod > &&  )
delete

◆ HeatTransportBHELocalAssemblerSoil() [3/3]

template<typename ShapeFunction , typename IntegrationMethod >
ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::HeatTransportBHELocalAssemblerSoil ( MeshLib::Element const &  e,
bool  is_axially_symmetric,
unsigned const  integration_order,
HeatTransportBHEProcessData process_data 
)

Definition at line 31 of file HeatTransportBHELocalAssemblerSoil-impl.h.

37  : _process_data(process_data),
38  _integration_method(integration_order),
39  _element_id(e.getID())
40 {
41  unsigned const n_integration_points =
42  _integration_method.getNumberOfPoints();
43 
44  _ip_data.reserve(n_integration_points);
45  _secondary_data.N.resize(n_integration_points);
46 
49  3 /* GlobalDim */>(e, is_axially_symmetric,
51 
53  x_position.setElementID(_element_id);
54 
55  // ip data initialization
56  for (unsigned ip = 0; ip < n_integration_points; ip++)
57  {
58  x_position.setIntegrationPoint(ip);
59 
60  // create the class IntegrationPointDataBHE in place
61  auto const& sm = _shape_matrices[ip];
62  double const w = _integration_method.getWeightedPoint(ip).getWeight() *
63  sm.integralMeasure * sm.detJ;
64  _ip_data.push_back({sm.N, sm.dNdx, w});
65 
66  _secondary_data.N[ip] = sm.N;
67  }
68 }
void setElementID(std::size_t element_id)
std::vector< ShapeMatrices, Eigen::aligned_allocator< ShapeMatrices > > _shape_matrices
std::vector< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType >, Eigen::aligned_allocator< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType > > > _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)
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N
Definition: SecondaryData.h:28

References ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_element_id, ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_integration_method, ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_ip_data, ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_secondary_data, ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_shape_matrices, NumLib::initShapeMatrices(), ProcessLib::HeatTransportBHE::SecondaryData< ShapeMatrixType >::N, and ParameterLib::SpatialPosition::setElementID().

Member Function Documentation

◆ assemble()

template<typename ShapeFunction , typename IntegrationMethod >
void ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::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 > &   
)
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 71 of file HeatTransportBHELocalAssemblerSoil-impl.h.

78 {
79  assert(local_x.size() == ShapeFunction::NPOINTS);
80  (void)local_x; // Avoid unused arg warning.
81 
82  auto local_M = MathLib::createZeroedMatrix<NodalMatrixType>(
83  local_M_data, ShapeFunction::NPOINTS, ShapeFunction::NPOINTS);
84  auto local_K = MathLib::createZeroedMatrix<NodalMatrixType>(
85  local_K_data, ShapeFunction::NPOINTS, ShapeFunction::NPOINTS);
86 
89 
90  auto const& medium = *_process_data.media_map->getMedium(_element_id);
91  auto const& solid_phase = medium.phase("Solid");
92  auto const& liquid_phase = medium.phase("AqueousLiquid");
93 
95 
96  unsigned const n_integration_points =
97  _integration_method.getNumberOfPoints();
98 
99  for (unsigned ip = 0; ip < n_integration_points; ip++)
100  {
101  pos.setIntegrationPoint(ip);
102  auto& ip_data = _ip_data[ip];
103  auto const& N = ip_data.N;
104  auto const& dNdx = ip_data.dNdx;
105  auto const& w = ip_data.integration_weight;
106 
107  double T_int_pt = 0.0;
108  NumLib::shapeFunctionInterpolate(local_x, N, T_int_pt);
109 
110  vars[static_cast<int>(MaterialPropertyLib::Variable::temperature)] =
111  T_int_pt;
112 
113  // for now only using the solid and liquid phase parameters
114  auto const density_s =
115  solid_phase.property(MaterialPropertyLib::PropertyType::density)
116  .template value<double>(vars, pos, t, dt);
117 
118  auto const heat_capacity_s =
119  solid_phase
120  .property(
122  .template value<double>(vars, pos, t, dt);
123 
124  auto const density_f =
125  liquid_phase.property(MaterialPropertyLib::PropertyType::density)
126  .template value<double>(vars, pos, t, dt);
127 
128  auto const heat_capacity_f =
129  liquid_phase
130  .property(
132  .template value<double>(vars, pos, t, dt);
133 
134  auto const porosity =
136  .template value<double>(vars, pos, t, dt);
137 
138  auto const velocity =
139  liquid_phase
141  .template value<Eigen::Vector3d>(vars, pos, t, dt);
142 
143  // calculate the hydrodynamic thermodispersion tensor
144  auto const thermal_conductivity =
146  medium
147  .property(
149  .value(vars, pos, t, dt));
150 
151  auto thermal_conductivity_dispersivity = thermal_conductivity;
152 
153  double const velocity_magnitude = velocity.norm();
154 
155  if (velocity_magnitude >= std::numeric_limits<double>::epsilon())
156  {
157  auto const thermal_dispersivity_longitudinal =
158  medium
161  .template value<double>();
162  auto const thermal_dispersivity_transversal =
163  medium
166  .template value<double>();
167 
168  auto const thermal_dispersivity =
169  density_f * heat_capacity_f *
170  (thermal_dispersivity_transversal * velocity_magnitude *
171  Eigen::Matrix3d::Identity() +
172  (thermal_dispersivity_longitudinal -
173  thermal_dispersivity_transversal) /
174  velocity_magnitude * velocity * velocity.transpose());
175  thermal_conductivity_dispersivity += thermal_dispersivity;
176  }
177 
178  // assemble Conductance matrix
179  local_K.noalias() +=
180  (dNdx.transpose() * thermal_conductivity_dispersivity * dNdx +
181  N.transpose() * velocity.transpose() * dNdx * density_f *
182  heat_capacity_f) *
183  w;
184 
185  // assemble Mass matrix
186  local_M.noalias() += N.transpose() * N * w *
187  (density_s * heat_capacity_s * (1 - porosity) +
188  density_f * heat_capacity_f * porosity);
189  }
190 
191  // debugging
192  // std::string sep = "\n----------------------------------------\n";
193  // Eigen::IOFormat CleanFmt(4, 0, ", ", "\n", "[", "]");
194  // std::cout << local_K.format(CleanFmt) << sep;
195  // std::cout << local_M.format(CleanFmt) << sep;
196 }
void setIntegrationPoint(unsigned integration_point)
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(MaterialPropertyLib::PropertyDataType const &values)
std::array< VariableType, static_cast< int >(Variable::number_of_variables)> VariableArray
Definition: VariableType.h:108
void shapeFunctionInterpolate(const NodalValues &nodal_values, const ShapeMatrix &shape_matrix_N, double &interpolated_value, ScalarTypes &... interpolated_values)
Definition: Interpolation.h:79
std::unique_ptr< MaterialPropertyLib::MaterialSpatialDistributionMap > media_map

References MaterialPropertyLib::density, MaterialPropertyLib::formEigenTensor< 3 >(), MaterialPropertyLib::phase_velocity, MaterialPropertyLib::porosity, ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), NumLib::shapeFunctionInterpolate(), MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::temperature, MaterialPropertyLib::thermal_conductivity, MaterialPropertyLib::thermal_longitudinal_dispersivity, and MaterialPropertyLib::thermal_transversal_dispersivity.

◆ getShapeMatrix()

template<typename ShapeFunction , typename IntegrationMethod >
Eigen::Map<const Eigen::RowVectorXd> ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::getShapeMatrix ( const unsigned  integration_point) const
inlineoverridevirtual

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 61 of file HeatTransportBHELocalAssemblerSoil.h.

63  {
64  auto const& N = _secondary_data.N[integration_point];
65 
66  // assumes N is stored contiguously in memory
67  return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
68  }

References ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_secondary_data, and ProcessLib::HeatTransportBHE::SecondaryData< ShapeMatrixType >::N.

Member Data Documentation

◆ _element_id

template<typename ShapeFunction , typename IntegrationMethod >
std::size_t const ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_element_id
private

◆ _integration_method

template<typename ShapeFunction , typename IntegrationMethod >
IntegrationMethod const ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_integration_method
private

◆ _ip_data

◆ _process_data

template<typename ShapeFunction , typename IntegrationMethod >
HeatTransportBHEProcessData& ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_process_data
private

Definition at line 71 of file HeatTransportBHELocalAssemblerSoil.h.

◆ _secondary_data

◆ _shape_matrices

template<typename ShapeFunction , typename IntegrationMethod >
std::vector<ShapeMatrices, Eigen::aligned_allocator<ShapeMatrices> > ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::_shape_matrices
private

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