OGS
ProcessLib::HT Namespace Reference

Classes

class  HTFEM
 
struct  IntegrationPointData
 
class  HTLocalAssemblerInterface
 
class  HTProcess
 
struct  HTProcessData
 
class  MonolithicHTFEM
 
class  StaggeredHTFEM
 

Functions

void checkMPLProperties (MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map)
 
std::unique_ptr< ProcesscreateHTProcess (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::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
 

Variables

const unsigned NUM_NODAL_DOF = 2
 

Function Documentation

◆ checkMPLProperties()

void ProcessLib::HT::checkMPLProperties ( MeshLib::Mesh const &  mesh,
MaterialPropertyLib::MaterialSpatialDistributionMap const &  media_map 
)

Definition at line 29 of file CreateHTProcess.cpp.

32 {
33  std::array const required_property_medium = {
39 
40  std::array const required_property_liquid_phase = {
45 
46  std::array const required_property_solid_phase = {
51 
53  mesh, media_map, required_property_medium,
54  required_property_solid_phase, required_property_liquid_phase);
55 }
void checkMaterialSpatialDistributionMap(MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map, ContainerMedium const &required_properties_medium, ContainerSolid const &required_properties_solid_phase, ContainerLiquid const &required_properties_liquid_phase)

References MaterialPropertyLib::checkMaterialSpatialDistributionMap(), MaterialPropertyLib::density, MaterialPropertyLib::permeability, MaterialPropertyLib::porosity, MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::storage, MaterialPropertyLib::thermal_conductivity, MaterialPropertyLib::thermal_longitudinal_dispersivity, MaterialPropertyLib::thermal_transversal_dispersivity, and MaterialPropertyLib::viscosity.

Referenced by createHTProcess().

◆ createHTProcess()

std::unique_ptr< Process > ProcessLib::HT::createHTProcess ( 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::vector< std::unique_ptr< MeshLib::Mesh >> const &  meshes,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &  media 
)
Input File Parameter:
prj__processes__process__type
Input File Parameter:
prj__processes__process__HT__coupling_scheme
Input File Parameter:
prj__processes__process__HT__process_variables
Input File Parameter:
prj__processes__process__HT__process_variables__temperature
Input File Parameter:
prj__processes__process__HT__process_variables__pressure
Input File Parameter:
prj__processes__process__HT__specific_body_force
Input File Parameter:
prj__processes__process__HT__solid_thermal_expansion
Input File Parameter:
prj__processes__process__HT__solid_thermal_expansion__thermal_expansion
Input File Parameter:
prj__processes__process__HT__solid_thermal_expansion__biot_constant
Input File Parameter:
prj__processes__process__calculatesurfaceflux

Definition at line 57 of file CreateHTProcess.cpp.

67 {
69  config.checkConfigParameter("type", "HT");
70 
71  DBUG("Create HTProcess.");
72 
73  auto const coupling_scheme =
75  config.getConfigParameterOptional<std::string>("coupling_scheme");
76  const bool use_monolithic_scheme =
77  !(coupling_scheme && (*coupling_scheme == "staggered"));
78 
79  // Process variable.
80 
82  auto const pv_config = config.getConfigSubtree("process_variables");
83 
84  // Process IDs, which are set according to the appearance order of the
85  // process variables.
86  int const heat_transport_process_id = 0;
87  int hydraulic_process_id = 0;
88 
89  std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
90  process_variables;
91  if (use_monolithic_scheme) // monolithic scheme.
92  {
93  auto per_process_variables = findProcessVariables(
94  variables, pv_config,
95  {
96  "temperature",
98  "pressure"});
99  process_variables.push_back(std::move(per_process_variables));
100  }
101  else // staggered scheme.
102  {
103  using namespace std::string_literals;
104  for (auto const& variable_name : {"temperature"s, "pressure"s})
105  {
106  auto per_process_variables =
107  findProcessVariables(variables, pv_config, {variable_name});
108  process_variables.push_back(std::move(per_process_variables));
109  }
110  hydraulic_process_id = 1;
111  }
112 
113  // Specific body force parameter.
114  Eigen::VectorXd specific_body_force;
115  std::vector<double> const b =
117  config.getConfigParameter<std::vector<double>>("specific_body_force");
118  assert(!b.empty() && b.size() < 4);
119  if (b.size() < mesh.getDimension())
120  {
121  OGS_FATAL(
122  "specific body force (gravity vector) has {:d} components, mesh "
123  "dimension is {:d}",
124  b.size(), mesh.getDimension());
125  }
126  bool const has_gravity = MathLib::toVector(b).norm() > 0;
127  if (has_gravity)
128  {
129  specific_body_force.resize(b.size());
130  std::copy_n(b.data(), b.size(), specific_body_force.data());
131  }
132 
133  ParameterLib::ConstantParameter<double> default_solid_thermal_expansion(
134  "default solid thermal expansion", 0.);
135  ParameterLib::ConstantParameter<double> default_biot_constant(
136  "default_biot constant", 0.);
137  ParameterLib::Parameter<double>* solid_thermal_expansion =
138  &default_solid_thermal_expansion;
139  ParameterLib::Parameter<double>* biot_constant = &default_biot_constant;
140 
141  auto const solid_config =
143  config.getConfigSubtreeOptional("solid_thermal_expansion");
144  const bool has_fluid_thermal_expansion = static_cast<bool>(solid_config);
145  if (solid_config)
146  {
147  solid_thermal_expansion = &ParameterLib::findParameter<double>(
149  *solid_config, "thermal_expansion", parameters, 1, &mesh);
150  DBUG("Use '{:s}' as solid thermal expansion.",
151  solid_thermal_expansion->name);
152  biot_constant = &ParameterLib::findParameter<double>(
154  *solid_config, "biot_constant", parameters, 1, &mesh);
155  DBUG("Use '{:s}' as Biot's constant.", biot_constant->name);
156  }
157 
158  std::unique_ptr<ProcessLib::SurfaceFluxData> surfaceflux;
159  auto calculatesurfaceflux_config =
161  config.getConfigSubtreeOptional("calculatesurfaceflux");
162  if (calculatesurfaceflux_config)
163  {
165  *calculatesurfaceflux_config, meshes);
166  }
167 
168  auto media_map =
170 
171  DBUG("Check the media properties of HT process ...");
172  checkMPLProperties(mesh, *media_map);
173  DBUG("Media properties verified.");
174 
175  HTProcessData process_data{
176  std::move(media_map), has_fluid_thermal_expansion,
177  *solid_thermal_expansion, *biot_constant,
178  specific_body_force, has_gravity,
179  heat_transport_process_id, hydraulic_process_id};
180 
181  SecondaryVariableCollection secondary_variables;
182 
183  ProcessLib::createSecondaryVariables(config, secondary_variables);
184 
185  return std::make_unique<HTProcess>(
186  std::move(name), mesh, std::move(jacobian_assembler), parameters,
187  integration_order, std::move(process_variables),
188  std::move(process_data), std::move(secondary_variables),
189  use_monolithic_scheme, std::move(surfaceflux));
190 }
#define OGS_FATAL(...)
Definition: Error.h:26
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:71
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.
void checkMPLProperties(MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map)
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)
Single, constant value parameter.
std::string const name
Definition: Parameter.h:72
static std::unique_ptr< ProcessLib::SurfaceFluxData > createSurfaceFluxData(BaseLib::ConfigTree const &calculatesurfaceflux_config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes)

References BaseLib::ConfigTree::checkConfigParameter(), checkMPLProperties(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), ProcessLib::createSecondaryVariables(), ProcessLib::SurfaceFluxData::createSurfaceFluxData(), DBUG(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeOptional(), MeshLib::Mesh::getDimension(), MaterialPropertyLib::name, ParameterLib::ParameterBase::name, OGS_FATAL, and MathLib::toVector().

Referenced by ProjectData::parseProcesses().

Variable Documentation

◆ NUM_NODAL_DOF

const unsigned ProcessLib::HT::NUM_NODAL_DOF = 2