Formatting fixes.
This commit is contained in:
parent
b93bb4fcf9
commit
3e294a4a81
@ -39,7 +39,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BlackoilPvtProperties::init(const EclipseGridParser& deck,const int samples)
|
void BlackoilPvtProperties::init(const EclipseGridParser& deck, const int samples)
|
||||||
{
|
{
|
||||||
typedef std::vector<std::vector<std::vector<double> > > table_t;
|
typedef std::vector<std::vector<std::vector<double> > > table_t;
|
||||||
// If we need multiple regions, this class and the SinglePvt* classes must change.
|
// If we need multiple regions, this class and the SinglePvt* classes must change.
|
||||||
|
@ -47,7 +47,7 @@ namespace Opm
|
|||||||
BlackoilPvtProperties();
|
BlackoilPvtProperties();
|
||||||
|
|
||||||
/// Initialize from deck.
|
/// Initialize from deck.
|
||||||
void init(const EclipseGridParser& deck,const int samples = 16);
|
void init(const EclipseGridParser& deck, const int samples = 16);
|
||||||
|
|
||||||
/// Number of active phases.
|
/// Number of active phases.
|
||||||
int numPhases() const;
|
int numPhases() const;
|
||||||
|
@ -106,15 +106,13 @@ namespace Opm
|
|||||||
double* output_B,
|
double* output_B,
|
||||||
double* output_dBdp) const
|
double* output_dBdp) const
|
||||||
{
|
{
|
||||||
//B(n, p, 0, output_B);
|
|
||||||
if (comp_) {
|
if (comp_) {
|
||||||
// #pragma omp parallel for
|
// #pragma omp parallel for
|
||||||
for (int i = 0; i < n; ++i) {
|
for (int i = 0; i < n; ++i) {
|
||||||
//output_dBdp[i] = -comp_*output_B[i];
|
|
||||||
double x = comp_*(p[i] - ref_press_);
|
double x = comp_*(p[i] - ref_press_);
|
||||||
double d= (1.0 + x + 0.5*x*x);
|
double d = (1.0 + x + 0.5*x*x);
|
||||||
output_B[i] = ref_B_/d;//(1.0 + x + 0.5*x*x);
|
output_B[i] = ref_B_/d;
|
||||||
output_dBdp[i] = (- ref_B_/(d*d))*(1 + x) *comp_;
|
output_dBdp[i] = (-ref_B_/(d*d))*(1 + x) * comp_;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::fill(output_B, output_B + n, ref_B_);
|
std::fill(output_B, output_B + n, ref_B_);
|
||||||
|
@ -33,7 +33,7 @@ namespace Opm
|
|||||||
// Member functions
|
// Member functions
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
/// Constructor
|
/// Constructor
|
||||||
SinglePvtDead::SinglePvtDead(const table_t& pvd_table,const int samples)
|
SinglePvtDead::SinglePvtDead(const table_t& pvd_table, const int samples)
|
||||||
{
|
{
|
||||||
const int region_number = 0;
|
const int region_number = 0;
|
||||||
if (pvd_table.size() != 1) {
|
if (pvd_table.size() != 1) {
|
||||||
|
@ -37,7 +37,7 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::vector<std::vector<std::vector<double> > > table_t;
|
typedef std::vector<std::vector<std::vector<double> > > table_t;
|
||||||
SinglePvtDead(const table_t& pvd_table,const int samples = 16);
|
SinglePvtDead(const table_t& pvd_table, const int samples = 16);
|
||||||
virtual ~SinglePvtDead();
|
virtual ~SinglePvtDead();
|
||||||
|
|
||||||
/// Viscosity as a function of p and z.
|
/// Viscosity as a function of p and z.
|
||||||
|
@ -188,26 +188,25 @@ namespace Opm {
|
|||||||
UniformTableLinear<T>
|
UniformTableLinear<T>
|
||||||
::derivative(const double xparam) const
|
::derivative(const double xparam) const
|
||||||
{
|
{
|
||||||
// Implements derivative consistent
|
// Implements derivative consistent
|
||||||
// with ClosestValue policy for function
|
// with ClosestValue policy for function
|
||||||
double value;
|
double value;
|
||||||
if(xparam > xmax_ || xparam < xmin_){
|
if (xparam > xmax_ || xparam < xmin_) {
|
||||||
value=0.0;
|
value = 0.0;
|
||||||
}else{
|
} else {
|
||||||
double x = std::min(xparam, xmax_);
|
double x = std::min(xparam, xmax_);
|
||||||
x = std::max(x, xmin_);
|
x = std::max(x, xmin_);
|
||||||
|
// Lookup is easy since we are uniform in x.
|
||||||
// Lookup is easy since we are uniform in x.
|
double pos = (x - xmin_)/xdelta_;
|
||||||
double pos = (x - xmin_)/xdelta_;
|
double posi = std::floor(pos);
|
||||||
double posi = std::floor(pos);
|
int left = int(posi);
|
||||||
int left = int(posi);
|
if (left == int(y_values_.size()) - 1) {
|
||||||
if (left == int(y_values_.size()) - 1) {
|
// We are at xmax_
|
||||||
// We are at xmax_
|
--left;
|
||||||
--left;
|
}
|
||||||
|
value = (y_values_[left + 1] - y_values_[left])/xdelta_;
|
||||||
}
|
}
|
||||||
value = (y_values_[left + 1] - y_values_[left])/xdelta_;
|
return value;
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user