diff --git a/opm/material/constraintsolvers/ChiFlash.hpp b/opm/material/constraintsolvers/ChiFlash.hpp index 8685f0cf7..a29eb89c1 100644 --- a/opm/material/constraintsolvers/ChiFlash.hpp +++ b/opm/material/constraintsolvers/ChiFlash.hpp @@ -158,11 +158,6 @@ public: } //phaseStabilityTestMichelsen_(isStable, K_scalar, fluid_state_scalar, z_scalar, verbosity); phaseStabilityTest_(isStable, K_scalar, fluid_state_scalar, z_scalar, verbosity); -/* for (int compIdx = 0; compIdx= 1) { @@ -198,11 +193,21 @@ public: // of the code // TODO: Does fluid_state_scalar contain z with derivatives? fluid_state_scalar.setLvalue(L_scalar); + fluid_state.setLvalue(L_scalar); + for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx) { + fluid_state.setKvalue(compIdx, K_scalar[compIdx]); + } updateDerivatives_(fluid_state_scalar, z, fluid_state); std::cout << " ------ SUMMARY ------ " << std::endl; - std::cout << " L " << L_scalar << std::endl; - std::cout << " K " << K_scalar << std::endl; + std::cout << " L " << fluid_state.L() << std::endl; + std::cout << " K " << fluid_state.K(0) << ", " << fluid_state.K(1) << ", " << fluid_state.K(2) << std::endl; + std::cout << " x " << fluid_state.moleFraction(oilPhaseIdx, 0) << ", " << fluid_state.moleFraction(oilPhaseIdx, 1) << ", " << fluid_state.moleFraction(oilPhaseIdx, 2) << std::endl; + std::cout << " y " << fluid_state.moleFraction(gasPhaseIdx, 0) << ", " << fluid_state.moleFraction(gasPhaseIdx, 1) << ", " << fluid_state.moleFraction(gasPhaseIdx, 2) << std::endl; + + + + fluid_state.setLvalue(L_scalar); // Update phases diff --git a/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh b/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh index ce5ce8299..ffcbf94ab 100644 --- a/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh +++ b/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh @@ -116,6 +116,28 @@ namespace Opm { return 0.0; } + //! \copydoc BaseFluidSystem::phaseName + static const char* phaseName(unsigned phaseIdx) + { + static const char* name[] = {"o", // oleic phase + "g"}; // gas phase + + assert(0 <= phaseIdx && phaseIdx < 2); + return name[phaseIdx]; + } + + //! \copydoc BaseFluidSystem::componentName + static const char* componentName(unsigned compIdx) + { + static const char* name[] = { + Comp0::name(), + Comp1::name(), + }; + + assert(0 <= compIdx && compIdx < 3); + return name[compIdx]; + } + /*! * \copydoc BaseFluidSystem::density */ @@ -143,7 +165,10 @@ namespace Opm { // Use LBC method to calculate viscosity // LhsEval mu = LBCviscosity::LBCmod(fluidState, paramCache, phaseIdx); // LhsEval mu = LBCviscosity::LBC(fluidState, paramCache, phaseIdx); - LhsEval mu = LBCviscosity::LBCJulia(fluidState, paramCache, phaseIdx); + LhsEval mu; + mu = LBCviscosity::LBCmod(fluidState, paramCache, phaseIdx); + + // LhsEval mu = LBCviscosity::LBCJulia(fluidState, paramCache, phaseIdx); return mu; }