OGS
ProcessLib::ThermalTwoPhaseFlowWithPP Namespace Reference

Detailed Description

TODO in this implementation, the thermal properties of gas component directly use the properties of air, e.g. the specific heat capacity of gas component use the specific heat capacity of air, and since a constant specific heat capacity of air is assumed, the enthalpy of air is calculated based on a simplified model. Next, a strategy which can automatically(or from input file)switch between different gas components is required, and should be implemented as a material class, also different enthalpy models for different components are need to be implemented.

Classes

struct  IntegrationPointData
 
class  ThermalTwoPhaseFlowWithPPLocalAssemblerInterface
 
class  ThermalTwoPhaseFlowWithPPLocalAssembler
 
class  ThermalTwoPhaseFlowWithPPMaterialProperties
 
class  ThermalTwoPhaseFlowWithPPProcess
 A class to simulate the nonisothermal two-phase flow process with phase change phenomena between wetting phase and nonwetting phase in porous media. Note that the phase change here can be caused by evaporation, or by condensation, or by dissolution. The phase appearance and vanish are also taken into account. More...
 
struct  ThermalTwoPhaseFlowWithPPProcessData
 

Functions

std::unique_ptr< ThermalTwoPhaseFlowWithPPMaterialPropertiescreateThermalTwoPhaseFlowWithPPMaterialProperties (BaseLib::ConfigTree const &config, MeshLib::PropertyVector< int > const *material_ids, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
std::unique_ptr< ProcesscreateThermalTwoPhaseFlowWithPPProcess (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)
 

Variables

const unsigned NUM_NODAL_DOF = 3
 

Function Documentation

◆ createThermalTwoPhaseFlowWithPPMaterialProperties()

std::unique_ptr< ThermalTwoPhaseFlowWithPPMaterialProperties > ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPMaterialProperties ( BaseLib::ConfigTree const &  config,
MeshLib::PropertyVector< int > const *  material_ids,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters 
)
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__material_property__specific_heat_capacity_solid
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__material_property__specific_heat_capacity_water
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__material_property__specific_heat_capacity_air
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__material_property__specific_heat_capacity_water_vapor
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__material_property__thermal_conductivity_dry_solid
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__material_property__thermal_conductivity_wet_solid

Definition at line 38 of file CreateThermalTwoPhaseFlowWithPPMaterialProperties.cpp.

42 {
43  DBUG(
44  "Reading material properties of nonisothermal two-phase flow process.");
45  auto two_phase_model_tuple =
47  config, material_ids, parameters);
48  auto two_phase_material_model =
49  std::move(std::get<0>(two_phase_model_tuple));
50  auto const& fluid_config = std::get<1>(two_phase_model_tuple);
51 
52  // Get fluid properties
53  auto const& spec_heat_capacity_solid_conf =
55  fluid_config.getConfigSubtree("specific_heat_capacity_solid");
56  auto specific_heat_capacity_solid =
58  spec_heat_capacity_solid_conf);
59  auto const& spec_heat_capacity_water_conf =
61  fluid_config.getConfigSubtree("specific_heat_capacity_water");
62  auto specific_heat_capacity_water =
64  spec_heat_capacity_water_conf);
65  auto const& spec_heat_capacity_air_conf =
67  fluid_config.getConfigSubtree("specific_heat_capacity_air");
68  auto specific_heat_capacity_air =
70  spec_heat_capacity_air_conf);
71  auto const& spec_heat_capacity_vapor_conf =
73  fluid_config.getConfigSubtree("specific_heat_capacity_water_vapor");
74  auto specific_heat_capacity_vapor =
76  spec_heat_capacity_vapor_conf);
77 
78  auto const& thermal_conductivity_dry_solid_conf =
80  fluid_config.getConfigSubtree("thermal_conductivity_dry_solid");
81  auto thermal_conductivity_dry_solid =
83  thermal_conductivity_dry_solid_conf);
84  auto const& thermal_conductivity_wet_solid_conf =
86  fluid_config.getConfigSubtree("thermal_conductivity_wet_solid");
87  auto thermal_conductivity_wet_solid =
89  thermal_conductivity_wet_solid_conf);
90 
91  std::unique_ptr<MaterialLib::Fluid::WaterVaporProperties> vapor_property =
92  std::make_unique<MaterialLib::Fluid::WaterVaporProperties>();
93 
94  return std::make_unique<ThermalTwoPhaseFlowWithPPMaterialProperties>(
95  std::move(two_phase_material_model),
96  std::move(specific_heat_capacity_solid),
97  std::move(specific_heat_capacity_water),
98  std::move(specific_heat_capacity_air),
99  std::move(specific_heat_capacity_vapor),
100  std::move(thermal_conductivity_dry_solid),
101  std::move(thermal_conductivity_wet_solid),
102  std::move(vapor_property));
103 }
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
std::unique_ptr< FluidProperty > createSpecificFluidHeatCapacityModel(BaseLib::ConfigTree const &config)
std::unique_ptr< FluidProperty > createFluidThermalConductivityModel(BaseLib::ConfigTree const &config)
std::tuple< std::unique_ptr< TwoPhaseFlowWithPPMaterialProperties >, BaseLib::ConfigTree > createTwoPhaseFlowMaterialProperties(BaseLib::ConfigTree const &config, MeshLib::PropertyVector< int > const *material_ids, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)

References MaterialLib::Fluid::createFluidThermalConductivityModel(), MaterialLib::Fluid::createSpecificFluidHeatCapacityModel(), MaterialLib::TwoPhaseFlowWithPP::createTwoPhaseFlowMaterialProperties(), and DBUG().

Referenced by createThermalTwoPhaseFlowWithPPProcess().

◆ createThermalTwoPhaseFlowWithPPProcess()

std::unique_ptr< Process > ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess ( 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 
)
Input File Parameter:
prj__processes__process__type
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__process_variables
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__temperature
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__specific_body_force
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__mass_lumping
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__diffusion_coeff_component_b
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__diffusion_coeff_component_a
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__density_solid
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__latent_heat_evaporation
Input File Parameter:
prj__processes__process__TWOPHASE_FLOW_THERMAL__material_property

Definition at line 27 of file CreateThermalTwoPhaseFlowWithPPProcess.cpp.

38 {
40  config.checkConfigParameter("type", "THERMAL_TWOPHASE_WITH_PP");
41 
42  DBUG("Create nonisothermal two-phase flow model.");
44  auto const pv_config = config.getConfigSubtree("process_variables");
45 
46  auto per_process_variables = findProcessVariables(
47  variables, pv_config,
48  {
49  "gas_pressure",
51  "capillary_pressure",
53  "temperature"});
54  std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
55  process_variables;
56  process_variables.push_back(std::move(per_process_variables));
57 
58  SecondaryVariableCollection secondary_variables;
59 
60  ProcessLib::createSecondaryVariables(config, secondary_variables);
61  // Specific body force
62  std::vector<double> const b =
64  config.getConfigParameter<std::vector<double>>("specific_body_force");
65  assert(!b.empty() && b.size() < 4);
66  Eigen::VectorXd specific_body_force(b.size());
67  bool const has_gravity = MathLib::toVector(b).norm() > 0;
68  if (has_gravity)
69  {
70  std::copy_n(b.data(), b.size(), specific_body_force.data());
71  }
72 
74  auto mass_lumping = config.getConfigParameter<bool>("mass_lumping");
75  // diffusion coeff
76  auto const& diff_coeff_b = ParameterLib::findParameter<double>(
77  config,
79  "diffusion_coeff_component_b", parameters, 1, &mesh);
80  auto const& diff_coeff_a = ParameterLib::findParameter<double>(
81  config,
83  "diffusion_coeff_component_a", parameters, 1, &mesh);
84 
85  // Parameter for the density of the solid.
86 
87  auto const& density_solid = ParameterLib::findParameter<double>(
88  config,
90  "density_solid", parameters, 1, &mesh);
91  DBUG("Use '{:s}' as density_solid parameter.", density_solid.name);
92 
93  // Parameter for the latent heat of evaporation.
94  auto const& latent_heat_evaporation = ParameterLib::findParameter<double>(
95  config,
97  "latent_heat_evaporation", parameters, 1, &mesh);
98  DBUG("Use '{:s}' as latent_heat_evaporation parameter.",
99  latent_heat_evaporation.name);
100 
102  auto const& mat_config = config.getConfigSubtree("material_property");
103 
104  std::unique_ptr<ThermalTwoPhaseFlowWithPPMaterialProperties> material =
106  mat_config, materialIDs(mesh), parameters);
107 
108  ThermalTwoPhaseFlowWithPPProcessData process_data{specific_body_force,
109  has_gravity,
110  mass_lumping,
111  diff_coeff_b,
112  diff_coeff_a,
113  density_solid,
114  latent_heat_evaporation,
115  std::move(material)};
116 
117  return std::make_unique<ThermalTwoPhaseFlowWithPPProcess>(
118  std::move(name), mesh, std::move(jacobian_assembler), parameters,
119  integration_order, std::move(process_variables),
120  std::move(process_data), std::move(secondary_variables), mat_config,
121  curves);
122 }
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::unique_ptr< ThermalTwoPhaseFlowWithPPMaterialProperties > createThermalTwoPhaseFlowWithPPMaterialProperties(BaseLib::ConfigTree const &config, MeshLib::PropertyVector< int > const *material_ids, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
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(), ProcessLib::createSecondaryVariables(), createThermalTwoPhaseFlowWithPPMaterialProperties(), DBUG(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), MeshLib::materialIDs(), MaterialPropertyLib::name, and MathLib::toVector().

Referenced by ProjectData::parseProcesses().

Variable Documentation

◆ NUM_NODAL_DOF