Skip to content

Commit

Permalink
Merge branch 'Wellbore_Simulator' into 'master'
Browse files Browse the repository at this point in the history
Add the WellboreSimulator process

See merge request ogs/ogs!4481
  • Loading branch information
bilke committed Sep 4, 2024
2 parents 66e0c38 + 84a0536 commit 2d4c090
Show file tree
Hide file tree
Showing 53 changed files with 2,842 additions and 2 deletions.
21 changes: 21 additions & 0 deletions Applications/ApplicationsLib/ProjectData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
#include "ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.h"
#endif
#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
#include "ProcessLib/WellboreSimulator/CreateWellboreSimulatorProcess.h"
#endif
#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
#include "ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.h"
#endif
Expand Down Expand Up @@ -805,6 +808,24 @@ void ProjectData::parseProcesses(
}
else
#endif
#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
if (type == "WELLBORE_SIMULATOR")
{
if (_mesh_vec[0]->getDimension() != 1)
{
OGS_FATAL(
"WELLBORE_SIMULATOR can only work with a 1-dimensional "
"mesh!");
}

process =
ProcessLib::WellboreSimulator::createWellboreSimulatorProcess(
name, *_mesh_vec[0], std::move(jacobian_assembler),
_process_variables, _parameters, integration_order,
process_config, _media);
}
else
#endif
#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
if (type == "HYDRO_MECHANICS")
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Declares a compensated Neumann boundary condition of the Dirichlet boundary
condition in the wellbore simulator process.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Defines the Neumann boundary condition for the first variable, i.e., enthalpy.
When it is activated, the value gives 1 (out of the domain), otherwise it is 0.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Defines the Neumann boundary condition for the first variable, i.e., pressure.
When it is activated, the value gives 1 (out of the domain), otherwise it is 0.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Defines the Neumann boundary condition for the second variable, i.e., velocity.
When it is activated, the value gives 1 (out of the domain), otherwise it is 0.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\copydoc ProcessLib::WellboreSimulator::WellboreSimulatorProcess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The process variables for pressure, velocity, and enthalpy.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The total enthalpy of the wellbore.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pressure for the wellbore.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Mix velocity of the wellbore.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The properties of the conceptual reservoir when considering the conductive heat exchange with the wellbore.

For further information, refer to the implementation of the semi-analytical solution and to the following
publication \cite zhang2011time
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It is the density of the surrounding reservoir.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It is the hydraulic pressure of the surrounding reservoir.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It is the specific heat capacity of the surrounding reservoir.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It is the far-field temperature of the surrounding reservoir.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It is the thermal conductivity of the surrounding reservoir.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
It defines if the conductive heat exchange with surrounding formation is
considered.

The default is false.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
It defines the productivity index of the wellbore to quantify the heat and mass
exchange with the feed zones.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Specific body forces applied to fluid.

It is usually used to apply gravitational forces.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It is the referenced enthalpy of the wellbore at the initial state.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It is the referenced pressure of the wellbore at the initial state.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Defines the wellbore geometry.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Casing thickness in the wellbore.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wellbore diameter.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wellbore length.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The pipe thickness inside the wellbore.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Roughness of the wellbore.
11 changes: 11 additions & 0 deletions Documentation/bibliography/other.bib
Original file line number Diff line number Diff line change
Expand Up @@ -476,3 +476,14 @@ @article{hughes1980generalization
url = {https://doi.org/10.1002/nme.1620150914},
publisher={Wiley Online Library}
}

@article{zhang2011time,
title={A time-convolution approach for modeling heat exchange between a wellbore and surrounding formation},
author={Zhang, Yingqi and Pan, Lehua and Pruess, Karsten and Finsterle, Stefan},
journal={Geothermics},
volume={40},
number={4},
pages={261--266},
year={2011},
publisher={Elsevier}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "RobinBoundaryCondition.h"
#include "SolutionDependentDirichletBoundaryCondition.h"
#include "VariableDependentNeumannBoundaryCondition.h"
#include "WellboreCompensateNeumannBoundaryCondition.h"

namespace ProcessLib
{
Expand All @@ -37,8 +38,7 @@ std::unique_ptr<BoundaryCondition> createBoundaryCondition(
const Process& process,
[[maybe_unused]] std::vector<std::reference_wrapper<ProcessVariable>> const&
all_process_variables_for_this_process,
std::map<int,
std::shared_ptr<MaterialPropertyLib::Medium>> const& /*media*/)
std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
{
// Surface mesh and bulk mesh must have equal axial symmetry flags!
if (config.boundary_mesh.isAxiallySymmetric() !=
Expand Down Expand Up @@ -120,6 +120,13 @@ std::unique_ptr<BoundaryCondition> createBoundaryCondition(
config.config, config.boundary_mesh, dof_table, variable_id,
*config.component_id, parameters);
}
if (type == "WellboreCompensateNeumann")
{
return ProcessLib::createWellboreCompensateNeumannBoundaryCondition(
config.config, config.boundary_mesh, dof_table, variable_id,
*config.component_id, integration_order, shapefunction_order,
bulk_mesh.getDimension(), media);
}
if (type == "SolutionDependentDirichlet")
{
return ProcessLib::createSolutionDependentDirichletBoundaryCondition(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* \file
* \copyright
* Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/

#include "WellboreCompensateNeumannBoundaryCondition.h"

#include "MaterialLib/MPL/CreateMaterialSpatialDistributionMap.h"
#include "ParameterLib/Utils.h"

namespace ProcessLib
{
std::unique_ptr<WellboreCompensateNeumannBoundaryCondition>
createWellboreCompensateNeumannBoundaryCondition(
BaseLib::ConfigTree const& config, MeshLib::Mesh const& bc_mesh,
NumLib::LocalToGlobalIndexMap const& dof_table, int const variable_id,
int const component_id, unsigned const integration_order,
unsigned const shapefunction_order, unsigned const global_dim,
std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
{
DBUG("Constructing WellboreCompensateNeumann BC from config.");
//! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__type}
config.checkConfigParameter("type", "WellboreCompensateNeumann");
if (dof_table.getNumberOfVariables() != 3)
{
OGS_FATAL(
"WellboreCompensateNeumann BC only implemented for the "
"WellboreSimulator processes.");
}
assert(variable_id == 0 || variable_id == 1 || variable_id == 2);

if (bc_mesh.getDimension() + 1 != global_dim)
{
OGS_FATAL(
"The dimension ({:d}) of the given boundary mesh '{:s}' is not by "
"one "
"lower than the bulk dimension ({:d}).",
bc_mesh.getDimension(), bc_mesh.getName(), global_dim);
}

auto const pressure_coefficient =
//! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__WellboreCompensateNeumann__coefficient_pressure}
config.getConfigParameter<double>("coefficient_pressure");

auto const velocity_coefficient =
//! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__WellboreCompensateNeumann__coefficient_velocity}
config.getConfigParameter<double>("coefficient_velocity");

auto const enthalpy_coefficient =
//! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__WellboreCompensateNeumann__coefficient_enthalpy}
config.getConfigParameter<double>("coefficient_enthalpy");

auto const pressure_id = 0;
auto const velocity_id = 1;
auto const enthalpy_id = 2;

std::vector<MeshLib::Node*> const& bc_nodes = bc_mesh.getNodes();
MeshLib::MeshSubset bc_mesh_subset(bc_mesh, bc_nodes);
auto dof_table_boundary_pressure = dof_table.deriveBoundaryConstrainedMap(
pressure_id, {component_id}, std::move(bc_mesh_subset));
auto dof_table_boundary_velocity = dof_table.deriveBoundaryConstrainedMap(
velocity_id, {component_id}, std::move(bc_mesh_subset));
auto dof_table_boundary_enthalpy = dof_table.deriveBoundaryConstrainedMap(
enthalpy_id, {component_id}, std::move(bc_mesh_subset));

//
// maybe the boundary mesh needs material ids
auto media_map = MaterialPropertyLib::createMaterialSpatialDistributionMap(
media, bc_mesh);

return std::make_unique<WellboreCompensateNeumannBoundaryCondition>(
integration_order, shapefunction_order, dof_table, variable_id,
component_id, global_dim, bc_mesh,
WellboreCompensateNeumannBoundaryConditionData{
pressure_coefficient, velocity_coefficient, enthalpy_coefficient,
std::move(dof_table_boundary_pressure),
std::move(dof_table_boundary_velocity),
std::move(dof_table_boundary_enthalpy), std::move(media_map)});
}

} // namespace ProcessLib
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* \file
* \copyright
* Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/

#pragma once

#include "GenericNaturalBoundaryCondition.h"
#include "MaterialLib/MPL/MaterialSpatialDistributionMap.h"
#include "MeshLib/PropertyVector.h"
#include "WellboreCompensateNeumannBoundaryConditionLocalAssembler.h"

namespace ProcessLib
{
using WellboreCompensateNeumannBoundaryCondition =
GenericNaturalBoundaryCondition<
WellboreCompensateNeumannBoundaryConditionData,
WellboreCompensateNeumannBoundaryConditionLocalAssembler>;

std::unique_ptr<WellboreCompensateNeumannBoundaryCondition>
createWellboreCompensateNeumannBoundaryCondition(
BaseLib::ConfigTree const& config, MeshLib::Mesh const& bc_mesh,
NumLib::LocalToGlobalIndexMap const& dof_table, int const variable_id,
int const component_id, unsigned const integration_order,
unsigned const shapefunction_order, unsigned const global_dim,
std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media);

} // namespace ProcessLib
Loading

0 comments on commit 2d4c090

Please sign in to comment.