mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
New singularPressure() method propagates singularity information.
This commit is contained in:
@@ -77,7 +77,8 @@ namespace Opm
|
|||||||
wells_(wells),
|
wells_(wells),
|
||||||
htrans_(grid.cell_facepos[ grid.number_of_cells ]),
|
htrans_(grid.cell_facepos[ grid.number_of_cells ]),
|
||||||
trans_ (grid.number_of_faces),
|
trans_ (grid.number_of_faces),
|
||||||
allcells_(grid.number_of_cells)
|
allcells_(grid.number_of_cells),
|
||||||
|
singular_(false)
|
||||||
{
|
{
|
||||||
if (wells_ && (wells_->number_of_phases != props.numPhases())) {
|
if (wells_ && (wells_->number_of_phases != props.numPhases())) {
|
||||||
THROW("Inconsistent number of phases specified (wells vs. props): "
|
THROW("Inconsistent number of phases specified (wells vs. props): "
|
||||||
@@ -189,6 +190,21 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// @brief After solve(), was the resulting pressure singular.
|
||||||
|
/// Returns true if the pressure is singular in the following
|
||||||
|
/// sense: if everything is incompressible and there are no
|
||||||
|
/// pressure conditions, the absolute values of the pressure
|
||||||
|
/// solution are arbitrary. (But the differences in pressure
|
||||||
|
/// are significant.)
|
||||||
|
bool CompressibleTpfa::singularPressure() const
|
||||||
|
{
|
||||||
|
return singular_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Compute well potentials.
|
/// Compute well potentials.
|
||||||
void CompressibleTpfa::computeWellPotentials(const BlackoilState& state)
|
void CompressibleTpfa::computeWellPotentials(const BlackoilState& state)
|
||||||
{
|
{
|
||||||
@@ -487,16 +503,20 @@ namespace Opm
|
|||||||
cq.Af = &face_A_[0];
|
cq.Af = &face_A_[0];
|
||||||
cq.phasemobf = &face_phasemob_[0];
|
cq.phasemobf = &face_phasemob_[0];
|
||||||
cq.voldiscr = &cell_voldisc_[0];
|
cq.voldiscr = &cell_voldisc_[0];
|
||||||
|
int was_adjusted = 0;
|
||||||
if (rock_comp_props_ == NULL || !rock_comp_props_->isActive()) {
|
if (rock_comp_props_ == NULL || !rock_comp_props_->isActive()) {
|
||||||
cfs_tpfa_res_assemble(gg, dt, &forces, z, &cq, &trans_[0],
|
was_adjusted =
|
||||||
&face_gravcap_[0], cell_press, well_bhp,
|
cfs_tpfa_res_assemble(gg, dt, &forces, z, &cq, &trans_[0],
|
||||||
&porevol_[0], h_);
|
&face_gravcap_[0], cell_press, well_bhp,
|
||||||
|
&porevol_[0], h_);
|
||||||
} else {
|
} else {
|
||||||
cfs_tpfa_res_comprock_assemble(gg, dt, &forces, z, &cq, &trans_[0],
|
was_adjusted =
|
||||||
&face_gravcap_[0], cell_press, well_bhp,
|
cfs_tpfa_res_comprock_assemble(gg, dt, &forces, z, &cq, &trans_[0],
|
||||||
&porevol_[0], &initial_porevol_[0],
|
&face_gravcap_[0], cell_press, well_bhp,
|
||||||
&rock_comp_[0], h_);
|
&porevol_[0], &initial_porevol_[0],
|
||||||
|
&rock_comp_[0], h_);
|
||||||
}
|
}
|
||||||
|
singular_ = (was_adjusted == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,14 @@ namespace Opm
|
|||||||
BlackoilState& state,
|
BlackoilState& state,
|
||||||
WellState& well_state);
|
WellState& well_state);
|
||||||
|
|
||||||
|
/// @brief After solve(), was the resulting pressure singular.
|
||||||
|
/// Returns true if the pressure is singular in the following
|
||||||
|
/// sense: if everything is incompressible and there are no
|
||||||
|
/// pressure conditions, the absolute values of the pressure
|
||||||
|
/// solution are arbitrary. (But the differences in pressure
|
||||||
|
/// are significant.)
|
||||||
|
bool singularPressure() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void computePerSolveDynamicData(const double dt,
|
void computePerSolveDynamicData(const double dt,
|
||||||
const BlackoilState& state,
|
const BlackoilState& state,
|
||||||
@@ -143,11 +151,11 @@ namespace Opm
|
|||||||
std::vector<double> rock_comp_; // Empty unless rock_comp_props_ is non-null.
|
std::vector<double> rock_comp_; // Empty unless rock_comp_props_ is non-null.
|
||||||
// The update to be applied to the pressures (cell and bhp).
|
// The update to be applied to the pressures (cell and bhp).
|
||||||
std::vector<double> pressure_increment_;
|
std::vector<double> pressure_increment_;
|
||||||
|
// True if the matrix assembled would be singular but for the
|
||||||
|
// adjustment made in the cfs_*_assemble() calls. This happens
|
||||||
|
// if everything is incompressible and there are no pressure
|
||||||
|
// conditions.
|
||||||
|
bool singular_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|||||||
Reference in New Issue
Block a user