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 25 of file CreateHTProcess.cpp.

28{
29 std::array const required_property_medium = {
35
36 std::array const required_property_liquid_phase = {
41
42 std::array const required_property_solid_phase = {
47
48 std::array<MaterialPropertyLib::PropertyType, 0> const
49 required_gas_properties{};
50
52 mesh, media_map, required_property_medium,
53 required_property_solid_phase, required_property_liquid_phase,
54 required_gas_properties);
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, 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 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
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 {
95 auto per_process_variables = findProcessVariables(
96 variables, pv_config,
97 {
98 "temperature",
100 "pressure"});
101 process_variables.push_back(std::move(per_process_variables));
102 }
103 else // staggered scheme.
104 {
105 using namespace std::string_literals;
106 for (auto const& variable_name : {"temperature"s, "pressure"s})
107 {
108 auto per_process_variables =
109 findProcessVariables(variables, pv_config, {variable_name});
110 process_variables.push_back(std::move(per_process_variables));
111 }
112 hydraulic_process_id = 1;
113 }
114
116 std::vector<double> const b =
118 config.getConfigParameter<std::vector<double>>("specific_body_force");
119 assert(!b.empty() && b.size() < 4);
120 int const mesh_space_dimension =
122 if (static_cast<int>(b.size()) != mesh_space_dimension)
123 {
124 OGS_FATAL(
125 "specific body force (gravity vector) has {:d} components, mesh "
126 "dimension is {:d}",
127 b.size(), mesh_space_dimension);
128 }
129
130 // Specific body force parameter.
131 Eigen::VectorXd specific_body_force(b.size());
132 bool const has_gravity = MathLib::toVector(b).norm() > 0;
133 if (has_gravity)
134 {
135 std::copy_n(b.data(), b.size(), specific_body_force.data());
136 }
137
138 ParameterLib::ConstantParameter<double> default_solid_thermal_expansion(
139 "default solid thermal expansion", 0.);
140 ParameterLib::ConstantParameter<double> default_biot_constant(
141 "default_biot constant", 0.);
142 ParameterLib::Parameter<double>* solid_thermal_expansion =
143 &default_solid_thermal_expansion;
144 ParameterLib::Parameter<double>* biot_constant = &default_biot_constant;
145
146 auto const solid_config =
148 config.getConfigSubtreeOptional("solid_thermal_expansion");
149 const bool has_fluid_thermal_expansion = static_cast<bool>(solid_config);
150 if (solid_config)
151 {
152 solid_thermal_expansion = &ParameterLib::findParameter<double>(
154 *solid_config, "thermal_expansion", parameters, 1, &mesh);
155 DBUG("Use '{:s}' as solid thermal expansion.",
156 solid_thermal_expansion->name);
159 *solid_config, "biot_constant", parameters, 1, &mesh);
160 DBUG("Use '{:s}' as Biot's constant.", biot_constant->name);
161 }
162
163 std::unique_ptr<ProcessLib::SurfaceFluxData> surfaceflux;
164 auto calculatesurfaceflux_config =
166 config.getConfigSubtreeOptional("calculatesurfaceflux");
167 if (calculatesurfaceflux_config)
168 {
170 *calculatesurfaceflux_config, meshes);
171 }
172
173 auto media_map =
175
176 DBUG("Check the media properties of HT process ...");
177 checkMPLProperties(mesh, media_map);
178 DBUG("Media properties verified.");
179
180 auto stabilizer = NumLib::createNumericalStabilization(mesh, config);
181
182 auto const* aperture_size_parameter = &ParameterLib::findParameter<double>(
184 auto const aperture_config =
186 config.getConfigSubtreeOptional("aperture_size");
187 if (aperture_config)
188 {
189 aperture_size_parameter = &ParameterLib::findParameter<double>(
191 *aperture_config, "parameter", parameters, 1);
192 }
193
194 auto const rotation_matrices = MeshLib::getElementRotationMatrices(
195 mesh_space_dimension, mesh.getDimension(), mesh.getElements());
196 std::vector<Eigen::VectorXd> projected_specific_body_force_vectors;
197 projected_specific_body_force_vectors.reserve(rotation_matrices.size());
198
199 std::transform(rotation_matrices.begin(), rotation_matrices.end(),
200 std::back_inserter(projected_specific_body_force_vectors),
201 [&specific_body_force](const auto& R)
202 { return R * R.transpose() * specific_body_force; });
203
204 HTProcessData process_data{std::move(media_map),
205 has_fluid_thermal_expansion,
206 *solid_thermal_expansion,
207 *biot_constant,
208 has_gravity,
209 heat_transport_process_id,
210 hydraulic_process_id,
211 std::move(stabilizer),
212 projected_specific_body_force_vectors,
213 mesh_space_dimension,
214 *aperture_size_parameter,
215 NumLib::ShapeMatrixCache{integration_order}};
216
217 SecondaryVariableCollection secondary_variables;
218
219 ProcessLib::createSecondaryVariables(config, secondary_variables);
220
221 return std::make_unique<HTProcess>(
222 std::move(name), mesh, std::move(jacobian_assembler), parameters,
223 integration_order, std::move(process_variables),
224 std::move(process_data), std::move(secondary_variables),
225 use_monolithic_scheme, std::move(surfaceflux));
226}
#define OGS_FATAL(...)
Definition Error.h:19
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:97
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:100
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:79
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition Process.h:40
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)
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)
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