OGS
ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim > Class Template Reference

Detailed Description

template<typename ShapeFunction, typename IntegrationMethod, int GlobalDim>
class ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >

Definition at line 67 of file LiquidFlowLocalAssembler.h.

#include <LiquidFlowLocalAssembler.h>

Inheritance diagram for ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >:
[legend]
Collaboration diagram for ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >:
[legend]

Classes

struct  AnisotropicCalculator
 
struct  IsotropicCalculator
 

Public Member Functions

 LiquidFlowLocalAssembler (MeshLib::Element const &element, std::size_t const, bool const is_axially_symmetric, unsigned const integration_order, LiquidFlowData 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
 
Eigen::Vector3d getFlux (MathLib::Point3d const &p_local_coords, double const t, std::vector< double > const &local_x) const override
 
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const override
 Provides the shape matrix at the given integration point. More...
 
std::vector< double > const & getIntPtDarcyVelocity (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &velocity_cache) const override
 
- 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< std::vector< double >> const &) const
 Fits to staggered scheme. More...
 
- Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default
 

Private Types

using ShapeMatricesType = ShapeMatrixPolicyType< ShapeFunction >
 
using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
 
using LocalAssemblerTraits = ProcessLib::LocalAssemblerTraits< ShapeMatricesType, ShapeFunction::NPOINTS, NUM_NODAL_DOF, ShapeFunction::DIM >
 
using NodalMatrixType = typename LocalAssemblerTraits::LocalMatrix
 
using NodalVectorType = typename LocalAssemblerTraits::LocalVector
 
using NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType
 
using DimVectorType = typename ShapeMatricesType::DimVectorType
 
using DimMatrixType = typename ShapeMatricesType::DimMatrixType
 
using GlobalDimNodalMatrixType = typename ShapeMatricesType::GlobalDimNodalMatrixType
 

Private Member Functions

template<typename LaplacianGravityVelocityCalculator >
void assembleMatrixAndVector (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
 
template<typename LaplacianGravityVelocityCalculator , typename VelocityCacheType >
void computeProjectedDarcyVelocity (const double t, const double dt, std::vector< double > const &local_x, ParameterLib::SpatialPosition const &pos, VelocityCacheType &darcy_velocity_at_ips) const
 
template<typename VelocityCacheType >
void computeDarcyVelocity (bool const is_scalar_permeability, const double t, const double dt, std::vector< double > const &local_x, ParameterLib::SpatialPosition const &pos, VelocityCacheType &darcy_velocity_at_ips) const
 

Private Attributes

MeshLib::Element const & _element
 
IntegrationMethod const _integration_method
 
std::vector< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType >, Eigen::aligned_allocator< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType > > > _ip_data
 
const LiquidFlowData_process_data
 

Member Typedef Documentation

◆ DimMatrixType

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
using ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::DimMatrixType = typename ShapeMatricesType::DimMatrixType
private

Definition at line 81 of file LiquidFlowLocalAssembler.h.

◆ DimVectorType

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
using ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::DimVectorType = typename ShapeMatricesType::DimVectorType
private

Definition at line 80 of file LiquidFlowLocalAssembler.h.

◆ GlobalDimNodalMatrixType

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
using ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::GlobalDimNodalMatrixType = typename ShapeMatricesType::GlobalDimNodalMatrixType
private

Definition at line 82 of file LiquidFlowLocalAssembler.h.

◆ LocalAssemblerTraits

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
using ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::LocalAssemblerTraits = ProcessLib::LocalAssemblerTraits<ShapeMatricesType, ShapeFunction::NPOINTS, NUM_NODAL_DOF, ShapeFunction::DIM>
private

Definition at line 72 of file LiquidFlowLocalAssembler.h.

◆ NodalMatrixType

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
using ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::NodalMatrixType = typename LocalAssemblerTraits::LocalMatrix
private

Definition at line 77 of file LiquidFlowLocalAssembler.h.

◆ NodalRowVectorType

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
using ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType
private

Definition at line 79 of file LiquidFlowLocalAssembler.h.

◆ NodalVectorType

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
using ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::NodalVectorType = typename LocalAssemblerTraits::LocalVector
private

Definition at line 78 of file LiquidFlowLocalAssembler.h.

◆ ShapeMatrices

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
using ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
private

Definition at line 70 of file LiquidFlowLocalAssembler.h.

◆ ShapeMatricesType

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
using ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction>
private

Definition at line 69 of file LiquidFlowLocalAssembler.h.

Constructor & Destructor Documentation

◆ LiquidFlowLocalAssembler()

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::LiquidFlowLocalAssembler ( MeshLib::Element const &  element,
std::size_t const  ,
bool const  is_axially_symmetric,
unsigned const  integration_order,
LiquidFlowData const &  process_data 
)
inline

Definition at line 86 of file LiquidFlowLocalAssembler.h.

91  : _element(element),
92  _integration_method(integration_order),
93  _process_data(process_data)
94  {
95  unsigned const n_integration_points =
96  _integration_method.getNumberOfPoints();
97  _ip_data.reserve(n_integration_points);
98 
99  auto const& shape_matrices =
101  GlobalDim>(element, is_axially_symmetric,
103 
104  for (unsigned ip = 0; ip < n_integration_points; ip++)
105  {
106  _ip_data.emplace_back(
107  shape_matrices[ip].N, shape_matrices[ip].dNdx,
108  _integration_method.getWeightedPoint(ip).getWeight() *
109  shape_matrices[ip].integralMeasure *
110  shape_matrices[ip].detJ);
111  }
112  }
std::vector< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType >, Eigen::aligned_allocator< IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType > > > _ip_data
ShapeMatrixPolicyType< ShapeFunction > ShapeMatricesType
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 ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_integration_method, ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_ip_data, and NumLib::initShapeMatrices().

Member Function Documentation

◆ assemble()

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
void ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, 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 
)
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 26 of file LiquidFlowLocalAssembler-impl.h.

33 {
36 
37  auto const& medium = *_process_data.media_map->getMedium(_element.getID());
39  vars[static_cast<int>(MaterialPropertyLib::Variable::temperature)] =
41  .template value<double>(vars, pos, t, dt);
42  vars[static_cast<int>(MaterialPropertyLib::Variable::phase_pressure)] =
43  std::numeric_limits<double>::quiet_NaN();
45  MaterialPropertyLib::formEigenTensor<ShapeFunction::DIM>(
47  vars, pos, t, dt));
48  // Note: For Inclined 1D in 2D/3D or 2D element in 3D, the first item in
49  // the assert must be changed to permeability.rows() ==
50  // _element->getDimension()
51  assert(permeability.rows() == ShapeFunction::DIM ||
52  permeability.rows() == 1);
53 
54  if (permeability.size() == 1)
55  { // isotropic or 1D problem.
56  assembleMatrixAndVector<IsotropicCalculator>(
57  t, dt, local_x, local_M_data, local_K_data, local_b_data);
58  }
59  else
60  {
61  assembleMatrixAndVector<AnisotropicCalculator>(
62  t, dt, local_x, local_M_data, local_K_data, local_b_data);
63  }
64 }
virtual std::size_t getID() const final
Returns the ID of the element.
Definition: Element.h:82
void setElementID(std::size_t element_id)
typename ShapeMatricesType::DimMatrixType DimMatrixType
std::array< VariableType, static_cast< int >(Variable::number_of_variables)> VariableArray
Definition: VariableType.h:108
std::unique_ptr< MaterialPropertyLib::MaterialSpatialDistributionMap > media_map

References MaterialPropertyLib::permeability, MaterialPropertyLib::phase_pressure, MaterialPropertyLib::reference_temperature, ParameterLib::SpatialPosition::setElementID(), and MaterialPropertyLib::temperature.

◆ assembleMatrixAndVector()

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
template<typename LaplacianGravityVelocityCalculator >
void ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assembleMatrixAndVector ( double const  t,
double const  dt,
std::vector< double > const &  local_x,
std::vector< double > &  local_M_data,
std::vector< double > &  local_K_data,
std::vector< double > &  local_b_data 
)
private

Definition at line 121 of file LiquidFlowLocalAssembler-impl.h.

127 {
128  auto const local_matrix_size = local_x.size();
129  assert(local_matrix_size == ShapeFunction::NPOINTS);
130 
131  auto local_M = MathLib::createZeroedMatrix<NodalMatrixType>(
132  local_M_data, local_matrix_size, local_matrix_size);
133  auto local_K = MathLib::createZeroedMatrix<NodalMatrixType>(
134  local_K_data, local_matrix_size, local_matrix_size);
135  auto local_b = MathLib::createZeroedVector<NodalVectorType>(
136  local_b_data, local_matrix_size);
137 
138  unsigned const n_integration_points =
139  _integration_method.getNumberOfPoints();
140 
142  pos.setElementID(_element.getID());
143 
144  auto const& medium = *_process_data.media_map->getMedium(_element.getID());
145  auto const& liquid_phase = medium.phase("AqueousLiquid");
146 
148  vars[static_cast<int>(MaterialPropertyLib::Variable::temperature)] =
150  .template value<double>(vars, pos, t, dt);
151 
152  DimVectorType const projected_body_force_vector =
155 
156  for (unsigned ip = 0; ip < n_integration_points; ip++)
157  {
158  auto const& ip_data = _ip_data[ip];
159 
160  double p = 0.;
161  NumLib::shapeFunctionInterpolate(local_x, ip_data.N, p);
162  vars[static_cast<int>(MaterialPropertyLib::Variable::phase_pressure)] =
163  p;
164 
165  // Compute density:
166  auto const fluid_density =
168  .template value<double>(vars, pos, t, dt);
169  assert(fluid_density > 0.);
170  auto const ddensity_dpressure =
172  .template dValue<double>(
174  dt);
175 
176  auto const porosity =
178  .template value<double>(vars, pos, t, dt);
180  .template value<double>(vars, pos, t, dt);
181 
182  // Assemble mass matrix, M
183  local_M.noalias() +=
184  (porosity * ddensity_dpressure / fluid_density + storage) *
185  ip_data.N.transpose() * ip_data.N * ip_data.integration_weight;
186 
187  // Compute viscosity:
188  auto const viscosity =
190  .template value<double>(vars, pos, t, dt);
191 
192  pos.setIntegrationPoint(ip);
194  MaterialPropertyLib::formEigenTensor<ShapeFunction::DIM>(
196  vars, pos, t, dt));
197 
198  // Assemble Laplacian, K, and RHS by the gravitational term
199  LaplacianGravityVelocityCalculator::calculateLaplacianAndGravityTerm(
200  local_K, local_b, ip_data, permeability, viscosity, fluid_density,
201  projected_body_force_vector, _process_data.has_gravity);
202  }
203 }
void setIntegrationPoint(unsigned integration_point)
typename ShapeMatricesType::DimVectorType DimVectorType
void shapeFunctionInterpolate(const NodalValues &nodal_values, const ShapeMatrix &shape_matrix_N, double &interpolated_value, ScalarTypes &... interpolated_values)
Definition: Interpolation.h:79
double fluid_density(const double p, const double T, const double x)
std::vector< Eigen::MatrixXd > const element_rotation_matrices
A vector of the rotation matrices for all elements.
Eigen::VectorXd const specific_body_force

References MaterialPropertyLib::density, ProcessLib::TES::fluid_density(), MaterialPropertyLib::permeability, MaterialPropertyLib::phase_pressure, MaterialPropertyLib::porosity, MaterialPropertyLib::reference_temperature, ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), NumLib::shapeFunctionInterpolate(), MaterialPropertyLib::storage, MaterialPropertyLib::temperature, and MaterialPropertyLib::viscosity.

◆ computeDarcyVelocity()

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
template<typename VelocityCacheType >
void ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::computeDarcyVelocity ( bool const  is_scalar_permeability,
const double  t,
const double  dt,
std::vector< double > const &  local_x,
ParameterLib::SpatialPosition const &  pos,
VelocityCacheType &  darcy_velocity_at_ips 
) const
private

Definition at line 207 of file LiquidFlowLocalAssembler-impl.h.

212 {
213  if (is_scalar_permeability)
214  { // isotropic or 1D problem.
215  computeProjectedDarcyVelocity<IsotropicCalculator>(
216  t, dt, local_x, pos, darcy_velocity_at_ips);
217  }
218  else
219  {
220  computeProjectedDarcyVelocity<AnisotropicCalculator>(
221  t, dt, local_x, pos, darcy_velocity_at_ips);
222  }
223 }

◆ computeProjectedDarcyVelocity()

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
template<typename LaplacianGravityVelocityCalculator , typename VelocityCacheType >
void ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::computeProjectedDarcyVelocity ( const double  t,
const double  dt,
std::vector< double > const &  local_x,
ParameterLib::SpatialPosition const &  pos,
VelocityCacheType &  darcy_velocity_at_ips 
) const
private

Definition at line 279 of file LiquidFlowLocalAssembler-impl.h.

284 {
285  auto const local_matrix_size = local_x.size();
286  assert(local_matrix_size == ShapeFunction::NPOINTS);
287 
288  const auto local_p_vec =
289  MathLib::toVector<NodalVectorType>(local_x, local_matrix_size);
290 
291  unsigned const n_integration_points =
292  _integration_method.getNumberOfPoints();
293 
294  auto const& medium = *_process_data.media_map->getMedium(_element.getID());
295  auto const& liquid_phase = medium.phase("AqueousLiquid");
296 
298  vars[static_cast<int>(MaterialPropertyLib::Variable::temperature)] =
300  .template value<double>(vars, pos, t, dt);
301 
302  DimVectorType const projected_body_force_vector =
305 
306  for (unsigned ip = 0; ip < n_integration_points; ip++)
307  {
308  auto const& ip_data = _ip_data[ip];
309  double p = 0.;
310  NumLib::shapeFunctionInterpolate(local_x, ip_data.N, p);
311  vars[static_cast<int>(MaterialPropertyLib::Variable::phase_pressure)] =
312  p;
313 
314  // Compute density:
315  auto const fluid_density =
317  .template value<double>(vars, pos, t, dt);
318  // Compute viscosity:
319  auto const viscosity =
321  .template value<double>(vars, pos, t, dt);
322 
324  MaterialPropertyLib::formEigenTensor<ShapeFunction::DIM>(
326  vars, pos, t, dt));
327 
328  Eigen::VectorXd const velocity_at_ip =
329  LaplacianGravityVelocityCalculator::calculateVelocity(
330  local_p_vec, ip_data, permeability, viscosity, fluid_density,
331  projected_body_force_vector, _process_data.has_gravity);
332 
333  Eigen::MatrixXd const& rotation_matrix =
335  darcy_velocity_at_ips.col(ip) = rotation_matrix * velocity_at_ip;
336  }
337 }

References MaterialPropertyLib::density, ProcessLib::TES::fluid_density(), MaterialPropertyLib::permeability, MaterialPropertyLib::phase_pressure, MaterialPropertyLib::reference_temperature, NumLib::shapeFunctionInterpolate(), MaterialPropertyLib::temperature, and MaterialPropertyLib::viscosity.

◆ getFlux()

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
Eigen::Vector3d ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux ( MathLib::Point3d const &  p_local_coords,
double const  t,
std::vector< double > const &  local_x 
) const
overridevirtual

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

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 68 of file LiquidFlowLocalAssembler-impl.h.

71 {
72  // TODO (tf) Temporary value not used by current material models. Need
73  // extension of getFlux interface
74  double const dt = std::numeric_limits<double>::quiet_NaN();
75 
76  // Note: Axial symmetry is set to false here, because we only need dNdx
77  // here, which is not affected by axial symmetry.
78  auto const shape_matrices =
80  ShapeFunction::DIM>(
81  _element,
82  false /*is_axially_symmetric*/,
83  std::array{p_local_coords})[0];
84 
85  // create pos object to access the correct media property
88 
89  auto const& medium = *_process_data.media_map->getMedium(_element.getID());
90  auto const& liquid_phase = medium.phase("AqueousLiquid");
91 
93 
94  double pressure = 0.0;
95  NumLib::shapeFunctionInterpolate(local_x, shape_matrices.N, pressure);
96  vars[static_cast<int>(MaterialPropertyLib::Variable::phase_pressure)] =
97  pressure;
98 
99  DimMatrixType const intrinsic_permeability =
100  MaterialPropertyLib::formEigenTensor<ShapeFunction::DIM>(
102  vars, pos, t, dt));
103  auto const viscosity =
105  .template value<double>(vars, pos, t, dt);
106 
107  Eigen::Vector3d flux(0.0, 0.0, 0.0);
108  auto const flux_local =
109  (-intrinsic_permeability / viscosity * shape_matrices.dNdx *
110  Eigen::Map<const NodalVectorType>(local_x.data(), local_x.size()))
111  .eval();
112 
113  flux.head<GlobalDim>() =
115 
116  return flux;
117 }
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > computeShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, PointContainer const &points)

References NumLib::computeShapeMatrices(), MaterialPropertyLib::permeability, MaterialPropertyLib::phase_pressure, ParameterLib::SpatialPosition::setElementID(), NumLib::shapeFunctionInterpolate(), and MaterialPropertyLib::viscosity.

◆ getIntPtDarcyVelocity()

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
std::vector< double > const & ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity ( const double  t,
std::vector< GlobalVector * > const &  x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const &  dof_table,
std::vector< double > &  velocity_cache 
) const
overridevirtual

Implements ProcessLib::LiquidFlow::LiquidFlowLocalAssemblerInterface.

Definition at line 227 of file LiquidFlowLocalAssembler-impl.h.

233 {
234  // TODO (tf) Temporary value not used by current material models. Need
235  // extension of secondary variable interface.
236  double const dt = std::numeric_limits<double>::quiet_NaN();
237 
238  constexpr int process_id = 0;
239  auto const indices =
240  NumLib::getIndices(_element.getID(), *dof_table[process_id]);
241  auto const local_x = x[process_id]->get(indices);
242  auto const n_integration_points = _integration_method.getNumberOfPoints();
243  velocity_cache.clear();
244 
246  pos.setElementID(_element.getID());
247 
248  auto const& medium = *_process_data.media_map->getMedium(_element.getID());
250  vars[static_cast<int>(MaterialPropertyLib::Variable::temperature)] =
252  .template value<double>(vars, pos, t, dt);
253  vars[static_cast<int>(MaterialPropertyLib::Variable::phase_pressure)] =
254  std::numeric_limits<double>::quiet_NaN();
255 
257  MaterialPropertyLib::formEigenTensor<ShapeFunction::DIM>(
259  vars, pos, t, dt));
260 
261  assert(permeability.rows() == _element.getDimension() ||
262  permeability.rows() == 1);
263 
264  bool const is_scalar_permeability = (permeability.size() == 1);
265 
266  auto velocity_cache_vectors = MathLib::createZeroedMatrix<
267  Eigen::Matrix<double, GlobalDim, Eigen::Dynamic, Eigen::RowMajor>>(
268  velocity_cache, GlobalDim, n_integration_points);
269 
270  computeDarcyVelocity(is_scalar_permeability, t, dt, local_x, pos,
271  velocity_cache_vectors);
272 
273  return velocity_cache;
274 }
virtual constexpr unsigned getDimension() const =0
Get dimension of the mesh element.
void computeDarcyVelocity(bool const is_scalar_permeability, const double t, const double dt, std::vector< double > const &local_x, ParameterLib::SpatialPosition const &pos, VelocityCacheType &darcy_velocity_at_ips) const
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
Definition: EigenMapTools.h:32
std::vector< GlobalIndexType > getIndices(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)

References MathLib::createZeroedMatrix(), NumLib::getIndices(), MaterialPropertyLib::permeability, MaterialPropertyLib::phase_pressure, MaterialPropertyLib::reference_temperature, ParameterLib::SpatialPosition::setElementID(), and MaterialPropertyLib::temperature.

◆ getShapeMatrix()

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

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 127 of file LiquidFlowLocalAssembler.h.

129  {
130  auto const& N = _ip_data[integration_point].N;
131 
132  // assumes N is stored contiguously in memory
133  return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
134  }

References ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_ip_data.

Member Data Documentation

◆ _element

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
MeshLib::Element const& ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_element
private

Definition at line 143 of file LiquidFlowLocalAssembler.h.

◆ _integration_method

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
IntegrationMethod const ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_integration_method
private

◆ _ip_data

◆ _process_data

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
const LiquidFlowData& ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_process_data
private

Definition at line 221 of file LiquidFlowLocalAssembler.h.


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