Loading [MathJax]/extensions/tex2jax.js
OGS
ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction > Class Template Reference

Detailed Description

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

Definition at line 30 of file HeatTransportBHELocalAssemblerSoil.h.

#include <HeatTransportBHELocalAssemblerSoil.h>

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

Public Types

using ShapeMatricesType
using NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
using NodalVectorType = typename ShapeMatricesType::NodalVectorType
using NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType
using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
using GlobalDimNodalMatrixType

Public Member Functions

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

Private Attributes

HeatTransportBHEProcessData_process_data
std::vector< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType >, Eigen::aligned_allocator< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType > > > _ip_data
NumLib::GenericIntegrationMethod const & _integration_method
std::vector< ShapeMatrices, Eigen::aligned_allocator< ShapeMatrices > > _shape_matrices
MeshLib::Element const & _element
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data

Member Typedef Documentation

◆ GlobalDimNodalMatrixType

template<typename ShapeFunction>
using ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::GlobalDimNodalMatrixType
Initial value:
MatrixType< GlobalDim, ShapeFunction::NPOINTS > GlobalDimNodalMatrixType

Definition at line 41 of file HeatTransportBHELocalAssemblerSoil.h.

◆ NodalMatrixType

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

Definition at line 36 of file HeatTransportBHELocalAssemblerSoil.h.

◆ NodalRowVectorType

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

Definition at line 38 of file HeatTransportBHELocalAssemblerSoil.h.

◆ NodalVectorType

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

Definition at line 37 of file HeatTransportBHELocalAssemblerSoil.h.

◆ ShapeMatrices

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

Definition at line 40 of file HeatTransportBHELocalAssemblerSoil.h.

◆ ShapeMatricesType

template<typename ShapeFunction>
using ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::ShapeMatricesType
Initial value:
EigenFixedShapeMatrixPolicy< ShapeFunction, GlobalDim > ShapeMatrixPolicyType

Definition at line 34 of file HeatTransportBHELocalAssemblerSoil.h.

Constructor & Destructor Documentation

◆ HeatTransportBHELocalAssemblerSoil() [1/3]

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

◆ HeatTransportBHELocalAssemblerSoil() [2/3]

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

◆ HeatTransportBHELocalAssemblerSoil() [3/3]

template<typename ShapeFunction>
ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::HeatTransportBHELocalAssemblerSoil ( MeshLib::Element const & e,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
HeatTransportBHEProcessData & process_data )

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

39 _element(e)
40{
41 unsigned const n_integration_points =
42 _integration_method.getNumberOfPoints();
43
46
49 3 /* GlobalDim */>(e, is_axially_symmetric,
51
52 // ip data initialization
53 for (unsigned ip = 0; ip < n_integration_points; ip++)
54 {
55 // create the class IntegrationPointDataBHE in place
56 auto const& sm = _shape_matrices[ip];
57 double const w = _integration_method.getWeightedPoint(ip).getWeight() *
58 sm.integralMeasure * sm.detJ;
59 _ip_data.push_back({sm.N, sm.dNdx, w});
60
61 _secondary_data.N[ip] = sm.N;
62 }
63}
std::vector< ShapeMatrices, Eigen::aligned_allocator< ShapeMatrices > > _shape_matrices
std::vector< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType >, Eigen::aligned_allocator< IntegrationPointDataSoil< NodalRowVectorType, GlobalDimNodalMatrixType > > > _ip_data

References _element, _integration_method, _ip_data, _process_data, _secondary_data, _shape_matrices, and NumLib::initShapeMatrices().

Member Function Documentation

◆ assemble()

template<typename ShapeFunction>
void ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::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 66 of file HeatTransportBHELocalAssemblerSoil-impl.h.

71{
73 (void)local_x; // Avoid unused arg warning.
74
79
80 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
81 auto const& solid_phase = medium.phase("Solid");
82 auto const& liquid_phase = medium.phase("AqueousLiquid");
83
85
86 unsigned const n_integration_points =
87 _integration_method.getNumberOfPoints();
88
89 for (unsigned ip = 0; ip < n_integration_points; ip++)
90 {
91 auto& ip_data = _ip_data[ip];
92 auto const& N = ip_data.N;
93 auto const& dNdx = ip_data.dNdx;
94 auto const& w = ip_data.integration_weight;
95
97 std::nullopt, _element.getID(),
100 _element, N))};
101
102 double T_int_pt = 0.0;
104
105 vars.temperature = T_int_pt;
106
107 // for now only using the solid and liquid phase parameters
108 auto const density_s =
110 .template value<double>(vars, pos, t, dt);
111
112 auto const heat_capacity_s =
114 .property(
116 .template value<double>(vars, pos, t, dt);
117
118 auto const density_f =
120 .template value<double>(vars, pos, t, dt);
121
122 auto const heat_capacity_f =
124 .property(
126 .template value<double>(vars, pos, t, dt);
127
128 auto const porosity =
130 .template value<double>(vars, pos, t, dt);
131
132 auto const velocity =
135 .template value<Eigen::Vector3d>(vars, pos, t, dt);
136
137 // calculate the hydrodynamic thermodispersion tensor
138 auto const thermal_conductivity =
140 medium
141 .property(
143 .value(vars, pos, t, dt));
144
146
147 double const velocity_magnitude = velocity.norm();
148
150 {
152 medium
155 .template value<double>();
157 medium
160 .template value<double>();
161
162 auto const thermal_dispersivity =
168 velocity_magnitude * velocity * velocity.transpose());
170 }
171
172 // assemble Conductance matrix
173 local_K.noalias() +=
175 N.transpose() * velocity.transpose() * dNdx * density_f *
177 w;
178
179 // assemble Mass matrix
180 local_M.noalias() += N.transpose() * N * w *
183 }
184
185 if (_process_data._mass_lumping)
186 {
187 // only mass lumping at the BHE connected soil elements
188 if (_process_data.mass_lumping_soil_elements[_element.getID()])
189 {
190 local_M = local_M.colwise().sum().eval().asDiagonal();
191 }
192 }
193
194 // debugging
195 // std::string sep = "\n----------------------------------------\n";
196 // Eigen::IOFormat CleanFmt(4, 0, ", ", "\n", "[", "]");
197 // std::cout << local_K.format(CleanFmt) << sep;
198 // std::cout << local_M.format(CleanFmt) << sep;
199}
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(MaterialPropertyLib::PropertyDataType const &values)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)

References _element, _integration_method, _ip_data, _process_data, MathLib::createZeroedMatrix(), MaterialPropertyLib::density, MaterialPropertyLib::formEigenTensor< 3 >(), NumLib::interpolateCoordinates(), MaterialPropertyLib::phase_velocity, MaterialPropertyLib::porosity, NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::VariableArray::temperature, and MaterialPropertyLib::thermal_conductivity.

Referenced by assembleWithJacobian().

◆ assembleWithJacobian()

template<typename ShapeFunction>
void ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::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 202 of file HeatTransportBHELocalAssemblerSoil-impl.h.

206{
208 auto const local_matrix_size = local_x.size();
209 // initialize x and x_prev
210 auto x =
214 // initialize local_Jac and local_rhs
219
223 local_rhs_data /*not going to be used*/);
224
225 // convert to matrix
230
231 // Jac matrix and rhs vector operation
232 local_Jac.noalias() += local_K + local_M / dt;
233 local_rhs.noalias() -= local_K * x + local_M * (x - x_prev) / dt;
234
235 local_M.setZero();
236 local_K.setZero();
237}
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< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< const Matrix > toMatrix(std::vector< double > const &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)

References assemble(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), and MathLib::toMatrix().

◆ getShapeMatrix()

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

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 68 of file HeatTransportBHELocalAssemblerSoil.h.

70 {
71 auto const& N = _secondary_data.N[integration_point];
72
73 // assumes N is stored contiguously in memory
74 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
75 }

References _secondary_data.

Member Data Documentation

◆ _element

template<typename ShapeFunction>
MeshLib::Element const& ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::_element
private

◆ _integration_method

template<typename ShapeFunction>
NumLib::GenericIntegrationMethod const& ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::_integration_method
private

◆ _ip_data

◆ _process_data

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

◆ _secondary_data

template<typename ShapeFunction>
SecondaryData<typename ShapeMatrices::ShapeType> ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::_secondary_data
private

◆ _shape_matrices

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

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