OGS
ProcessLib::ThermalTwoPhaseFlowWithPP Namespace Reference

Classes

struct  IntegrationPointData
 
class  ThermalTwoPhaseFlowWithPPLocalAssembler
 
class  ThermalTwoPhaseFlowWithPPLocalAssemblerInterface
 
class  ThermalTwoPhaseFlowWithPPProcess
 
struct  ThermalTwoPhaseFlowWithPPProcessData
 

Functions

void checkMPLProperties (std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
std::unique_ptr< ProcesscreateThermalTwoPhaseFlowWithPPProcess (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< 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 = 4
 

Function Documentation

◆ checkMPLProperties()

void ProcessLib::ThermalTwoPhaseFlowWithPP::checkMPLProperties ( std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &  media)

Definition at line 27 of file CreateThermalTwoPhaseFlowWithPPProcess.cpp.

29{
30 std::array const required_property_medium = {
39
40 std::array const required_property_solid_phase = {
43
44 std::array const required_property_liquid_phase = {
48
49 std::array const required_property_gas_phase = {
51
52 std::array const required_property_vapour_component = {
57
58 std::array const required_property_dry_air_component = {
61
62 std::array const required_property_contaminant_vapour_component = {
67
68 std::array const required_property_dissolved_contaminant_component = {
70
71 for (auto const& m : media)
72 {
73 auto const& gas_phase = m.second->phase("Gas");
74 auto const& liquid_phase = m.second->phase("AqueousLiquid");
75 checkRequiredProperties(*m.second, required_property_medium);
76 checkRequiredProperties(gas_phase, required_property_gas_phase);
77 checkRequiredProperties(liquid_phase, required_property_liquid_phase);
78 checkRequiredProperties(m.second->phase("Solid"),
79 required_property_solid_phase);
80
81 // TODO (BM): should use index to identify components (same for impl.h)
82 checkRequiredProperties(gas_phase.component("w"),
83 required_property_vapour_component);
84 checkRequiredProperties(gas_phase.component("a"),
85 required_property_dry_air_component);
86 checkRequiredProperties(gas_phase.component("c"),
87 required_property_contaminant_vapour_component);
89 liquid_phase.component("c"),
90 required_property_dissolved_contaminant_component);
91 }
92}
void checkRequiredProperties(Component const &c, std::span< PropertyType const > const required_properties)
Definition: Component.cpp:60
@ relative_permeability_nonwetting_phase
Definition: PropertyType.h:80
@ longitudinal_dispersivity
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:60
@ transversal_dispersivity
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:110

References MaterialPropertyLib::density, MaterialPropertyLib::henry_coefficient, MaterialPropertyLib::longitudinal_dispersivity, MaterialPropertyLib::molar_mass, MaterialPropertyLib::permeability, MaterialPropertyLib::pore_diffusion, MaterialPropertyLib::porosity, MaterialPropertyLib::relative_permeability, MaterialPropertyLib::relative_permeability_nonwetting_phase, MaterialPropertyLib::saturation, MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::specific_latent_heat, MaterialPropertyLib::transversal_dispersivity, MaterialPropertyLib::vapour_pressure, and MaterialPropertyLib::viscosity.

Referenced by createThermalTwoPhaseFlowWithPPProcess().

◆ createThermalTwoPhaseFlowWithPPProcess()

std::unique_ptr< Process > ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess ( 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< 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

Process Variables

Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__process_variables

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

Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__process_variables__gas_pressure
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__process_variables__capillary_pressure
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__process_variables__total_molar_fraction_contaminant
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__process_variables__temperature

Process Parameters

Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__specific_body_force
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__mass_lumping

Definition at line 94 of file CreateThermalTwoPhaseFlowWithPPProcess.cpp.

106{
108 config.checkConfigParameter("type", "THERMAL_TWOPHASE_WITH_PP");
109
111 DBUG("Create nonisothermal two-phase flow model.");
113 auto const pv_config = config.getConfigSubtree("process_variables");
114
116 auto per_process_variables = findProcessVariables(
117 variables, pv_config,
118 {
119 "gas_pressure",
121 "capillary_pressure",
123 "total_molar_fraction_contaminant",
125 "temperature"});
126 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
127 process_variables;
128 process_variables.push_back(std::move(per_process_variables));
129
130 SecondaryVariableCollection secondary_variables;
131
132 ProcessLib::createSecondaryVariables(config, secondary_variables);
134 // Specific body force
135 std::vector<double> const b =
137 config.getConfigParameter<std::vector<double>>("specific_body_force");
138 assert(!b.empty() && b.size() < 4);
139 Eigen::VectorXd specific_body_force(b.size());
140 bool const has_gravity = MathLib::toVector(b).norm() > 0;
141 if (has_gravity)
142 {
143 std::copy_n(b.data(), b.size(), specific_body_force.data());
144 }
145
147 auto mass_lumping = config.getConfigParameter<bool>("mass_lumping");
148
149 auto media_map =
151
152 DBUG("Check the media properties of ThermalTwoPhaseFlowWithPP process ...");
153 checkMPLProperties(media);
154 DBUG("Media properties verified.");
155
156 ThermalTwoPhaseFlowWithPPProcessData process_data{
157 std::move(media_map), specific_body_force, has_gravity, mass_lumping};
158
159 return std::make_unique<ThermalTwoPhaseFlowWithPPProcess>(
160 std::move(name), mesh, std::move(jacobian_assembler), parameters,
161 integration_order, std::move(process_variables),
162 std::move(process_data), std::move(secondary_variables), curves);
163}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:30
Handles configuration of several secondary variables from the project file.
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.
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(), checkMPLProperties(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), ProcessLib::createSecondaryVariables(), DBUG(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), and MathLib::toVector().

Referenced by ProjectData::parseProcesses().

Variable Documentation

◆ NUM_NODAL_DOF

const unsigned ProcessLib::ThermalTwoPhaseFlowWithPP::NUM_NODAL_DOF = 4