OGS
HeatTransportBHEProcess.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
10#include "ProcessLib/Process.h"
11
12namespace ProcessLib
13{
14namespace HeatTransportBHE
15{
16struct BHEMeshData;
17
19 : public Process,
20 private AssemblyMixin<HeatTransportBHEProcess>
21{
23
24public:
26 std::string name,
27 MeshLib::Mesh& mesh,
28 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&&
29 jacobian_assembler,
30 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const&
31 parameters,
32 unsigned const integration_order,
33 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
34 process_variables,
35 HeatTransportBHEProcessData&& process_data,
36 SecondaryVariableCollection&& secondary_variables,
37 BHEMeshData&& bhe_mesh_data);
38
41 bool isLinear() const override
42 {
43 // Linear Solver is called only once - valid only with
44 // _use_algebraic_bc and _is_linear
45 return _process_data._algebraic_BC_Setting._use_algebraic_bc &&
46 _process_data._is_linear;
47 }
48
49 bool requiresNormalization() const override
50 {
51 // In the current setup, when using algebraic bc,
52 // then normalization is always required
53 return _process_data._algebraic_BC_Setting._use_algebraic_bc;
54 }
55
56
57 void computeSecondaryVariableConcrete(double const t, double const dt,
58 std::vector<GlobalVector*> const& x,
59 GlobalVector const& x_prev,
60 int const process_id) override;
61
62private:
63 void constructDofTable() override;
64
66 NumLib::LocalToGlobalIndexMap const& dof_table,
67 MeshLib::Mesh const& mesh,
68 unsigned const integration_order) override;
69
70 std::vector<std::vector<std::string>> initializeAssemblyOnSubmeshes(
71 std::vector<std::reference_wrapper<MeshLib::Mesh>> const& meshes)
72 override;
73
74 void assembleConcreteProcess(const double t, double const dt,
75 std::vector<GlobalVector*> const& x,
76 std::vector<GlobalVector*> const& x_prev,
77 int const process_id, GlobalMatrix& M,
78 GlobalMatrix& K, GlobalVector& b) override;
79
81 const double t, double const dt, std::vector<GlobalVector*> const& x,
82 std::vector<GlobalVector*> const& x_prev, int const process_id,
83 GlobalVector& b, GlobalMatrix& Jac) override;
84
86 std::vector<std::vector<MeshLib::Node*>> const& all_bhe_nodes);
87 void preTimestepConcreteProcess(std::vector<GlobalVector*> const& x,
88 const double t, const double dt,
89 int const process_id) override;
90
91 void postTimestepConcreteProcess(std::vector<GlobalVector*> const& x,
92 std::vector<GlobalVector*> const& x_prev,
93 const double t, const double dt,
94 int const process_id) override;
95
96 void algebraicBcConcreteProcess(const double t, double const dt,
97 std::vector<GlobalVector*> const& x,
98 std::vector<GlobalVector*> const& xdot,
99 int const process_id, GlobalMatrix& M,
101
103 GlobalVector const& x) override;
104
106
107 std::vector<std::unique_ptr<HeatTransportBHELocalAssemblerInterface>>
109
110 std::vector<std::unique_ptr<MeshLib::MeshSubset const>>
112
113 std::vector<std::unique_ptr<MeshLib::MeshSubset const>>
115 // a vector of tuple structure containing the indices of BHE top nodes,
116 // used only for algebraic boundary conditions
117 // first object is the index of BHE
118 // second and third object is the global indices of a pair of unknowns,
119 // pointing to the inflow and outflow temperature
120 std::vector<std::tuple<std::size_t, GlobalIndexType, GlobalIndexType>>
122 // a vector of tuple structure containing the indices of BHE bottom nodes,
123 // used only for algebraic boundary conditions
124 // same structure as the top node vector
125 std::vector<std::tuple<std::size_t, GlobalIndexType, GlobalIndexType>>
127
128 std::unique_ptr<MeshLib::MeshSubset const> _mesh_subset_soil_nodes;
129
131
132 std::vector<std::size_t> _bhes_element_ids;
133
134 std::vector<std::size_t> _soil_element_ids;
135};
136} // namespace HeatTransportBHE
137} // namespace ProcessLib
MathLib::EigenMatrix GlobalMatrix
MathLib::EigenVector GlobalVector
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_soil_nodes
void assembleConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) override
std::vector< std::unique_ptr< MeshLib::MeshSubset const > > _mesh_subset_BHE_nodes
std::vector< std::tuple< std::size_t, GlobalIndexType, GlobalIndexType > > _vec_bottom_BHE_node_indices
std::vector< std::vector< std::string > > initializeAssemblyOnSubmeshes(std::vector< std::reference_wrapper< MeshLib::Mesh > > const &meshes) override
void computeSecondaryVariableConcrete(double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id) override
HeatTransportBHEProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, HeatTransportBHEProcessData &&process_data, SecondaryVariableCollection &&secondary_variables, BHEMeshData &&bhe_mesh_data)
NumLib::IterationResult postIterationConcreteProcess(GlobalVector const &x) override
std::vector< std::unique_ptr< HeatTransportBHELocalAssemblerInterface > > local_assemblers_
std::vector< std::unique_ptr< MeshLib::MeshSubset const > > _mesh_subset_BHE_soil_nodes
void preTimestepConcreteProcess(std::vector< GlobalVector * > const &x, const double t, const double dt, int const process_id) override
std::vector< std::tuple< std::size_t, GlobalIndexType, GlobalIndexType > > _vec_top_BHE_node_indices
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
void algebraicBcConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)
void assembleWithJacobianConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector &b, GlobalMatrix &Jac) override
void postTimestepConcreteProcess(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, const double dt, int const process_id) override
void createBHEBoundaryConditionTopBottom(std::vector< std::vector< MeshLib::Node * > > const &all_bhe_nodes)
std::string const name
Definition Process.h:361
Process(std::string name_, MeshLib::Mesh &mesh, std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
Definition Process.cpp:37
Handles configuration of several secondary variables from the project file.
IterationResult
Status flags telling the NonlinearSolver if an iteration succeeded.