76 double const , std::vector<GlobalVector*>
const& x,
83 unsigned const n_integration_points =
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);
95 std::vector<double>
const local_pressure =
96 x[process_id]->get(indices_pressure);
97 std::vector<double>
const local_velocity =
98 x[process_id]->get(indices_velocity);
99 std::vector<double>
const local_enthalpy =
100 x[process_id]->get(indices_enthalpy);
102 auto const& medium = *
_data.media_map.getMedium(
_element.getID());
103 auto const& liquid_phase =
105 auto const& gas_phase =
113 for (
unsigned ip = 0; ip < n_integration_points; ip++)
116 auto const& N = n_and_weight.N;
117 auto const& w = n_and_weight.weight;
119 double pressure_int_pt = 0.0;
120 double velocity_int_pt = 0.0;
121 double enthalpy_int_pt = 0.0;
144 double T_int_pt = 0.;
145 double liquid_water_density = 0.;
146 double vapour_water_density = 0.;
148 std::optional<MaterialPropertyLib::DriftFluxState> drift_flux_state;
150 if (pressure_int_pt >
157 .template value<double>(vars, pos, 0, 0);
161 pressure_int_pt, T_int_pt,
162 "the compressed liquid state of the "
163 "WellboreCompensateNeumann boundary condition");
165 liquid_water_density =
168 .template value<double>(vars, pos, 0, 0);
172 liquid_water_density =
176 .template value<double>(vars, pos, 0, 0);
178 vapour_water_density =
182 .template value<double>(vars, pos, 0, 0);
184 double const h_sat_liq_w =
188 .template value<double>(vars, pos, 0, 0);
190 double const h_sat_vap_w =
194 .template value<double>(vars, pos, 0, 0);
197 enthalpy_int_pt, h_sat_liq_w, h_sat_vap_w);
204 .template value<double>(vars, pos, 0, 0)
207 saturation_temperature)
208 .template value<double>(vars, pos, 0, 0);
223 dryness, T_int_pt, vapour_water_density,
224 liquid_water_density, velocity_int_pt);
227 auto const alpha_solution =
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, {}",
240 _element.getID(), ip, pressure_int_pt, velocity_int_pt,
241 enthalpy_int_pt, T_int_pt,
243 *drift_flux_state)));
246 alpha = *alpha_solution;
250 liquid_water_density =
254 .template value<double>(vars, pos, 0, 0);
258 double const mix_density = vapour_water_density * alpha +
259 liquid_water_density * (1 - alpha);
263 alpha, *drift_flux_state)
266 double const neumann_ip_values =
267 _data.coefficients.pressure * mix_density * velocity_int_pt +
268 _data.coefficients.velocity *
269 (mix_density * velocity_int_pt * velocity_int_pt + gamma) +
270 _data.coefficients.enthalpy * mix_density * velocity_int_pt *
271 velocity_int_pt * velocity_int_pt * 0.5;
272 _local_rhs.noalias() += N.transpose() * neumann_ip_values * w;
275 b.
add(indices_current_variable, _local_rhs);