/** * \file * \copyright * Copyright (c) 2012-2022, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. * See accompanying file LICENSE.txt or * http://www.opengeosys.org/project/license * */ #pragma once #include "LocalAssemblerInterface.h" #include "ProcessLib/Process.h" #include "ThermoHydroMechanicsProcessData.h" namespace ProcessLib { namespace ThermoHydroMechanics { struct LocalAssemblerInterface; /// Thermally induced deformation process in linear kinematics /// poro-mechanical/biphasic model. /// /// The mixture momentum balance, the mixture mass balance and the mixture /// energy balance are solved under fully saturated conditions. template class ThermoHydroMechanicsProcess final : public Process { public: ThermoHydroMechanicsProcess( std::string name, MeshLib::Mesh& mesh, std::unique_ptr&& jacobian_assembler, std::vector> const& parameters, unsigned const integration_order, std::vector>>&& process_variables, ThermoHydroMechanicsProcessData&& process_data, SecondaryVariableCollection&& secondary_variables, bool const use_monolithic_scheme); //! \name ODESystem interface //! @{ bool isLinear() const override; //! @} /** * Get the size and the sparse pattern of the global matrix in order to * create the global matrices and vectors for the system equations of this * process. * * @param process_id Process ID. If the monolithic scheme is applied, * process_id = 0. For the staggered scheme, * process_id = 0 represents the * hydraulic (H) process, while process_id = 1 * represents the mechanical (M) process. * @return Matrix specifications including size and sparse pattern. */ MathLib::MatrixSpecifications getMatrixSpecifications( const int process_id) const override; private: void constructDofTable() override; void initializeConcreteProcess( NumLib::LocalToGlobalIndexMap const& dof_table, MeshLib::Mesh const& mesh, unsigned const integration_order) override; void initializeBoundaryConditions() override; void assembleConcreteProcess(const double t, double const dt, std::vector const& x, std::vector const& xdot, int const process_id, GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b) override; void assembleWithJacobianConcreteProcess( const double t, double const dt, std::vector const& x, std::vector const& xdot, int const process_id, GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b, GlobalMatrix& Jac) override; void preTimestepConcreteProcess(std::vector const& x, double const t, double const dt, const int process_id) override; void postTimestepConcreteProcess(std::vector const& x, const double t, const double dt, int const process_id) override; void postNonLinearSolverConcreteProcess(GlobalVector const& x, GlobalVector const& xdot, const double t, double const dt, int const process_id) override; NumLib::LocalToGlobalIndexMap const& getDOFTable( const int process_id) const override; private: std::vector _base_nodes; std::unique_ptr _mesh_subset_base_nodes; ThermoHydroMechanicsProcessData _process_data; std::vector> _local_assemblers; std::unique_ptr _local_to_global_index_map_single_component; /// Local to global index mapping for base nodes, which is used for linear /// interpolation for pressure in the staggered scheme. std::unique_ptr _local_to_global_index_map_with_base_nodes; /// Sparsity pattern for the flow equation, and it is initialized only if /// the staggered scheme is used. GlobalSparsityPattern _sparsity_pattern_with_linear_element; void computeSecondaryVariableConcrete(double const t, double const dt, std::vector const& x, GlobalVector const& x_dot, const int process_id) override; /** * @copydoc ProcessLib::Process::getDOFTableForExtrapolatorData() */ std::tuple getDOFTableForExtrapolatorData() const override; /// Check whether the process represented by \c process_id is/has /// mechanical process. In the present implementation, the mechanical /// process has process_id == 1 in the staggered scheme. bool hasMechanicalProcess(int const process_id) const { return _use_monolithic_scheme || process_id == 2; } MeshLib::PropertyVector* _nodal_forces = nullptr; MeshLib::PropertyVector* _hydraulic_flow = nullptr; MeshLib::PropertyVector* _heat_flux = nullptr; }; extern template class ThermoHydroMechanicsProcess<2>; extern template class ThermoHydroMechanicsProcess<3>; } // namespace ThermoHydroMechanics } // namespace ProcessLib