OGS
ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim > Class Template Reference

Detailed Description

template<typename ShapeFunction, int GlobalDim>
class ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >

Definition at line 30 of file WellboreSimulatorFEM.h.

#include <WellboreSimulatorFEM.h>

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

Public Member Functions

 WellboreSimulatorFEM (MeshLib::Element const &element, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, WellboreSimulatorProcessData const &process_data)
void assemble (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data) override
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const override
 Provides the shape matrix at the given integration point.
void computeSecondaryVariableConcrete (double const, double const, Eigen::VectorXd const &, Eigen::VectorXd const &) override
void postTimestepConcrete (Eigen::VectorXd const &, Eigen::VectorXd const &, double const, double const, int const) override
Public Member Functions inherited from ProcessLib::WellboreSimulator::WellboreSimulatorLocalAssemblerInterface
 WellboreSimulatorLocalAssemblerInterface ()=default
Public Member Functions inherited from ProcessLib::LocalAssemblerInterface
virtual ~LocalAssemblerInterface ()=default
virtual void setInitialConditions (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, int const process_id)
virtual void initialize (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
virtual void preAssemble (double const, double const, std::vector< double > const &)
virtual void assembleForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
virtual void assembleWithJacobian (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
virtual void assembleWithJacobianForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
virtual void computeSecondaryVariable (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
virtual void preTimestep (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
virtual void postTimestep (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
void postNonLinearSolver (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< double > const &) const
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< std::vector< double > > const &) const
 Fits to staggered scheme.
virtual int getNumberOfVectorElementsForDeformation () const
Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default

Protected Types

using IpData

Protected Member Functions

virtual std::vector< double > const & getIntPtVaporMassFlowRate (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
virtual std::vector< double > const & getIntPtLiquidMassFlowRate (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
virtual std::vector< double > const & getIntPtTemperature (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
virtual std::vector< double > const & getIntPtDryness (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
virtual std::vector< double > const & getIntPtVaporVolumeFraction (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override

Protected Attributes

MeshLib::Element const & _element
NumLib::GenericIntegrationMethod const & _integration_method
bool const _is_axially_symmetric
WellboreSimulatorProcessData const & _process_data
Eigen::Vector3d _element_direction
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data

Static Protected Attributes

static const int pressure_index = 0
static const int velocity_index = ShapeFunction::NPOINTS
static const int enthalpy_index = 2 * ShapeFunction::NPOINTS
static const int pressure_size = ShapeFunction::NPOINTS
static const int velocity_size = ShapeFunction::NPOINTS
static const int enthalpy_size = ShapeFunction::NPOINTS

Private Types

using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
using LocalMatrixType
using LocalVectorType
using NodalVectorType = typename ShapeMatricesType::NodalVectorType
using NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType
using GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType
using GlobalDimNodalMatrixType
using GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType

Member Typedef Documentation

◆ GlobalDimMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType
private

Definition at line 48 of file WellboreSimulatorFEM.h.

◆ GlobalDimNodalMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::GlobalDimNodalMatrixType
private
Initial value:
MatrixType< GlobalDim, ShapeFunction::NPOINTS > GlobalDimNodalMatrixType

Definition at line 46 of file WellboreSimulatorFEM.h.

◆ GlobalDimVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType
private

Definition at line 45 of file WellboreSimulatorFEM.h.

◆ IpData

◆ LocalMatrixType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::LocalMatrixType
private
Initial value:
typename ShapeMatricesType::template MatrixType<
NUM_NODAL_DOF * ShapeFunction::NPOINTS,
NUM_NODAL_DOF * ShapeFunction::NPOINTS>
const unsigned NUM_NODAL_DOF

Definition at line 35 of file WellboreSimulatorFEM.h.

◆ LocalVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::LocalVectorType
private
Initial value:
typename ShapeMatricesType::template VectorType<NUM_NODAL_DOF *
ShapeFunction::NPOINTS>

Definition at line 38 of file WellboreSimulatorFEM.h.

◆ NodalRowVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType
private

Definition at line 43 of file WellboreSimulatorFEM.h.

◆ NodalVectorType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::NodalVectorType = typename ShapeMatricesType::NodalVectorType
private

Definition at line 42 of file WellboreSimulatorFEM.h.

◆ ShapeMatrices

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
private

Definition at line 33 of file WellboreSimulatorFEM.h.

◆ ShapeMatricesType

template<typename ShapeFunction, int GlobalDim>
using ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
private

Definition at line 32 of file WellboreSimulatorFEM.h.

Constructor & Destructor Documentation

◆ WellboreSimulatorFEM()

template<typename ShapeFunction, int GlobalDim>
ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::WellboreSimulatorFEM ( MeshLib::Element const & element,
std::size_t const ,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
WellboreSimulatorProcessData const & process_data )
inline

Definition at line 51 of file WellboreSimulatorFEM.h.

61 {
62 // calculate the element direction vector
63 auto const& p0 = element.getNode(0)->asEigenVector3d();
64 auto const& p1 = element.getNode(1)->asEigenVector3d();
65
67
68 unsigned const n_integration_points =
69 _integration_method.getNumberOfPoints();
71
72 auto const shape_matrices =
76
78 pos.setElementID(_element.getID());
79 auto const& medium =
80 *_process_data.media_map.getMedium(_element.getID());
81 auto const& liquid_phase =
83
84 for (unsigned ip = 0; ip < n_integration_points; ip++)
85 {
86 _ip_data.emplace_back(
88 _integration_method.getWeightedPoint(ip).getWeight() *
89 shape_matrices[ip].integralMeasure *
90 shape_matrices[ip].detJ);
91
93
95 _process_data.well_ref_pressure.getNodalValuesOnElement(
96 _element, 0);
98 _process_data.well_ref_enthalpy.getNodalValuesOnElement(
99 _element, 0);
100
101 vars.liquid_phase_pressure = _ip_data[ip].N.dot(ref_p);
102 vars.enthalpy = _ip_data[ip].N.dot(ref_h);
103
104 // .initialValue
105 _ip_data[ip].temperature =
108 .template value<double>(vars, pos, 0, 0);
109 vars.temperature = _ip_data[ip].temperature;
110 _ip_data[ip].mix_density =
113 .template value<double>(vars, pos, 0, 0);
114 _ip_data[ip].dryness = 0;
115 _ip_data[ip].vapor_volume_fraction = 0;
116 _ip_data[ip].vapor_mass_flow_rate = 0;
117 _ip_data[ip].liquid_mass_flow_rate = 0;
118 _ip_data[ip].pushBackState();
119 }
120 }
typename ShapeMatricesType::NodalVectorType NodalVectorType
NumLib::GenericIntegrationMethod const & _integration_method
ShapeMatrixPolicyType< ShapeFunction, GlobalDim > ShapeMatricesType
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data

References _element, _element_direction, _integration_method, _ip_data, _is_axially_symmetric, _process_data, MaterialPropertyLib::AqueousLiquid, MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::enthalpy, MeshLib::Element::getNode(), NumLib::initShapeMatrices(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, ParameterLib::SpatialPosition::setElementID(), MaterialPropertyLib::temperature, and MaterialPropertyLib::VariableArray::temperature.

Member Function Documentation

◆ assemble()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::assemble ( double const t,
double const dt,
std::vector< double > const & local_x,
std::vector< double > const & local_x_prev,
std::vector< double > & local_M_data,
std::vector< double > & local_K_data,
std::vector< double > & local_b_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 31 of file WellboreSimulatorFEM-impl.h.

35{
36 auto const local_matrix_size = local_x.size();
37
39
46
47 // Get block matrices
50
55
58
63
66
70
71 unsigned const n_integration_points =
72 _integration_method.getNumberOfPoints();
73
75 pos.setElementID(_element.getID());
76
77 auto const& b = _process_data.specific_body_force;
78
80
81 // Get material properties
82 auto const& medium = *_process_data.media_map.getMedium(_element.getID());
83 auto const& liquid_phase =
86
87 // Get wellbore parameters
88 // casing thickness
89 auto const t_ca = _process_data.wellbore.casing_thickness(t, pos)[0];
90 // wellbore radius
91 auto const r_w = _process_data.wellbore.diameter(t, pos)[0] / 2;
92
93 // pipe thickness
94 auto const t_p = _process_data.wellbore.pipe_thickness(t, pos)[0];
95
96 // roughness of the wellbore
97 auto const xi = _process_data.wellbore.roughness(t, pos)[0];
98 // pipe outer radius
99 auto const r_o = r_w - t_ca;
100 // pipe inner radius
101 auto const r_i = r_o - t_p;
102
103 // get reservoir properties
105 _process_data.reservoir_properties.temperature.getNodalValuesOnElement(
106 _element, t);
108 _process_data.reservoir_properties.pressure.getNodalValuesOnElement(
109 _element, t);
111 _process_data.productivity_index.getNodalValuesOnElement(_element, t);
112 auto const k_r =
113 _process_data.reservoir_properties.thermal_conductivity(t, pos)[0];
114 auto const rho_r = _process_data.reservoir_properties.density(t, pos)[0];
115 auto const c_r =
116 _process_data.reservoir_properties.specific_heat_capacity(t, pos)[0];
117
118 for (unsigned ip(0); ip < n_integration_points; ip++)
119 {
120 auto& ip_data = _ip_data[ip];
121 auto const& N = ip_data.N;
122 auto const& dNdx = ip_data.dNdx;
123 auto const& w = ip_data.integration_weight;
124 auto& mix_density = ip_data.mix_density;
125 auto& temperature = ip_data.temperature;
126 auto& steam_mass_frac = ip_data.dryness;
127 auto& vapor_volume_frac = ip_data.vapor_volume_fraction;
128 auto& vapor_mass_flowrate = ip_data.vapor_mass_flow_rate;
129 auto& liquid_mass_flowrate = ip_data.liquid_mass_flow_rate;
130
131 pos = {
132 std::nullopt, _element.getID(),
135 _element, N))};
136
137 double p_int_pt = 0.0;
138 double v_int_pt = 0.0;
139 double h_int_pt = 0.0;
140
142 h_int_pt);
143
144 double p_prev_int_pt = 0.0;
145 double v_prev_int_pt = 0.0;
146 double h_prev_int_pt = 0.0;
147
150
151 double vdot_int_pt = (v_int_pt - v_prev_int_pt) / dt;
152
153 // calculate fluid properties
154
155 const double pi = std::numbers::pi;
156
157 vars.liquid_phase_pressure = p_int_pt;
158 vars.enthalpy = h_int_pt;
159
160 // Above the critical pressure the region 4 saturation line ends, so
161 // there is no two-phase state to describe and the saturation
162 // properties are not evaluated at all: they would be extrapolated,
163 // and the closure they feed has no admissible void fraction there.
164 // Such a section is compressed liquid, which the region 1 properties
165 // of the liquid phase describe, and it is solved as one. Below the
166 // lower bound of the saturation line there is no such fall-back - the
167 // water is vapour, which this process has no properties for - so the
168 // range check of the saturation properties aborts the assembly as
169 // before.
170 double dryness = 0.;
171 double T_int_pt = 0.;
172 double liquid_water_density = 0.;
173 double vapour_water_density = 0.;
174 double alpha = 0.;
176
177 if (p_int_pt >
179 {
180 T_int_pt =
183 .template value<double>(vars, pos, t, dt);
184 vars.temperature = T_int_pt;
185
188 "the compressed liquid state of the WellboreSimulator "
189 "process");
190
194 .template value<double>(vars, pos, t, dt);
195 }
196 else
197 {
200 .property(
202 .template value<double>(vars, pos, t, dt);
205 .property(
207 .template value<double>(vars, pos, t, dt);
208
209 double const h_sat_liq_w =
211 .property(
213 .template value<double>(vars, pos, t, dt);
214 double const h_sat_vap_w =
216 .property(
218 .template value<double>(vars, pos, t, dt);
219
222
223 T_int_pt =
224 (dryness == 0)
226 .property(
228 .template value<double>(vars, pos, t, dt)
229 : gas_phase
233 vars.temperature = T_int_pt;
234
235 // For the calculation of the void fraction of vapour,
236 // see Rohuani, Z., and E. Axelsson. "Calculation of volume void
237 // fraction in a subcooled and quality region." International
238 // Journal of Heat and Mass Transfer 17 (1970): 383-393.
239
240 // The drift is aligned with the mixture flow so that the closure
241 // below and the slip momentum term further down are consistent,
242 // see MaterialPropertyLib::alignedDriftFluxVelocity().
245 v_int_pt);
246
247 // solving void fraction of vapour: Rouhani-Axelsson
248 auto const alpha_solution =
251
252 if (!alpha_solution)
253 {
255 "The drift-flux closure of the WellboreSimulator process "
256 "has no admissible vapour void fraction in element {:d}, "
257 "integration point {:d}: pressure {:g} Pa, mixture "
258 "velocity {:g} m/s, specific enthalpy {:g} J/kg, "
259 "temperature {:g} K, {}",
261 T_int_pt,
264 }
265
267
268 if (alpha == 0)
269 {
273 .template value<double>(vars, pos, t, dt);
274 }
275 }
276
280
283
284 auto& mix_density_prev = ip_data.mix_density_prev;
285 vars.density = mix_density;
286
287 auto const rho_dot = (mix_density - mix_density_prev) / dt;
288
289 double const liquid_water_velocity_act =
290 (alpha == 0) ? v_int_pt
291 : (alpha == 1) ? 0
292 : (1 - dryness) * mix_density * v_int_pt /
294 double const vapor_water_velocity_act =
295 (alpha == 0) ? 0
298
300 pi * r_i * r_i * alpha;
301
304 (1 - alpha);
305
306 double const gamma = drift_flux_state
309 : 0.;
310
311 double const miu =
313 .template value<double>(vars, pos, t, dt);
314 double const Re = mix_density * v_int_pt * 2 * r_i / miu;
315
316 // Wall friction coefficient,
317 // Musivand Arzanfudi, Mehdi, and Rafid Al‐Khoury. "A compressible
318 // two‐fluid multiphase model for CO2 leakage through a wellbore."
319 // International Journal for Numerical Methods in Fluids 77.8 (2015):
320 // 477-507.
321 double f = 0.0;
322 if (Re > 10 && Re <= 2400)
323 {
324 f = 16 / Re;
325 }
326 else if (Re > 2400)
327 {
328 f = std::pow(std::log(xi / 3.7 / r_i) -
329 5.02 / Re * std::log(xi / 3.7 / r_i + 13 / Re),
330 -2) /
331 16;
332 }
333
334 double Q_hx = 0;
335 double const T_r_int_pt = N.dot(T_r);
336 // conductive heat exchange between wellbore and formation
337 if (_process_data.has_heat_exchange_with_formation)
338 {
339 // See Zhang, Pan, Pruess, Finsterle (2011). A time-convolution
340 // approach for modeling heat exchange between a wellbore and
341 // surrounding formation. Geothermics 40, 261-266.
342 const double alpha_r = k_r / rho_r / c_r;
343 const double t_d = alpha_r * t / (r_i * r_i);
344
345 double beta;
346 if (t_d < 2.8)
347 {
348 beta = 1 / std::sqrt(pi * t_d) + 0.5 -
349 0.25 * std::sqrt(t_d / pi) + 0.125 * t_d;
350 }
351 else
352 {
353 beta = 2 * (1 / (std::log(4 * t_d) - 2 * 0.57722) -
354 0.57722 /
355 std::pow((std::log(4 * t_d) - 2 * 0.57722), 2));
356 }
357
358 const double P_c = 2 * pi * r_i;
359 Q_hx = P_c * k_r * (T_r_int_pt - T_int_pt) / r_i * beta;
360 }
361
362 // mass exchange with reservoir
363 double const p_r_int_pt = N.dot(p_r);
364 double const PI_int_pt = N.dot(PI);
365 double Q_mx = PI_int_pt * (p_int_pt - p_r_int_pt);
366
367 // advective momentum and energy exchange with reservoir due to the mass
368 // exchange
369 double Q_mom = 0;
370 double Q_ene = 0;
371 if (Q_mx != 0)
372 {
373 Q_mom = Q_mx * v_int_pt;
374 // Only single-phase liquid condition is considered now
375 // TODO: update the two-phase flowing enthalpy from the feed zone.
376 vars.liquid_phase_pressure = p_r_int_pt;
377 vars.temperature = T_r_int_pt;
378 double const h_fres =
381 .template value<double>(vars, pos, t, dt);
382 Q_ene = Q_mx * h_fres;
383 }
384
385 // M matrix assembly
386 Mvv.noalias() += w * N.transpose() * mix_density * N;
387
388 Mhp.noalias() += -w * N.transpose() * N;
389 Mhh.noalias() += w * N.transpose() * mix_density * N;
390
391 // K matrix assembly
392 Kpv.noalias() += w * dNdx.transpose() * N * mix_density;
393
394 Kvp.noalias() += w * N.transpose() * dNdx;
395 Kvv.noalias() += w * N.transpose() * rho_dot * N;
396
397 Khh.noalias() += w * N.transpose() * mix_density * v_int_pt * dNdx;
398
399 // b matrix assembly
400 Bp.noalias() += w * N.transpose() * rho_dot + w * N.transpose() * Q_mx;
401
402 Bv.noalias() +=
403 w * dNdx.transpose() * mix_density * v_int_pt * v_int_pt +
404 w * dNdx.transpose() * gamma -
405 w * N.transpose() * f * mix_density * std::abs(v_int_pt) *
406 v_int_pt / (4 * r_i) -
407 w * N.transpose() * Q_mom;
408
409 Bh.noalias() +=
410 -1 / 2 * w * N.transpose() * rho_dot * v_int_pt * v_int_pt -
411 w * N.transpose() * mix_density * v_int_pt * vdot_int_pt +
412 1 / 2 * w * dNdx.transpose() * mix_density * v_int_pt * v_int_pt *
413 v_int_pt +
414 w * N.transpose() * (Q_hx / pi / r_i / r_i) -
415 w * N.transpose() * Q_ene;
416
417 if (_process_data.has_gravity)
418 {
420 N.transpose() * b * w * _element_direction[2];
421
422 Bv.noalias() += gravity_operator * mix_density;
423 Bh.noalias() += gravity_operator * mix_density * v_int_pt;
424 }
425 }
426
427 // debugging
428 // std::string sep = "\n----------------------------------------\n";
429 // Eigen::IOFormat CleanFmt(6, 0, ", ", "\n", "[", "]");
430 // std::cout << local_M.format(CleanFmt) << sep;
431 // std::cout << local_K.format(CleanFmt) << sep;
432 // std::cout << local_b.format(CleanFmt) << sep;
433}
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)
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)

References _element, _element_direction, _integration_method, _ip_data, _process_data, MaterialPropertyLib::AqueousLiquid, MaterialPropertyLib::IAPWSIF97Region1::checkStateInRange(), MaterialPropertyLib::computeVapourVoidFraction(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::driftFluxState(), MaterialPropertyLib::enthalpy, MaterialPropertyLib::VariableArray::enthalpy, enthalpy_index, MaterialPropertyLib::Gas, NumLib::interpolateCoordinates(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::mixtureSlipParameter(), ProcessLib::WellboreSimulator::NUM_NODAL_DOF, PI, pressure_index, MaterialLib::PhysicalConstant::CriticalPoint::PressureWater, MaterialPropertyLib::saturation_density, MaterialPropertyLib::saturation_enthalpy, ParameterLib::SpatialPosition::setElementID(), NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::steamDryness(), MaterialPropertyLib::temperature, MaterialPropertyLib::VariableArray::temperature, velocity_index, MaterialPropertyLib::viscosity, and MaterialPropertyLib::voidFractionClosureDiagnostics().

◆ computeSecondaryVariableConcrete()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete ( double const ,
double const ,
Eigen::VectorXd const & ,
Eigen::VectorXd const &  )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 138 of file WellboreSimulatorFEM.h.

143 {
144 auto const n_integration_points =
145 _integration_method.getNumberOfPoints();
146 auto const ele_id = _element.getID();
147
148 (*_process_data.mesh_prop_density)[ele_id] =
149 std::accumulate(_ip_data.begin(), _ip_data.end(), 0.,
150 [](double const s, auto const& ip)
151 { return s + ip.mix_density; }) /
153 }

References _element, _integration_method, _ip_data, and _process_data.

◆ getIntPtDryness()

template<typename ShapeFunction, int GlobalDim>
virtual std::vector< double > const & ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::getIntPtDryness ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverrideprotectedvirtual

◆ getIntPtLiquidMassFlowRate()

template<typename ShapeFunction, int GlobalDim>
virtual std::vector< double > const & ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::getIntPtLiquidMassFlowRate ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverrideprotectedvirtual

◆ getIntPtTemperature()

template<typename ShapeFunction, int GlobalDim>
virtual std::vector< double > const & ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::getIntPtTemperature ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverrideprotectedvirtual

◆ getIntPtVaporMassFlowRate()

template<typename ShapeFunction, int GlobalDim>
virtual std::vector< double > const & ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::getIntPtVaporMassFlowRate ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverrideprotectedvirtual

◆ getIntPtVaporVolumeFraction()

template<typename ShapeFunction, int GlobalDim>
virtual std::vector< double > const & ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::getIntPtVaporVolumeFraction ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverrideprotectedvirtual

◆ getShapeMatrix()

template<typename ShapeFunction, int GlobalDim>
Eigen::Map< const Eigen::RowVectorXd > ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::getShapeMatrix ( const unsigned integration_point) const
inlineoverridevirtual

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 129 of file WellboreSimulatorFEM.h.

131 {
132 auto const& N = _ip_data[integration_point].N;
133
134 // assumes N is stored contiguously in memory
135 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
136 }

References _ip_data.

◆ postTimestepConcrete()

template<typename ShapeFunction, int GlobalDim>
void ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::postTimestepConcrete ( Eigen::VectorXd const & ,
Eigen::VectorXd const & ,
double const ,
double const ,
int const  )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 155 of file WellboreSimulatorFEM.h.

159 {
160 unsigned const n_integration_points =
161 _integration_method.getNumberOfPoints();
162
163 for (unsigned ip = 0; ip < n_integration_points; ip++)
164 {
165 _ip_data[ip].pushBackState();
166 }
167 }

References _integration_method, and _ip_data.

Member Data Documentation

◆ _element

template<typename ShapeFunction, int GlobalDim>
MeshLib::Element const& ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::_element
protected

◆ _element_direction

template<typename ShapeFunction, int GlobalDim>
Eigen::Vector3d ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::_element_direction
protected

Definition at line 225 of file WellboreSimulatorFEM.h.

Referenced by WellboreSimulatorFEM(), and assemble().

◆ _integration_method

◆ _ip_data

◆ _is_axially_symmetric

template<typename ShapeFunction, int GlobalDim>
bool const ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::_is_axially_symmetric
protected

Definition at line 222 of file WellboreSimulatorFEM.h.

Referenced by WellboreSimulatorFEM().

◆ _process_data

template<typename ShapeFunction, int GlobalDim>
WellboreSimulatorProcessData const& ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::_process_data
protected

◆ enthalpy_index

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::enthalpy_index = 2 * ShapeFunction::NPOINTS
staticprotected

Definition at line 234 of file WellboreSimulatorFEM.h.

Referenced by assemble().

◆ enthalpy_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::enthalpy_size = ShapeFunction::NPOINTS
staticprotected

Definition at line 238 of file WellboreSimulatorFEM.h.

◆ pressure_index

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::pressure_index = 0
staticprotected

Definition at line 232 of file WellboreSimulatorFEM.h.

Referenced by assemble().

◆ pressure_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::pressure_size = ShapeFunction::NPOINTS
staticprotected

Definition at line 236 of file WellboreSimulatorFEM.h.

◆ velocity_index

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::velocity_index = ShapeFunction::NPOINTS
staticprotected

Definition at line 233 of file WellboreSimulatorFEM.h.

Referenced by assemble().

◆ velocity_size

template<typename ShapeFunction, int GlobalDim>
const int ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::velocity_size = ShapeFunction::NPOINTS
staticprotected

Definition at line 237 of file WellboreSimulatorFEM.h.


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