OGS
ProcessLib::TwoPhaseFlowWithPP Namespace Reference

Classes

struct  IntegrationPointData
 
class  TwoPhaseFlowWithPPLocalAssemblerInterface
 
class  TwoPhaseFlowWithPPLocalAssembler
 
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 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< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves, 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  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< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &  curves,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &  media 
)
Input File Parameter:
prj__processes__process__type
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_PP__process_variables
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
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.

37 {
39  config.checkConfigParameter("type", "TWOPHASE_FLOW_PP");
40 
41  DBUG("Create TwoPhaseFlowProcess with PP model.");
43  auto const pv_config = config.getConfigSubtree("process_variables");
44 
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  // Specific body force
59  std::vector<double> const b =
61  config.getConfigParameter<std::vector<double>>("specific_body_force");
62  assert(!b.empty() && b.size() < 4);
63  Eigen::VectorXd specific_body_force(b.size());
64  bool const has_gravity = MathLib::toVector(b).norm() > 0;
65  if (has_gravity)
66  {
67  std::copy_n(b.data(), b.size(), specific_body_force.data());
68  }
69 
71  auto const mass_lumping = config.getConfigParameter<bool>("mass_lumping");
72 
73  auto const& temperature = ParameterLib::findParameter<double>(
74  config,
76  "temperature", parameters, 1, &mesh);
77 
78  auto const material_ids = materialIDs(mesh);
79  if (material_ids)
80  {
81  INFO("The twophase flow is in heterogeneous porous media.");
82  }
83  else
84  {
85  INFO("The twophase flow is in homogeneous porous media.");
86  }
87 
88  auto media_map =
90 
91  TwoPhaseFlowWithPPProcessData process_data{specific_body_force, has_gravity,
92  mass_lumping, temperature,
93  std::move(media_map)};
94 
95  return std::make_unique<TwoPhaseFlowWithPPProcess>(
96  std::move(name), mesh, std::move(jacobian_assembler), parameters,
97  integration_order, std::move(process_variables),
98  std::move(process_data), std::move(secondary_variables), curves);
99 }
void INFO(char const *fmt, Args const &... args)
Definition: Logging.h:32
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
std::unique_ptr< 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.
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition: Mesh.cpp:258
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(), MeshLib::materialIDs(), MaterialPropertyLib::name, and MathLib::toVector().

Referenced by ProjectData::parseProcesses().

Variable Documentation

◆ NUM_NODAL_DOF

const unsigned ProcessLib::TwoPhaseFlowWithPP::NUM_NODAL_DOF = 2