OGS
ProcessLib::WellboreSimulator Namespace Reference

Classes

struct  IntegrationPointData
struct  ReservoirProperties
struct  WellboreGeometry
class  WellboreSimulatorFEM
class  WellboreSimulatorLocalAssemblerInterface
class  WellboreSimulatorProcess
struct  WellboreSimulatorProcessData

Functions

void checkMPLProperties (MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map)
std::unique_ptr< ProcesscreateWellboreSimulatorProcess (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< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
ReservoirProperties createReservoirProperties (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
WellboreGeometry createWellboreGeometry (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)

Variables

const unsigned NUM_NODAL_DOF = 3

Function Documentation

◆ checkMPLProperties()

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

Definition at line 23 of file CreateWellboreSimulatorProcess.cpp.

26{
27 std::array<MaterialPropertyLib::PropertyType, 0> const
28 required_property_medium{};
29
30 std::array<MaterialPropertyLib::PropertyType, 0> const
31 required_property_solid_phase{};
32
33 std::array const required_property_liquid_phase = {
40
41 std::array const required_property_gas_phase = {
46
48 mesh, media_map, required_property_medium,
49 required_property_solid_phase, required_property_liquid_phase,
50 required_property_gas_phase);
51}
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::enthalpy, MaterialPropertyLib::saturation_density, MaterialPropertyLib::saturation_enthalpy, MaterialPropertyLib::saturation_temperature, MaterialPropertyLib::temperature, and MaterialPropertyLib::viscosity.

Referenced by createWellboreSimulatorProcess().

◆ createReservoirProperties()

ReservoirProperties ProcessLib::WellboreSimulator::createReservoirProperties ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__reservoir_properties__temperature
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__reservoir_properties__thermal_conductivity
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__reservoir_properties__density
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__reservoir_properties__specific_heat_capacity
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__reservoir_properties__pressure

Definition at line 13 of file ReservoirProperties.cpp.

16{
17 auto const& temperature = ParameterLib::findParameter<double>(
19 config.getConfigParameter<std::string>("temperature"),
20 parameters,
21 1,
22 nullptr);
23
24 auto const& thermal_conductivity = ParameterLib::findParameter<double>(
26 config.getConfigParameter<std::string>("thermal_conductivity"),
27 parameters,
28 1,
29 nullptr);
30
31 auto const& density = ParameterLib::findParameter<double>(
33 config.getConfigParameter<std::string>("density"),
34 parameters,
35 1,
36 nullptr);
37
38 auto const& specific_heat_capacity = ParameterLib::findParameter<double>(
40 config.getConfigParameter<std::string>("specific_heat_capacity"),
41 parameters,
42 1,
43 nullptr);
44
45 auto const& pressure = ParameterLib::findParameter<double>(
47 config.getConfigParameter<std::string>("pressure"),
48 parameters,
49 1,
50 nullptr);
51
52 return {temperature, thermal_conductivity, density, specific_heat_capacity,
53 pressure};
54}
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)

References ParameterLib::findParameter(), and BaseLib::ConfigTree::getConfigParameter().

Referenced by createWellboreSimulatorProcess().

◆ createWellboreGeometry()

WellboreGeometry ProcessLib::WellboreSimulator::createWellboreGeometry ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__wellbore__length
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__wellbore__diameter
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__wellbore__casing_thickness
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__wellbore__pipe_thickness
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__wellbore__roughness

Definition at line 15 of file WellboreGeometry.cpp.

18{
19 double const length =
21 config.getConfigParameter<double>("length");
22
23 auto const& diameter = ParameterLib::findParameter<double>(
25 config.getConfigParameter<std::string>("diameter"),
26 parameters,
27 1,
28 nullptr);
29
30 auto const& casing_thickness = ParameterLib::findParameter<double>(
32 config.getConfigParameter<std::string>("casing_thickness"),
33 parameters,
34 1,
35 nullptr);
36
37 auto const& pipe_thickness = ParameterLib::findParameter<double>(
39 config.getConfigParameter<std::string>("pipe_thickness"),
40 parameters,
41 1,
42 nullptr);
43
44 auto const& roughness = ParameterLib::findParameter<double>(
46 config.getConfigParameter<std::string>("roughness"),
47 parameters,
48 1,
49 nullptr);
50
51 return {length, diameter, casing_thickness, pipe_thickness, roughness};
52}

References ParameterLib::findParameter(), and BaseLib::ConfigTree::getConfigParameter().

Referenced by createWellboreSimulatorProcess().

◆ createWellboreSimulatorProcess()

std::unique_ptr< Process > ProcessLib::WellboreSimulator::createWellboreSimulatorProcess ( 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< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )
Input File Parameter
prj__processes__process__type
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__process_variables
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__process_variables__pressure
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__process_variables__velocity
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__process_variables__enthalpy
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__specific_body_force
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__wellbore
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__wellbore_ref_pressure
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__wellbore_ref_enthalpy
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__heat_exchange_with_formation
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__reservoir_properties
Input File Parameter
prj__processes__process__WELLBORE_SIMULATOR__productivity_index

Definition at line 53 of file CreateWellboreSimulatorProcess.cpp.

62{
64 config.checkConfigParameter("type", "WELLBORE_SIMULATOR");
65
66 DBUG("Create WellboreSimulatorProcess.");
67
68 // Process variable.
69
71 auto const pv_config = config.getConfigSubtree("process_variables");
72
73 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
74 process_variables;
75
76 auto collected_process_variables = findProcessVariables(
77 variables, pv_config,
78 {
79 "pressure",
81 "velocity",
83 "specific_enthalpy"});
84
85 process_variables.push_back(std::move(collected_process_variables));
86
87 // Specific body force parameter.
88 Eigen::VectorXd specific_body_force;
89 std::vector<double> const b =
91 config.getConfigParameter<std::vector<double>>("specific_body_force");
92 assert(!b.empty() && b.size() < 4);
93 if (b.size() < mesh.getDimension())
94 {
96 "specific body force (gravity vector) has %d components, mesh "
97 "dimension is %d",
98 b.size(), mesh.getDimension());
99 }
100 bool const has_gravity = MathLib::toVector(b).norm() > 0;
101 if (has_gravity)
102 {
103 specific_body_force.resize(b.size());
104 std::copy_n(b.data(), b.size(), specific_body_force.data());
105 }
106
107 WellboreGeometry const wellbore_geometry =
109 createWellboreGeometry(config.getConfigSubtree("wellbore"), parameters);
110
111 auto const& well_ref_pressure = ParameterLib::findParameter<double>(
112 config,
114 "wellbore_ref_pressure", parameters, 1, &mesh);
115 DBUG("Use '{:s}' as wellbore_ref_pressure parameter.",
116 well_ref_pressure.name);
117
118 auto const& well_ref_enthalpy = ParameterLib::findParameter<double>(
119 config,
121 "wellbore_ref_enthalpy", parameters, 1, &mesh);
122 DBUG("Use '{:s}' as wellbore_ref_enthalpy parameter.",
123 well_ref_enthalpy.name);
124
125 auto const heat_exchange_with_formation =
127 config.getConfigParameter<bool>("heat_exchange_with_formation", false);
128
129 ReservoirProperties const reservoir_properties = createReservoirProperties(
131 config.getConfigSubtree("reservoir_properties"), parameters);
132
133 auto const& productivity_index = ParameterLib::findParameter<double>(
134 config,
136 "productivity_index", parameters, 1, &mesh);
137 DBUG("Use '{:s}' as productivity_index parameter.",
138 productivity_index.name);
139
140 auto media_map =
142
143 DBUG("Check the media properties of WellboreSimulator process ...");
144 checkMPLProperties(mesh, media_map);
145 DBUG("Media properties verified.");
146
147 WellboreSimulatorProcessData process_data{std::move(media_map),
148 specific_body_force,
149 std::move(wellbore_geometry),
150 well_ref_pressure,
151 well_ref_enthalpy,
152 std::move(reservoir_properties),
153 productivity_index,
154 heat_exchange_with_formation,
155 has_gravity};
156
157 SecondaryVariableCollection secondary_variables;
158
159 ProcessLib::createSecondaryVariables(config, secondary_variables);
160
161 return std::make_unique<WellboreSimulatorProcess>(
162 std::move(name), mesh, std::move(jacobian_assembler), parameters,
163 integration_order, std::move(process_variables),
164 std::move(process_data), std::move(secondary_variables));
165}
#define OGS_FATAL(...)
Definition Error.h:19
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:79
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)
ReservoirProperties createReservoirProperties(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
WellboreGeometry createWellboreGeometry(BaseLib::ConfigTree const &config, 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(), checkMPLProperties(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), createReservoirProperties(), ProcessLib::createSecondaryVariables(), createWellboreGeometry(), DBUG(), ParameterLib::findParameter(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), MeshLib::Mesh::getDimension(), OGS_FATAL, and MathLib::toVector().

Referenced by ProjectData::parseProcesses().

Variable Documentation

◆ NUM_NODAL_DOF

const unsigned ProcessLib::WellboreSimulator::NUM_NODAL_DOF = 3