OGS
TwoPhaseFlowWithPrhoMaterialProperties.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <memory>
14#include <vector>
15
24
25namespace MeshLib
26{
27template <typename PROP_VAL_TYPE>
29}
30
32{
34{
35public:
37
39 MeshLib::PropertyVector<int> const* material_ids,
40 std::vector<std::unique_ptr<
42 capillary_pressure_models,
43 std::vector<
44 std::unique_ptr<MaterialLib::PorousMedium::RelativePermeability>>&&
45 relative_permeability_models);
46
47 int getMaterialID(const std::size_t element_id);
48
50 const double t, const ParameterLib::SpatialPosition& pos,
51 const double p, const double T, const double saturation) const;
52 double getWetRelativePermeability(const double t,
54 const double p, const double T,
55 const double saturation) const;
56 double getCapillaryPressure(const int material_id, const double t,
58 const double p, const double T,
59 const double saturation) const;
61 const int material_id, const double t,
62 const ParameterLib::SpatialPosition& pos, const double p,
63 const double T, const double saturation) const;
64 bool computeConstitutiveRelation(double const t,
66 const int material_id,
67 double const pg,
68 double const X,
69 double const T,
70 double& Sw,
71 double& X_m,
72 double& dsw_dpg,
73 double& dsw_dX,
74 double& dxm_dpg,
75 double& dxm_dX);
76
77protected:
82
83 std::vector<
84 std::unique_ptr<MaterialLib::PorousMedium::CapillaryPressureSaturation>>
86 std::vector<
87 std::unique_ptr<MaterialLib::PorousMedium::RelativePermeability>>
89
90private:
91 static int const jacobian_residual_size = 2;
92 using ResidualVector = Eigen::Matrix<double, jacobian_residual_size, 1>;
95 Eigen::RowMajor>;
96 using UnknownVector = Eigen::Matrix<double, jacobian_residual_size, 1>;
97
98private:
102 void calculateResidual(const int material_id, double const pl,
103 double const X, double const T, double Sw,
104 double rho_h2_wet, ResidualVector& res);
108 void calculateJacobian(const int material_id, double const t,
110 double const pl, double const X, double const T,
111 JacobianMatrix& Jac, double Sw, double rho_h2_wet);
115 static double calculateEquilibiumRhoWetLight(double const pg,
116 double const Sw,
117 double const rho_wet_h2);
121 static double calculateSaturation(double /*PL*/, double X, double Sw,
122 double rho_wet_h2, double rho_nonwet_h2,
123 double /*T*/);
127 double calculatedSwdP(double pl, double S, double rho_wet_h2,
128 double const T, int current_material_id) const;
132 double calculatedSwdX(double const pl, const double /*X*/, const double S,
133 const double rho_wet_h2, double const T,
134 int current_material_id) const;
138 double calculatedXmdX(double pl, double Sw, double rho_wet_h2, double dSwdX,
139 int current_material_id) const;
143 double calculatedXmdP(double pl, double Sw, double rho_wet_h2, double dSwdP,
144 int current_material_id) const;
145};
146
147} // namespace ProcessLib::TwoPhaseFlowWithPrho
Definition of the PiecewiseLinearInterpolation class.
std::array< double, PropertyVariableNumber > ArrayType
static double calculateSaturation(double, double X, double Sw, double rho_wet_h2, double rho_nonwet_h2, double)
double calculatedXmdP(double pl, double Sw, double rho_wet_h2, double dSwdP, int current_material_id) const
std::vector< std::unique_ptr< MaterialLib::PorousMedium::CapillaryPressureSaturation > > _capillary_pressure_models
double calculatedSwdX(double const pl, const double, const double S, const double rho_wet_h2, double const T, int current_material_id) const
double getNonwetRelativePermeability(const double t, const ParameterLib::SpatialPosition &pos, const double p, const double T, const double saturation) const
void calculateResidual(const int material_id, double const pl, double const X, double const T, double Sw, double rho_h2_wet, ResidualVector &res)
double getWetRelativePermeability(const double t, const ParameterLib::SpatialPosition &pos, const double p, const double T, const double saturation) const
void calculateJacobian(const int material_id, double const t, ParameterLib::SpatialPosition const &x, double const pl, double const X, double const T, JacobianMatrix &Jac, double Sw, double rho_h2_wet)
TwoPhaseFlowWithPrhoMaterialProperties(MeshLib::PropertyVector< int > const *material_ids, std::vector< std::unique_ptr< MaterialLib::PorousMedium::CapillaryPressureSaturation > > &&capillary_pressure_models, std::vector< std::unique_ptr< MaterialLib::PorousMedium::RelativePermeability > > &&relative_permeability_models)
static double calculateEquilibiumRhoWetLight(double const pg, double const Sw, double const rho_wet_h2)
double getCapillaryPressureDerivative(const int material_id, const double t, const ParameterLib::SpatialPosition &pos, const double p, const double T, const double saturation) const
Eigen::Matrix< double, jacobian_residual_size, jacobian_residual_size, Eigen::RowMajor > JacobianMatrix
double calculatedSwdP(double pl, double S, double rho_wet_h2, double const T, int current_material_id) const
double getCapillaryPressure(const int material_id, const double t, const ParameterLib::SpatialPosition &pos, const double p, const double T, const double saturation) const
bool computeConstitutiveRelation(double const t, ParameterLib::SpatialPosition const &x, const int material_id, double const pg, double const X, double const T, double &Sw, double &X_m, double &dsw_dpg, double &dsw_dX, double &dxm_dpg, double &dxm_dX)
double calculatedXmdX(double pl, double Sw, double rho_wet_h2, double dSwdX, int current_material_id) const
std::vector< std::unique_ptr< MaterialLib::PorousMedium::RelativePermeability > > _relative_permeability_models