30template <
typename ShapeFunction,
int GlobalDim>
40 typename ShapeMatricesType::template VectorType<
NUM_NODAL_DOF *
41 ShapeFunction::NPOINTS>;
56 bool const is_axially_symmetric,
64 auto const& p0 = element.
getNode(0)->asEigenVector3d();
65 auto const& p1 = element.
getNode(1)->asEigenVector3d();
69 unsigned const n_integration_points =
71 _ip_data.reserve(n_integration_points);
73 auto const shape_matrices =
75 GlobalDim>(element, is_axially_symmetric,
82 auto const& liquid_phase = medium.phase(
"AqueousLiquid");
84 for (
unsigned ip = 0; ip < n_integration_points; ip++)
87 shape_matrices[ip].N, shape_matrices[ip].dNdx,
89 shape_matrices[ip].integralMeasure *
90 shape_matrices[ip].detJ);
108 .template value<double>(vars, pos, 0, 0);
113 .template value<double>(vars, pos, 0, 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;
122 void assemble(
double const t,
double const dt,
123 std::vector<double>
const& local_x,
124 std::vector<double>
const& local_x_prev,
125 std::vector<double>& local_M_data,
126 std::vector<double>& local_K_data,
127 std::vector<double>& local_b_data)
override;
137 double const liquid_water_density,
138 double const v_mix,
double const dryness,
139 double const C_0,
double const u_gu,
142 double const rho_mix =
143 alpha * vapor_water_density + (1 - alpha) * liquid_water_density;
146 dryness * liquid_water_density * rho_mix * v_mix -
147 alpha * C_0 * dryness * liquid_water_density * rho_mix * v_mix -
148 alpha * C_0 * (1 - dryness) * vapor_water_density * rho_mix *
150 alpha * vapor_water_density * liquid_water_density * u_gu;
154 double const liquid_water_density,
155 double const v_mix,
double const dryness,
156 double const C_0,
double const u_gu,
159 Jac(0) = dryness * liquid_water_density * v_mix *
160 (vapor_water_density - liquid_water_density) -
161 (C_0 * dryness * liquid_water_density +
162 C_0 * (1 - dryness) * vapor_water_density) *
163 (2 * alpha * vapor_water_density +
164 (1 - 2 * alpha) * liquid_water_density) *
166 vapor_water_density * liquid_water_density * u_gu;
170 const unsigned integration_point)
const override
172 auto const& N =
_ip_data[integration_point].N;
175 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
181 Eigen::VectorXd
const& ,
182 Eigen::VectorXd
const& )
override
184 auto const n_integration_points =
186 auto const ele_id =
_element.getID();
190 [](
double const s,
auto const& ip)
191 { return s + ip.mix_density; }) /
192 n_integration_points;
196 Eigen::VectorXd
const& ,
197 double const ,
double const ,
200 unsigned const n_integration_points =
203 for (
unsigned ip = 0; ip < n_integration_points; ip++)
212 std::vector<GlobalVector*>
const& ,
213 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
214 std::vector<double>& cache)
const override
222 std::vector<GlobalVector*>
const& ,
223 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
224 std::vector<double>& cache)
const override
232 std::vector<GlobalVector*>
const& ,
233 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
234 std::vector<double>& cache)
const override
242 std::vector<GlobalVector*>
const& ,
243 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
244 std::vector<double>& cache)
const override
252 std::vector<GlobalVector*>
const& ,
253 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
254 std::vector<double>& cache)
const override
269 std::vector<IpData, Eigen::aligned_allocator<IpData>>
_ip_data;
EigenFixedShapeMatrixPolicy< ShapeFunction, GlobalDim > ShapeMatrixPolicyType
double liquid_phase_pressure
virtual const Node * getNode(unsigned idx) const =0
void setElementID(std::size_t element_id)
virtual std::vector< double > const & getIntPtVaporVolumeFraction(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
MeshLib::Element const & _element
WellboreSimulatorProcessData const & _process_data
virtual std::vector< double > const & getIntPtTemperature(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
typename ShapeMatricesType::NodalVectorType NodalVectorType
WellboreSimulatorFEM(MeshLib::Element const &element, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, WellboreSimulatorProcessData const &process_data)
typename ShapeMatricesType::template MatrixType< NUM_NODAL_DOF *ShapeFunction::NPOINTS, NUM_NODAL_DOF *ShapeFunction::NPOINTS > LocalMatrixType
static const int velocity_index
Eigen::Matrix< double, jacobian_residual_size, 1 > UnknownVector
typename ShapeMatricesType::GlobalDimMatrixType GlobalDimMatrixType
static const int velocity_size
typename ShapeMatricesType::GlobalDimNodalMatrixType GlobalDimNodalMatrixType
static const int pressure_index
void calculateJacobian(double const alpha, double const vapor_water_density, double const liquid_water_density, double const v_mix, double const dryness, double const C_0, double const u_gu, JacobianMatrix &Jac)
bool const _is_axially_symmetric
Eigen::Matrix< double, jacobian_residual_size, 1 > ResidualVector
NumLib::GenericIntegrationMethod const & _integration_method
static const int enthalpy_index
Eigen::Matrix< double, jacobian_residual_size, jacobian_residual_size, Eigen::RowMajor > JacobianMatrix
Eigen::Vector3d _element_direction
typename ShapeMatricesType::ShapeMatrices ShapeMatrices
static const int enthalpy_size
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix(const unsigned integration_point) const override
Provides the shape matrix at the given integration point.
ShapeMatrixPolicyType< ShapeFunction, GlobalDim > ShapeMatricesType
typename ShapeMatricesType::NodalRowVectorType NodalRowVectorType
typename ShapeMatricesType::GlobalDimVectorType GlobalDimVectorType
virtual std::vector< double > const & getIntPtLiquidMassFlowRate(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
typename ShapeMatricesType::template VectorType< NUM_NODAL_DOF * ShapeFunction::NPOINTS > LocalVectorType
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
void postTimestepConcrete(Eigen::VectorXd const &, Eigen::VectorXd const &, double const, double const, int const) override
void computeSecondaryVariableConcrete(double const, double const, Eigen::VectorXd const &, Eigen::VectorXd const &) override
void calculateResidual(double const alpha, double const vapor_water_density, double const liquid_water_density, double const v_mix, double const dryness, double const C_0, double const u_gu, ResidualVector &res)
static const int pressure_size
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 & getIntPtVaporMassFlowRate(const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
static int const jacobian_residual_size
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
IntegrationPointData< NodalRowVectorType, GlobalDimNodalMatrixType > IpData
WellboreSimulatorLocalAssemblerInterface()=default
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
const unsigned NUM_NODAL_DOF
std::vector< double > const & getIntegrationPointScalarData(IntegrationPointDataVector const &ip_data_vector, MemberType IpData::*const member, std::vector< double > &cache)
NumLib::ShapeMatrices< NodalRowVectorType, DimNodalMatrixType, DimMatrixType, GlobalDimNodalMatrixType > ShapeMatrices
MatrixType< GlobalDim, ShapeFunction::NPOINTS > GlobalDimNodalMatrixType
MatrixType< GlobalDim, GlobalDim > GlobalDimMatrixType
VectorType< GlobalDim > GlobalDimVectorType
VectorType< ShapeFunction::NPOINTS > NodalVectorType
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType
double liquid_mass_flow_rate
double vapor_volume_fraction
double vapor_mass_flow_rate