static Scalar heatConductivity(const Params ¶ms, const FluidState &fluidState) { Valgrind::CheckDefined(params.vacuumLambda()); Scalar lambda = 0; for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { Valgrind::CheckDefined(params.fullySaturatedLambda(phaseIdx)); if (FluidSystem::isLiquid(phaseIdx)) { lambda += regularizedSqrt_(std::max(0.0, std::min(1.0, fluidState.saturation(phaseIdx)))) * (params.fullySaturatedLambda(phaseIdx) - params.vacuumLambda()); } else { // gas phase lambda += params.fullySaturatedLambda(phaseIdx) - params.vacuumLambda(); } }; lambda += params.vacuumLambda(); assert(lambda >= 0); return lambda; }
static Evaluation thermalConductivity(const Params& params, const FluidState& fluidState) { Valgrind::CheckDefined(params.vacuumLambda()); Evaluation lambda = 0; for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { Valgrind::CheckDefined(params.fullySaturatedLambda(phaseIdx)); if (FluidSystem::isLiquid(phaseIdx)) { const auto& sat = Opm::decay<Evaluation>(fluidState.saturation(phaseIdx)); lambda += regularizedSqrt_(Opm::max(0.0, Opm::min(1.0, sat))) * (params.fullySaturatedLambda(phaseIdx) - params.vacuumLambda()); } else { // gas phase lambda += params.fullySaturatedLambda(phaseIdx) - params.vacuumLambda(); } }; lambda += params.vacuumLambda(); assert(lambda >= 0); return lambda; }