cleaned PengRobinson, uncommented the stuff about extrema in the case of one rott - I think it can just be as it was

This commit is contained in:
Trine Mykkeltvedt 2022-06-23 14:35:51 +02:00
parent 06ef3bdc62
commit 13cc0a8197

View File

@ -186,10 +186,8 @@ public:
Valgrind::CheckDefined(a2); Valgrind::CheckDefined(a2);
Valgrind::CheckDefined(a3); Valgrind::CheckDefined(a3);
Valgrind::CheckDefined(a4); Valgrind::CheckDefined(a4);
// std::cout << "Cubic params : " << a1 << " " << a2 << " " << a3 << " " << a4 << std::endl;
// int numSol = invertCubicPolynomial(Z, a1, a2, a3, a4); // int numSol = invertCubicPolynomial(Z, a1, a2, a3, a4);
int numSol = cubicRoots(Z, a1, a2, a3, a4); int numSol = cubicRoots(Z, a1, a2, a3, a4);
// std::cout << "Z = " << Z[0] << " " << Z[1] << " " << Z[2] << std::endl;
if (numSol == 3) { if (numSol == 3) {
// the EOS has three intersections with the pressure, // the EOS has three intersections with the pressure,
// i.e. the molar volume of gas is the largest one and the // i.e. the molar volume of gas is the largest one and the
@ -207,26 +205,26 @@ public:
Vm = VmCubic; Vm = VmCubic;
// find the extrema (if they are present) // find the extrema (if they are present)
// Evaluation Vmin, Vmax, pmin, pmax; Evaluation Vmin, Vmax, pmin, pmax;
// if (findExtrema_(Vmin, Vmax, if (findExtrema_(Vmin, Vmax,
// pmin, pmax, pmin, pmax,
// a, b, T)) a, b, T))
// { {
// if (isGasPhase) if (isGasPhase)
// Vm = std::max(Vmax, VmCubic); Vm = std::max(Vmax, VmCubic);
// else { else {
// if (Vmin > 0) if (Vmin > 0)
// Vm = std::min(Vmin, VmCubic); Vm = std::min(Vmin, VmCubic);
// else else
// Vm = VmCubic; Vm = VmCubic;
// } }
// } }
// else { else {
// // the EOS does not exhibit any physically meaningful // the EOS does not exhibit any physically meaningful
// // extrema, and the fluid is critical... // extrema, and the fluid is critical...
// Vm = VmCubic; Vm = VmCubic;
// handleCriticalFluid_(Vm, fs, params, phaseIdx, isGasPhase); handleCriticalFluid_(Vm, fs, params, phaseIdx, isGasPhase);
// } }
} }
Valgrind::CheckDefined(Vm); Valgrind::CheckDefined(Vm);
@ -532,27 +530,9 @@ protected:
const Evaluation& VmGas) const Evaluation& VmGas)
{ return fugacity(params, T, p, VmLiquid) - fugacity(params, T, p, VmGas); } { return fugacity(params, T, p, VmLiquid) - fugacity(params, T, p, VmGas); }
/*
static UniformTabulated2DFunction<Scalar> criticalTemperature_;
static UniformTabulated2DFunction<Scalar> criticalPressure_;
static UniformTabulated2DFunction<Scalar> criticalMolarVolume_;
*/
}; };
/*
template <class Scalar>
const Scalar PengRobinson<Scalar>::R = Opm::Constants<Scalar>::R;
template <class Scalar>
UniformTabulated2DFunction<Scalar> PengRobinson<Scalar>::criticalTemperature_;
template <class Scalar>
UniformTabulated2DFunction<Scalar> PengRobinson<Scalar>::criticalPressure_;
template <class Scalar>
UniformTabulated2DFunction<Scalar> PengRobinson<Scalar>::criticalMolarVolume_;
*/
} // namespace Opm } // namespace Opm
#endif #endif