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 30 of file CreateWellboreSimulatorProcess.cpp.

33{
34 std::array<MaterialPropertyLib::PropertyType, 0> const
35 required_property_medium{};
36
37 std::array<MaterialPropertyLib::PropertyType, 0> const
38 required_property_solid_phase{};
39
40 std::array const required_property_liquid_phase = {
47
48 std::array const required_property_gas_phase = {
53
55 mesh, media_map, required_property_medium,
56 required_property_solid_phase, required_property_liquid_phase,
57 required_property_gas_phase);
58}
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 20 of file ReservoirProperties.cpp.

23{
24 auto const& temperature = ParameterLib::findParameter<double>(
26 config.getConfigParameter<std::string>("temperature"),
27 parameters,
28 1,
29 nullptr);
30
31 auto const& thermal_conductivity = ParameterLib::findParameter<double>(
33 config.getConfigParameter<std::string>("thermal_conductivity"),
34 parameters,
35 1,
36 nullptr);
37
38 auto const& density = ParameterLib::findParameter<double>(
40 config.getConfigParameter<std::string>("density"),
41 parameters,
42 1,
43 nullptr);
44
45 auto const& specific_heat_capacity = ParameterLib::findParameter<double>(
47 config.getConfigParameter<std::string>("specific_heat_capacity"),
48 parameters,
49 1,
50 nullptr);
51
52 auto const& pressure = ParameterLib::findParameter<double>(
54 config.getConfigParameter<std::string>("pressure"),
55 parameters,
56 1,
57 nullptr);
58
59 return {temperature, thermal_conductivity, density, specific_heat_capacity,
60 pressure};
61}

References 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 22 of file WellboreGeometry.cpp.

25{
26 double const length =
28 config.getConfigParameter<double>("length");
29
30 auto const& diameter = ParameterLib::findParameter<double>(
32 config.getConfigParameter<std::string>("diameter"),
33 parameters,
34 1,
35 nullptr);
36
37 auto const& casing_thickness = ParameterLib::findParameter<double>(
39 config.getConfigParameter<std::string>("casing_thickness"),
40 parameters,
41 1,
42 nullptr);
43
44 auto const& pipe_thickness = ParameterLib::findParameter<double>(
46 config.getConfigParameter<std::string>("pipe_thickness"),
47 parameters,
48 1,
49 nullptr);
50
51 auto const& roughness = ParameterLib::findParameter<double>(
53 config.getConfigParameter<std::string>("roughness"),
54 parameters,
55 1,
56 nullptr);
57
58 return {length, diameter, casing_thickness, pipe_thickness, roughness};
59}

References 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 60 of file CreateWellboreSimulatorProcess.cpp.

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