diff --git a/ProcessLib/HT/CreateHTProcess.cpp b/ProcessLib/HT/CreateHTProcess.cpp index 8c421c21434e24eac6ca26b5785f2dc6f10b1f80..ca665c136bea98c4cd6982489c60c1d229f6c7f4 100644 --- a/ProcessLib/HT/CreateHTProcess.cpp +++ b/ProcessLib/HT/CreateHTProcess.cpp @@ -75,6 +75,10 @@ std::unique_ptr<Process> createHTProcess( process_variables.push_back(std::move(per_process_variables)); } } + // Process IDs, which are set according to the appearance order of the + // process variables. + const int _heat_transport_process_id = 0; + const int _hydraulic_process_id = 1; MaterialLib::PorousMedium::PorousMediaProperties porous_media_properties{ MaterialLib::PorousMedium::createPorousMediaProperties(mesh, config, @@ -239,7 +243,8 @@ std::unique_ptr<Process> createHTProcess( mesh, std::move(jacobian_assembler), parameters, integration_order, std::move(process_variables), std::move(material_properties), std::move(secondary_variables), std::move(named_function_caller), - use_monolithic_scheme, std::move(surfaceflux)); + use_monolithic_scheme, std::move(surfaceflux), + _heat_transport_process_id, _hydraulic_process_id); } } // namespace HT diff --git a/ProcessLib/HT/HTProcess.cpp b/ProcessLib/HT/HTProcess.cpp index 2e22402088e6402a0663b8d8239844d74950dc76..0de70fb4e80a9f62a87a8a7f2fd0543d8f015429 100644 --- a/ProcessLib/HT/HTProcess.cpp +++ b/ProcessLib/HT/HTProcess.cpp @@ -35,13 +35,17 @@ HTProcess::HTProcess( SecondaryVariableCollection&& secondary_variables, NumLib::NamedFunctionCaller&& named_function_caller, bool const use_monolithic_scheme, - std::unique_ptr<ProcessLib::SurfaceFluxData>&& surfaceflux) + std::unique_ptr<ProcessLib::SurfaceFluxData>&& surfaceflux, + const int heat_transport_process_id, + const int hydraulic_process_id) : Process(mesh, std::move(jacobian_assembler), parameters, integration_order, std::move(process_variables), std::move(secondary_variables), std::move(named_function_caller), use_monolithic_scheme), _material_properties(std::move(material_properties)), - _surfaceflux(std::move(surfaceflux)) + _surfaceflux(std::move(surfaceflux)), + _heat_transport_process_id(heat_transport_process_id), + _hydraulic_process_id(hydraulic_process_id) { } @@ -67,14 +71,11 @@ void HTProcess::initializeConcreteProcess( } else { - const int heat_transport_process_id = 0; - const int hydraulic_process_id = 1; - ProcessLib::createLocalAssemblers<StaggeredHTFEM>( mesh.getDimension(), mesh.getElements(), dof_table, pv.getShapeFunctionOrder(), _local_assemblers, mesh.isAxiallySymmetric(), integration_order, *_material_properties, - heat_transport_process_id, hydraulic_process_id); + _heat_transport_process_id, _hydraulic_process_id); } _secondary_variables.addSecondaryVariable( @@ -99,7 +100,7 @@ void HTProcess::assembleConcreteProcess(const double t, } else { - if (_coupled_solutions->process_id == 0) + if (_coupled_solutions->process_id == _heat_transport_process_id) { DBUG( "Assemble the equations of heat transport process within " @@ -259,7 +260,7 @@ Eigen::Vector3d HTProcess::getFlux(std::size_t element_id, return _local_assemblers[element_id]->getFlux(p, t, local_x); } -// this is almost a copy of the implemention in the GroundwaterFlow +// this is almost a copy of the implementation in the GroundwaterFlow void HTProcess::postTimestepConcreteProcess(GlobalVector const& x, const double t, const double /*delta_t*/, @@ -272,7 +273,7 @@ void HTProcess::postTimestepConcreteProcess(GlobalVector const& x, "The condition of process_id = 0 must be satisfied for " "monolithic HTProcess, which is a single process."); } - if (!_use_monolithic_scheme && process_id != 1) + if (!_use_monolithic_scheme && process_id != _hydraulic_process_id) { DBUG("This is the thermal part of the staggered HTProcess."); return; diff --git a/ProcessLib/HT/HTProcess.h b/ProcessLib/HT/HTProcess.h index 7b5a93a70578a220e50b585a5230b4aaf7aba24b..1c1d06b1e6d09200f372215e75f632a27445767c 100644 --- a/ProcessLib/HT/HTProcess.h +++ b/ProcessLib/HT/HTProcess.h @@ -61,8 +61,9 @@ public: SecondaryVariableCollection&& secondary_variables, NumLib::NamedFunctionCaller&& named_function_caller, bool const use_monolithic_scheme, - std::unique_ptr<ProcessLib::SurfaceFluxData>&& surfaceflux); - + std::unique_ptr<ProcessLib::SurfaceFluxData>&& surfaceflux, + const int heat_transport_process_id, + const int hydraulic_process_id); //! \name ODESystem interface //! @{ @@ -118,6 +119,9 @@ private: std::array<std::unique_ptr<GlobalVector>, 2> _xs_previous_timestep; std::unique_ptr<ProcessLib::SurfaceFluxData> _surfaceflux; + + const int _heat_transport_process_id; + const int _hydraulic_process_id; }; } // namespace HT