OGS
ProcessLib::TwoPhaseFlowWithPP Namespace Reference

Classes

struct  IntegrationPointData
 
class  TwoPhaseFlowWithPPLocalAssembler
 
class  TwoPhaseFlowWithPPLocalAssemblerInterface
 
class  TwoPhaseFlowWithPPProcess
 A class to simulate the isothermal two-phase flow process with P-P model in porous media. More...
 
struct  TwoPhaseFlowWithPPProcessData
 

Functions

std::unique_ptr< ProcesscreateTwoPhaseFlowWithPPProcess (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 

Variables

const unsigned NUM_NODAL_DOF = 2
 

Function Documentation

◆ createTwoPhaseFlowWithPPProcess()

std::unique_ptr< Process > ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
unsigned const integration_order,
BaseLib::ConfigTree const & config,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )
Input File Parameter
prj__processes__process__type

Process Variables

Input File Parameter
prj__processes__process__TWOPHASE_FLOW_PP__process_variables

Primary process variables as they appear in the global component vector:

Input File Parameter
prj__processes__process__TWOPHASE_FLOW_PP__process_variables__gas_pressure
Input File Parameter
prj__processes__process__TWOPHASE_FLOW_PP__process_variables__capillary_pressure

Process Parameters

Input File Parameter
prj__processes__process__TWOPHASE_FLOW_PP__specific_body_force
Input File Parameter
prj__processes__process__TWOPHASE_FLOW_PP__mass_lumping
Input File Parameter
prj__processes__process__TWOPHASE_FLOW_PP__temperature

Definition at line 25 of file CreateTwoPhaseFlowWithPPProcess.cpp.

34{
36 config.checkConfigParameter("type", "TWOPHASE_FLOW_PP");
37
39
40 DBUG("Create TwoPhaseFlowProcess with PP model.");
42 auto const pv_config = config.getConfigSubtree("process_variables");
43
45 auto per_process_variables = findProcessVariables(
46 variables, pv_config,
47 {
48 "gas_pressure",
50 "capillary_pressure"});
51 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
52 process_variables;
53 process_variables.push_back(std::move(per_process_variables));
54
55 SecondaryVariableCollection secondary_variables;
56
57 ProcessLib::createSecondaryVariables(config, secondary_variables);
58
60 // Specific body force
61 std::vector<double> const b =
63 config.getConfigParameter<std::vector<double>>("specific_body_force");
64 assert(!b.empty() && b.size() < 4);
65 Eigen::VectorXd specific_body_force(b.size());
66 bool const has_gravity = MathLib::toVector(b).norm() > 0;
67 if (has_gravity)
68 {
69 std::copy_n(b.data(), b.size(), specific_body_force.data());
70 }
71
73 auto const mass_lumping = config.getConfigParameter<bool>("mass_lumping");
74
75 auto const& temperature = ParameterLib::findParameter<double>(
76 config,
78 "temperature", parameters, 1, &mesh);
79
80 auto const material_ids = materialIDs(mesh);
81 if (material_ids)
82 {
83 INFO("The twophase flow is in heterogeneous porous media.");
84 }
85 else
86 {
87 INFO("The twophase flow is in homogeneous porous media.");
88 }
89
90 auto media_map =
92
93 TwoPhaseFlowWithPPProcessData process_data{specific_body_force, has_gravity,
94 mass_lumping, temperature,
95 std::move(media_map)};
96
97 return std::make_unique<TwoPhaseFlowWithPPProcess>(
98 std::move(name), mesh, std::move(jacobian_assembler), parameters,
99 integration_order, std::move(process_variables),
100 std::move(process_data), std::move(secondary_variables));
101}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
Handles configuration of several secondary variables from the project file.
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
Eigen::Map< const Vector > toVector(std::vector< double > const &data, Eigen::VectorXd::Index size)
Creates an Eigen mapped vector from the given data vector.
std::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)

References BaseLib::ConfigTree::checkConfigParameter(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), ProcessLib::createSecondaryVariables(), DBUG(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), INFO(), and MathLib::toVector().

Referenced by ProjectData::parseProcesses().

Variable Documentation

◆ NUM_NODAL_DOF

const unsigned ProcessLib::TwoPhaseFlowWithPP::NUM_NODAL_DOF = 2