OGS
ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim > Class Template Referencefinal

Detailed Description

template<typename ShapeFunction, int GlobalDim>
class ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >

Definition at line 49 of file WellboreCompensateNeumannBoundaryConditionLocalAssembler.h.

#include <WellboreCompensateNeumannBoundaryConditionLocalAssembler.h>

Inheritance diagram for ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >:
[legend]
Collaboration diagram for ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >:
[legend]

Public Member Functions

 WellboreCompensateNeumannBoundaryConditionLocalAssembler (MeshLib::Element const &e, std::size_t const local_matrix_size, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, WellboreCompensateNeumannBoundaryConditionData const &data)
void assemble (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, double const, std::vector< GlobalVector * > const &x, int const process_id, GlobalMatrix *, GlobalVector &b, GlobalMatrix *) override
Public Member Functions inherited from ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >
 GenericNaturalBoundaryConditionLocalAssembler (MeshLib::Element const &e, bool is_axially_symmetric, NumLib::GenericIntegrationMethod const &integration_method)
Public Member Functions inherited from ProcessLib::GenericNaturalBoundaryConditionLocalAssemblerInterface
virtual ~GenericNaturalBoundaryConditionLocalAssemblerInterface ()=default

Private Types

using Base
using NodalVectorType = typename Base::NodalVectorType
using NodalMatrixType = typename Base::NodalMatrixType

Private Attributes

MeshLib::Element const & _element
WellboreCompensateNeumannBoundaryConditionData const & _data
Base::NodalVectorType _local_matrix_size

Additional Inherited Members

Protected Types inherited from ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >
using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
using NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
using NodalVectorType = typename ShapeMatricesType::NodalVectorType
Protected Attributes inherited from ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >
NumLib::GenericIntegrationMethod const & _integration_method
std::vector< NAndWeight, Eigen::aligned_allocator< NAndWeight > > const _ns_and_weights
MeshLib::Element const & _element

Member Typedef Documentation

◆ Base

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::Base
private
Initial value:
GenericNaturalBoundaryConditionLocalAssembler(MeshLib::Element const &e, bool is_axially_symmetric, NumLib::GenericIntegrationMethod const &integration_method)

Definition at line 53 of file WellboreCompensateNeumannBoundaryConditionLocalAssembler.h.

◆ NodalMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::NodalMatrixType = typename Base::NodalMatrixType
private

◆ NodalVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::NodalVectorType = typename Base::NodalVectorType
private

Constructor & Destructor Documentation

◆ WellboreCompensateNeumannBoundaryConditionLocalAssembler()

template<typename ShapeFunction, int GlobalDim>
ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::WellboreCompensateNeumannBoundaryConditionLocalAssembler ( MeshLib::Element const & e,
std::size_t const local_matrix_size,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
WellboreCompensateNeumannBoundaryConditionData const & data )
inline

Member Function Documentation

◆ assemble()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble ( std::size_t const mesh_item_id,
NumLib::LocalToGlobalIndexMap const & dof_table_boundary,
double const ,
std::vector< GlobalVector * > const & x,
int const process_id,
GlobalMatrix * ,
GlobalVector & b,
GlobalMatrix *  )
inlineoverridevirtual

Implements ProcessLib::GenericNaturalBoundaryConditionLocalAssemblerInterface.

Definition at line 74 of file WellboreCompensateNeumannBoundaryConditionLocalAssembler.h.

79 {
81 _local_rhs.setZero();
82
83 unsigned const n_integration_points =
84 Base::_integration_method.getNumberOfPoints();
85
86 auto const indices_current_variable =
89 mesh_item_id, *_data.dof_table_boundary_pressure);
91 mesh_item_id, *_data.dof_table_boundary_velocity);
93 mesh_item_id, *_data.dof_table_boundary_enthalpy);
94
101
102 auto const& medium = *_data.media_map.getMedium(_element.getID());
103 auto const& liquid_phase =
105 auto const& gas_phase =
107
109 pos.setElementID(_element.getID());
110
112
113 for (unsigned ip = 0; ip < n_integration_points; ip++)
114 {
116 auto const& N = n_and_weight.N;
117 auto const& w = n_and_weight.weight;
118
119 double pressure_int_pt = 0.0;
120 double velocity_int_pt = 0.0;
121 double enthalpy_int_pt = 0.0;
122
129
130 vars.liquid_phase_pressure = pressure_int_pt;
131 vars.enthalpy = enthalpy_int_pt;
132
133 // Above the critical pressure the region 4 saturation line ends,
134 // so there is no two-phase state to describe and the saturation
135 // properties are not evaluated at all: they would be
136 // extrapolated, and the closure they feed has no admissible void
137 // fraction there. Such a section is compressed liquid, which the
138 // region 1 properties of the liquid phase describe, and it is
139 // solved as one, as in the process this boundary condition
140 // compensates. Below the lower bound of the saturation line there
141 // is no such fall-back, so the range check of the saturation
142 // properties aborts the assembly as before.
143 double dryness = 0.;
144 double T_int_pt = 0.;
145 double liquid_water_density = 0.;
146 double vapour_water_density = 0.;
147 double alpha = 0.;
149
150 if (pressure_int_pt >
152 {
153 T_int_pt =
155 .property(
157 .template value<double>(vars, pos, 0, 0);
158 vars.temperature = T_int_pt;
159
162 "the compressed liquid state of the "
163 "WellboreCompensateNeumann boundary condition");
164
168 .template value<double>(vars, pos, 0, 0);
169 }
170 else
171 {
176 .template value<double>(vars, pos, 0, 0);
177
182 .template value<double>(vars, pos, 0, 0);
183
184 double const h_sat_liq_w =
188 .template value<double>(vars, pos, 0, 0);
189
190 double const h_sat_vap_w =
194 .template value<double>(vars, pos, 0, 0);
195
198
199 T_int_pt =
200 (dryness == 0)
204 .template value<double>(vars, pos, 0, 0)
205 : gas_phase
208 .template value<double>(vars, pos, 0, 0);
209
210 vars.temperature = T_int_pt;
211
212 // For the calculation of the void fraction of vapour,
213 // see Rohuani, Z., and E. Axelsson. "Calculation of volume
214 // void fraction in a subcooled and quality region."
215 // International Journal of Heat and Mass Transfer 17 (1970):
216 // 383-393.
217
218 // The drift is aligned with the mixture flow so that the
219 // closure below and the slip momentum term further down are
220 // consistent, see
221 // MaterialPropertyLib::alignedDriftFluxVelocity().
225
226 // solving void fraction of vapour: Rouhani-Axelsson
227 auto const alpha_solution =
230
231 if (!alpha_solution)
232 {
234 "The drift-flux closure of the "
235 "WellboreCompensateNeumann boundary condition has no "
236 "admissible vapour void fraction in element {:d}, "
237 "integration point {:d}: pressure {:g} Pa, mixture "
238 "velocity {:g} m/s, specific enthalpy {:g} J/kg, "
239 "temperature {:g} K, {}",
244 }
245
247
248 if (alpha == 0)
249 {
252 .property(
254 .template value<double>(vars, pos, 0, 0);
255 }
256 }
257
258 double const mix_density = vapour_water_density * alpha +
260
261 double const gamma =
264 : 0.;
265
266 double const neumann_ip_values =
267 _data.coefficients.pressure * mix_density * velocity_int_pt +
268 _data.coefficients.velocity *
270 _data.coefficients.enthalpy * mix_density * velocity_int_pt *
272 _local_rhs.noalias() += N.transpose() * neumann_ip_values * w;
273 }
274
276 }
std::vector< NAndWeight, Eigen::aligned_allocator< NAndWeight > > const _ns_and_weights
void checkStateInRange(double const pressure, double const temperature, std::string_view const quantity)
double mixtureSlipParameter(double const alpha, DriftFluxState const &state)
std::optional< double > computeVapourVoidFraction(DriftFluxState const &state)
double steamDryness(double const enthalpy, double const h_sat_liquid, double const h_sat_vapour)
DriftFluxState driftFluxState(double const dryness, double const temperature, double const vapour_water_density, double const liquid_water_density, double const v_mix)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
std::vector< GlobalIndexType > getIndices(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)

References _data, _element, ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_integration_method, _local_matrix_size, ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_ns_and_weights, MathLib::EigenVector::add(), MaterialPropertyLib::AqueousLiquid, MaterialPropertyLib::IAPWSIF97Region1::checkStateInRange(), MaterialPropertyLib::computeVapourVoidFraction(), MaterialPropertyLib::density, MaterialPropertyLib::driftFluxState(), MaterialPropertyLib::VariableArray::enthalpy, MaterialPropertyLib::Gas, NumLib::getIndices(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::mixtureSlipParameter(), MaterialLib::PhysicalConstant::CriticalPoint::PressureWater, ParameterLib::SpatialPosition::setElementID(), NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::steamDryness(), MaterialPropertyLib::temperature, MaterialPropertyLib::VariableArray::temperature, and MaterialPropertyLib::voidFractionClosureDiagnostics().

Member Data Documentation

◆ _data

◆ _element

◆ _local_matrix_size


The documentation for this class was generated from the following file: