OGS
ThermalTwoPhaseFlowWithPPProcess.cpp
Go to the documentation of this file.
1
12
13#include <cassert>
14
21
22namespace ProcessLib
23{
24namespace ThermalTwoPhaseFlowWithPP
25{
27 std::string name,
28 MeshLib::Mesh& mesh,
29 std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler,
30 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
31 unsigned const integration_order,
32 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
33 process_variables,
35 SecondaryVariableCollection&& secondary_variables,
36 std::map<std::string,
37 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
38 /*curves*/)
39 : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
40 integration_order, std::move(process_variables),
41 std::move(secondary_variables)),
42 _process_data(std::move(process_data))
43{
44 DBUG("Create Nonisothermal TwoPhase Flow Process model.");
45}
46
48 NumLib::LocalToGlobalIndexMap const& dof_table,
49 MeshLib::Mesh const& mesh,
50 unsigned const integration_order)
51{
52 ProcessLib::createLocalAssemblers<ThermalTwoPhaseFlowWithPPLocalAssembler>(
53 mesh.getDimension(), mesh.getElements(), dof_table, _local_assemblers,
54 mesh.isAxiallySymmetric(), integration_order, _process_data);
55
57 "saturation",
60 getIntPtSaturation));
61
63 "pressure_wetting",
66 getIntPtWettingPressure));
67
69 "liquid_molar_fraction_contaminant",
72 getIntPtLiquidMolFracContaminant));
73
75 "gas_molar_fraction_water",
78 getIntPtGasMolFracWater));
79
81 "gas_molar_fraction_contaminant",
84 getIntPtGasMolFracContaminant));
85}
86
88 const double t, double const dt, std::vector<GlobalVector*> const& x,
89 std::vector<GlobalVector*> const& xdot, int const process_id,
91{
92 DBUG("Assemble ThermalTwoPhaseFlowWithPPProcess.");
93
94 std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
95 dof_table = {std::ref(*_local_to_global_index_map)};
96 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
97
98 // Call global assembler for each local assembly item.
101 pv.getActiveElementIDs(), dof_table, t, dt, x, xdot, process_id, M, K,
102 b);
103}
104
106 const double t, double const dt, std::vector<GlobalVector*> const& x,
107 std::vector<GlobalVector*> const& xdot, int const process_id,
109{
110 DBUG("AssembleWithJacobian ThermalTwoPhaseFlowWithPPProcess.");
111
112 std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
113 dof_table = {std::ref(*_local_to_global_index_map)};
114 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
115
116 // Call global assembler for each local assembly item.
119 _local_assemblers, pv.getActiveElementIDs(), dof_table, t, dt, x, xdot,
120 process_id, M, K, b, Jac);
121}
123 std::vector<GlobalVector*> const& x, double const t, double const delta_t,
124 const int process_id)
125{
126 DBUG("PreTimestep ThermalTwoPhaseFlowWithPPProcess.");
127
128 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
131 pv.getActiveElementIDs(), *_local_to_global_index_map, *x[process_id],
132 t, delta_t);
133}
134
135} // namespace ThermalTwoPhaseFlowWithPP
136} // namespace ProcessLib
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:29
Definition of the PiecewiseLinearInterpolation class.
Global vector based on Eigen vector.
Definition: EigenVector.h:28
bool isAxiallySymmetric() const
Definition: Mesh.h:131
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition: Mesh.h:103
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:76
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)
std::vector< std::size_t > const & getActiveElementIDs() const
SecondaryVariableCollection _secondary_variables
Definition: Process.h:333
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables(const int process_id) const
Definition: Process.h:146
VectorMatrixAssembler _global_assembler
Definition: Process.h:335
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition: Process.h:331
NumLib::Extrapolator & getExtrapolator() const
Definition: Process.h:182
Handles configuration of several secondary variables from the project file.
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
std::vector< std::unique_ptr< ThermalTwoPhaseFlowWithPPLocalAssemblerInterface > > _local_assemblers
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
void preTimestepConcreteProcess(std::vector< GlobalVector * > const &x, const double t, const double delta_t, const int process_id) override
void assembleConcreteProcess(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) override
void assembleWithJacobianConcreteProcess(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, GlobalMatrix &Jac) override
ThermalTwoPhaseFlowWithPPProcess(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, ThermalTwoPhaseFlowWithPPProcessData &&process_data, SecondaryVariableCollection &&secondary_variables, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap > > const &dof_tables, double const 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 assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap > > const &dof_tables, 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, GlobalMatrix &Jac)
static const double t
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)