OGS
ProcessLib::HT Namespace Reference

Classes

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

Functions

void checkMPLProperties (MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map)
 
std::unique_ptr< ProcesscreateHTProcess (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::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 32 of file CreateHTProcess.cpp.

35{
36 std::array const required_property_medium = {
42
43 std::array const required_property_liquid_phase = {
48
49 std::array const required_property_solid_phase = {
54
55 std::array<MaterialPropertyLib::PropertyType, 0> const
56 required_gas_properties{};
57
59 mesh, media_map, required_property_medium,
60 required_property_solid_phase, required_property_liquid_phase,
61 required_gas_properties);
62}
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, ContainerGas const &required_properties_gas_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 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::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

Process Variables

Input File Parameter
prj__processes__process__HT__process_variables

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

Input File Parameter
prj__processes__process__HT__process_variables__temperature
Input File Parameter
prj__processes__process__HT__process_variables__pressure

Process Parameters

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
Input File Parameter
prj__processes__process__HT__aperture_size
Input File Parameter
prj__processes__process__HT__aperture_size__parameter

Definition at line 64 of file CreateHTProcess.cpp.

74{
76 config.checkConfigParameter("type", "HT");
77
78 DBUG("Create HTProcess.");
79
80 auto const coupling_scheme =
82 config.getConfigParameterOptional<std::string>("coupling_scheme");
83 const bool use_monolithic_scheme =
84 !(coupling_scheme && (*coupling_scheme == "staggered"));
85
87
89 auto const pv_config = config.getConfigSubtree("process_variables");
90
91 // Process IDs, which are set according to the appearance order of the
92 // process variables.
93 int const heat_transport_process_id = 0;
94 int hydraulic_process_id = 0;
95
96 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
97 process_variables;
98 if (use_monolithic_scheme) // monolithic scheme.
99 {
102 auto per_process_variables = findProcessVariables(
103 variables, pv_config,
104 {
105 "temperature",
107 "pressure"});
108 process_variables.push_back(std::move(per_process_variables));
109 }
110 else // staggered scheme.
111 {
112 using namespace std::string_literals;
113 for (auto const& variable_name : {"temperature"s, "pressure"s})
114 {
115 auto per_process_variables =
116 findProcessVariables(variables, pv_config, {variable_name});
117 process_variables.push_back(std::move(per_process_variables));
118 }
119 hydraulic_process_id = 1;
120 }
121
123 std::vector<double> const b =
125 config.getConfigParameter<std::vector<double>>("specific_body_force");
126 assert(!b.empty() && b.size() < 4);
127 int const mesh_space_dimension =
129 if (static_cast<int>(b.size()) != mesh_space_dimension)
130 {
131 OGS_FATAL(
132 "specific body force (gravity vector) has {:d} components, mesh "
133 "dimension is {:d}",
134 b.size(), mesh_space_dimension);
135 }
136
137 // Specific body force parameter.
138 Eigen::VectorXd specific_body_force(b.size());
139 bool const has_gravity = MathLib::toVector(b).norm() > 0;
140 if (has_gravity)
141 {
142 std::copy_n(b.data(), b.size(), specific_body_force.data());
143 }
144
145 ParameterLib::ConstantParameter<double> default_solid_thermal_expansion(
146 "default solid thermal expansion", 0.);
147 ParameterLib::ConstantParameter<double> default_biot_constant(
148 "default_biot constant", 0.);
149 ParameterLib::Parameter<double>* solid_thermal_expansion =
150 &default_solid_thermal_expansion;
151 ParameterLib::Parameter<double>* biot_constant = &default_biot_constant;
152
153 auto const solid_config =
155 config.getConfigSubtreeOptional("solid_thermal_expansion");
156 const bool has_fluid_thermal_expansion = static_cast<bool>(solid_config);
157 if (solid_config)
158 {
159 solid_thermal_expansion = &ParameterLib::findParameter<double>(
161 *solid_config, "thermal_expansion", parameters, 1, &mesh);
162 DBUG("Use '{:s}' as solid thermal expansion.",
163 solid_thermal_expansion->name);
166 *solid_config, "biot_constant", parameters, 1, &mesh);
167 DBUG("Use '{:s}' as Biot's constant.", biot_constant->name);
168 }
169
170 std::unique_ptr<ProcessLib::SurfaceFluxData> surfaceflux;
171 auto calculatesurfaceflux_config =
173 config.getConfigSubtreeOptional("calculatesurfaceflux");
174 if (calculatesurfaceflux_config)
175 {
177 *calculatesurfaceflux_config, meshes);
178 }
179
180 auto media_map =
182
183 DBUG("Check the media properties of HT process ...");
184 checkMPLProperties(mesh, media_map);
185 DBUG("Media properties verified.");
186
187 auto stabilizer = NumLib::createNumericalStabilization(mesh, config);
188
189 auto const* aperture_size_parameter = &ParameterLib::findParameter<double>(
191 auto const aperture_config =
193 config.getConfigSubtreeOptional("aperture_size");
194 if (aperture_config)
195 {
196 aperture_size_parameter = &ParameterLib::findParameter<double>(
198 *aperture_config, "parameter", parameters, 1);
199 }
200
201 auto const rotation_matrices = MeshLib::getElementRotationMatrices(
202 mesh_space_dimension, mesh.getDimension(), mesh.getElements());
203 std::vector<Eigen::VectorXd> projected_specific_body_force_vectors;
204 projected_specific_body_force_vectors.reserve(rotation_matrices.size());
205
206 std::transform(rotation_matrices.begin(), rotation_matrices.end(),
207 std::back_inserter(projected_specific_body_force_vectors),
208 [&specific_body_force](const auto& R)
209 { return R * R.transpose() * specific_body_force; });
210
211 HTProcessData process_data{std::move(media_map),
212 has_fluid_thermal_expansion,
213 *solid_thermal_expansion,
214 *biot_constant,
215 has_gravity,
216 heat_transport_process_id,
217 hydraulic_process_id,
218 std::move(stabilizer),
219 projected_specific_body_force_vectors,
220 mesh_space_dimension,
221 *aperture_size_parameter,
222 NumLib::ShapeMatrixCache{integration_order}};
223
224 SecondaryVariableCollection secondary_variables;
225
226 ProcessLib::createSecondaryVariables(config, secondary_variables);
227
228 return std::make_unique<HTProcess>(
229 std::move(name), mesh, std::move(jacobian_assembler), parameters,
230 integration_order, std::move(process_variables),
231 std::move(process_data), std::move(secondary_variables),
232 use_monolithic_scheme, std::move(surfaceflux));
233}
#define OGS_FATAL(...)
Definition Error.h:26
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:106
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:109
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:88
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition Process.h:47
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< Eigen::MatrixXd > getElementRotationMatrices(int const space_dimension, int const mesh_dimension, std::vector< Element * > const &elements)
Element rotation matrix computation.
int getSpaceDimension(std::vector< Node * > const &nodes)
Computes dimension of the embedding space containing the set of given points.
NumericalStabilization createNumericalStabilization(MeshLib::Mesh const &mesh, BaseLib::ConfigTree const &config)
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const &parameter_name, std::vector< std::unique_ptr< ParameterBase > > const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
Definition Utils.h:102
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:73
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(), ProcessLib::Process::constant_one_parameter_name, MaterialPropertyLib::createMaterialSpatialDistributionMap(), NumLib::createNumericalStabilization(), ProcessLib::createSecondaryVariables(), ProcessLib::SurfaceFluxData::createSurfaceFluxData(), DBUG(), ParameterLib::findParameter(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeOptional(), MeshLib::Mesh::getDimension(), MeshLib::getElementRotationMatrices(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getNodes(), MeshLib::getSpaceDimension(), 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