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

Detailed Description

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

Definition at line 42 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 46 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 67 of file WellboreCompensateNeumannBoundaryConditionLocalAssembler.h.

72 {
74 _local_rhs.setZero();
75
76 unsigned const n_integration_points =
77 Base::_integration_method.getNumberOfPoints();
78
79 auto const indices_current_variable =
82 mesh_item_id, *_data.dof_table_boundary_pressure);
84 mesh_item_id, *_data.dof_table_boundary_velocity);
86 mesh_item_id, *_data.dof_table_boundary_enthalpy);
87
94
95 auto const& medium = *_data.media_map.getMedium(_element.getID());
96 auto const& liquid_phase =
98 auto const& gas_phase =
100
102 pos.setElementID(_element.getID());
103
105
106 for (unsigned ip = 0; ip < n_integration_points; ip++)
107 {
109 auto const& N = n_and_weight.N;
110 auto const& w = n_and_weight.weight;
111
112 double pressure_int_pt = 0.0;
113 double velocity_int_pt = 0.0;
114 double enthalpy_int_pt = 0.0;
115
122
123 vars.liquid_phase_pressure = pressure_int_pt;
124 vars.enthalpy = enthalpy_int_pt;
125
126 double liquid_water_density =
128 .property(
130 .template value<double>(vars, pos, 0, 0);
131
132 double const vapour_water_density =
134 .property(
136 .template value<double>(vars, pos, 0, 0);
137
138 double const h_sat_liq_w =
140 .property(
142 .template value<double>(vars, pos, 0, 0);
143
144 double const h_sat_vap_w =
146 .property(
148 .template value<double>(vars, pos, 0, 0);
149
150 double const dryness =
153
154 double const T_int_pt =
155 (dryness == 0)
157 .property(
159 .template value<double>(vars, pos, 0, 0)
160 : gas_phase
163 .template value<double>(vars, pos, 0, 0);
164
165 vars.temperature = T_int_pt;
166
167 // For the calculation of the void fraction of vapour,
168 // see Rohuani, Z., and E. Axelsson. "Calculation of volume void
169 // fraction in a subcooled and quality region." International
170 // Journal of Heat and Mass Transfer 17 (1970): 383-393.
171
172 // Profile parameter of drift flux
173 double const C_0 = 1 + 0.12 * (1 - dryness);
174
175 // For the surface tension calculation, see
176 // Cooper, J. R., and R. B. Dooley. "IAPWS release on surface
177 // tension of ordinary water substance." International Association
178 // for the Properties of Water and Steam (1994).
179 double const sigma_gl = 0.2358 *
180 std::pow((1 - T_int_pt / 647.096), 1.256) *
181 (1 - 0.625 * (1 - T_int_pt / 647.096));
182 // drift flux velocity
183 double const u_gu =
184 1.18 * (1 - dryness) *
185 std::pow((9.81) * sigma_gl *
187 0.25) /
189
190 // solving void fraction of vapour using local Newton
191 // iteration.
192 double alpha = 0;
193 if (dryness != 0)
194 {
195 // Local Newton solver
196 using LocalJacobianMatrix =
201
203
205 {
208 (1 - alpha) * liquid_water_density) *
212 (1 - alpha) * liquid_water_density) *
214 alpha * C_0 * (1 - dryness) *
217 (1 - alpha) * liquid_water_density) *
221 };
222
224 {
225 jacobian(0) =
229 C_0 * (1 - dryness) * vapour_water_density) *
231 (1 - 2 * alpha) * liquid_water_density) *
234 };
235
236 auto const update_solution =
237 [&](LocalUnknownVector const& increment)
238 {
239 // increment solution vectors
240 alpha += increment[0];
241 };
242
243 const int maximum_iterations(20);
244 const double residuum_tolerance(1.e-10);
245 const double increment_tolerance(0);
246
252
253 auto const success_iterations = newton_solver.solve(J_loc);
254
256 {
257 WARN(
258 "Attention! Steam void fraction has not been correctly "
259 "calculated!");
260 }
261 }
262
263 if (alpha == 0)
264 {
268 .template value<double>(vars, pos, 0, 0);
269 }
270
271 double const mix_density = vapour_water_density * alpha +
273
274 // slip parameter between two phases
275 double const gamma =
277 mix_density / (1 - alpha) /
279 (1 - alpha * C_0) * liquid_water_density),
280 2) *
281 std::pow((C_0 - 1) * velocity_int_pt + u_gu, 2);
282
283 double const neumann_ip_values =
284 _data.coefficients.pressure * mix_density * velocity_int_pt +
285 _data.coefficients.velocity *
287 _data.coefficients.enthalpy * mix_density * velocity_int_pt *
289 _local_rhs.noalias() += N.transpose() * neumann_ip_values * w;
290 }
291
293 }
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:34
std::vector< NAndWeight, Eigen::aligned_allocator< NAndWeight > > const _ns_and_weights
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::density, MaterialPropertyLib::VariableArray::enthalpy, MaterialPropertyLib::Gas, NumLib::getIndices(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::saturation_density, MaterialPropertyLib::saturation_enthalpy, ParameterLib::SpatialPosition::setElementID(), NumLib::detail::shapeFunctionInterpolate(), NumLib::NewtonRaphson< LinearSolver, JacobianMatrixUpdate, ResidualUpdate, SolutionUpdate >::solve(), MaterialPropertyLib::temperature, MaterialPropertyLib::VariableArray::temperature, and WARN().

Member Data Documentation

◆ _data

◆ _element

◆ _local_matrix_size


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