Skip to content
Snippets Groups Projects
Commit c8c88eb1 authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/HT] Unify matrix types.

parent 4b787f3a
No related branches found
No related tags found
Loading
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "NumLib/Fem/ShapeMatrixPolicy.h" #include "NumLib/Fem/ShapeMatrixPolicy.h"
#include "NumLib/Function/Interpolation.h" #include "NumLib/Function/Interpolation.h"
#include "ProcessLib/LocalAssemblerInterface.h" #include "ProcessLib/LocalAssemblerInterface.h"
#include "ProcessLib/LocalAssemblerTraits.h"
#include "ProcessLib/Parameter/Parameter.h" #include "ProcessLib/Parameter/Parameter.h"
#include "ProcessLib/Utils/InitShapeMatrices.h" #include "ProcessLib/Utils/InitShapeMatrices.h"
...@@ -53,11 +52,11 @@ class LocalAssemblerData : public HTLocalAssemblerInterface ...@@ -53,11 +52,11 @@ class LocalAssemblerData : public HTLocalAssemblerInterface
using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>; using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>;
using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices; using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices;
using LocalAssemblerTraits = ProcessLib::LocalAssemblerTraits< using NodalMatrixType = typename ShapeMatricesType::NodalMatrixType;
ShapeMatricesType, ShapeFunction::NPOINTS, NUM_NODAL_DOF, GlobalDim>; using NodalVectorType = typename ShapeMatricesType::NodalVectorType;
using NodalMatrixType = typename LocalAssemblerTraits::LocalMatrix; using NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType;
using NodalVectorType = typename LocalAssemblerTraits::LocalVector;
using GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType; using GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType;
using GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType;
public: public:
LocalAssemblerData(MeshLib::Element const& element, LocalAssemblerData(MeshLib::Element const& element,
...@@ -106,11 +105,9 @@ public: ...@@ -106,11 +105,9 @@ public:
auto const num_nodes = ShapeFunction::NPOINTS; auto const num_nodes = ShapeFunction::NPOINTS;
auto p_nodal_values = auto p_nodal_values =
Eigen::Map<const Eigen::VectorXd>(&local_x[num_nodes], num_nodes); Eigen::Map<const NodalVectorType>(&local_x[num_nodes], num_nodes);
auto const & b = _process_data.specific_body_force.head(GlobalDim); auto const & b = _process_data.specific_body_force.head(GlobalDim);
Eigen::MatrixXd unit_mat(
Eigen::MatrixXd::Identity(GlobalDim, GlobalDim));
MaterialLib::Fluid::FluidProperty::ArrayType vars; MaterialLib::Fluid::FluidProperty::ArrayType vars;
...@@ -179,24 +176,27 @@ public: ...@@ -179,24 +176,27 @@ public:
// Use the viscosity model to compute the viscosity // Use the viscosity model to compute the viscosity
auto const viscosity = auto const viscosity =
_process_data.viscosity_model->getValue(vars); _process_data.viscosity_model->getValue(vars);
Eigen::Matrix<double, GlobalDim, GlobalDim> perm_over_visc = GlobalDimMatrixType perm_over_visc =
intrinsic_permeability / viscosity; intrinsic_permeability / viscosity;
Eigen::Matrix<double, -1, 1, 0, -1, 1> const velocity = GlobalDimVectorType const velocity =
-perm_over_visc * (sm.dNdx * p_nodal_values - density_water_T * b); -perm_over_visc *
(sm.dNdx * p_nodal_values - density_water_T * b);
double const velocity_magnitude = double const velocity_magnitude =
std::sqrt(velocity.transpose() * velocity); std::sqrt(velocity.transpose() * velocity);
Eigen::MatrixXd thermal_dispersivity = GlobalDimMatrixType const& I(
GlobalDimMatrixType::Identity(GlobalDim, GlobalDim));
GlobalDimMatrixType thermal_dispersivity =
fluid_reference_density * specific_heat_capacity_fluid * fluid_reference_density * specific_heat_capacity_fluid *
(thermal_dispersivity_transversal * velocity_magnitude * (thermal_dispersivity_transversal * velocity_magnitude *
unit_mat + I +
(thermal_dispersivity_longitudinal - (thermal_dispersivity_longitudinal -
thermal_dispersivity_transversal) / thermal_dispersivity_transversal) /
velocity_magnitude * velocity * velocity.transpose()); velocity_magnitude * velocity * velocity.transpose());
auto const hydrodynamic_thermodispersion = auto const hydrodynamic_thermodispersion =
thermal_conductivity + thermal_dispersivity; thermal_conductivity * I + thermal_dispersivity;
double const heat_capacity = double const heat_capacity =
density_solid * specific_heat_capacity_solid * (1 - porosity) + density_solid * specific_heat_capacity_solid * (1 - porosity) +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment