diff --git a/dumux/implicit/2p2cni/2p2cnifluxvariables.hh b/dumux/implicit/2p2cni/2p2cnifluxvariables.hh index 4bae8dcdcf62f4918a97ce0b064993d04de87067..6249ebf176deeee803d52c983b32e6a5e8c31e55 100644 --- a/dumux/implicit/2p2cni/2p2cnifluxvariables.hh +++ b/dumux/implicit/2p2cni/2p2cnifluxvariables.hh @@ -145,19 +145,48 @@ protected: { const unsigned i = this->face().i; const unsigned j = this->face().j; + Scalar lambdaI, lambdaJ; - const Scalar lambdaI = - ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[i].saturation(wPhaseIdx), + if (GET_PROP_VALUE(TypeTag, ImplicitIsBox)) + { + lambdaI = + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[i].saturation(wPhaseIdx), elemVolVars[i].thermalConductivity(wPhaseIdx), elemVolVars[i].thermalConductivity(nPhaseIdx), problem.spatialParams().thermalConductivitySolid(element, this->fvGeometry_, i), problem.spatialParams().porosity(element, this->fvGeometry_, i)); - const Scalar lambdaJ = - ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[j].saturation(wPhaseIdx), + lambdaJ = + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[j].saturation(wPhaseIdx), elemVolVars[j].thermalConductivity(wPhaseIdx), elemVolVars[j].thermalConductivity(nPhaseIdx), problem.spatialParams().thermalConductivitySolid(element, this->fvGeometry_, j), problem.spatialParams().porosity(element, this->fvGeometry_, j)); + } + else + { + const Element& elementI = *this->fvGeometry_.neighbors[i]; + FVElementGeometry fvGeometryI; + fvGeometryI.subContVol[0].global = elementI.geometry().center(); + + lambdaI = + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[i].saturation(wPhaseIdx), + elemVolVars[i].thermalConductivity(wPhaseIdx), + elemVolVars[i].thermalConductivity(nPhaseIdx), + problem.spatialParams().thermalConductivitySolid(elementI, fvGeometryI, 0), + problem.spatialParams().porosity(elementI, fvGeometryI, 0)); + + const Element& elementJ = *this->fvGeometry_.neighbors[j]; + FVElementGeometry fvGeometryJ; + fvGeometryJ.subContVol[0].global = elementJ.geometry().center(); + + lambdaJ = + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[j].saturation(wPhaseIdx), + elemVolVars[j].thermalConductivity(wPhaseIdx), + elemVolVars[j].thermalConductivity(nPhaseIdx), + problem.spatialParams().thermalConductivitySolid(elementJ, fvGeometryJ, 0), + problem.spatialParams().porosity(elementJ, fvGeometryJ, 0)); + } + // -> harmonic mean lambdaEff_ = harmonicMean(lambdaI, lambdaJ); } diff --git a/dumux/implicit/2pni/2pnifluxvariables.hh b/dumux/implicit/2pni/2pnifluxvariables.hh index 71f5763bfcc8873a773a0169265713ee57dd8791..8e6025e4848b993b39e0e4d0befdadf3c943eef6 100644 --- a/dumux/implicit/2pni/2pnifluxvariables.hh +++ b/dumux/implicit/2pni/2pnifluxvariables.hh @@ -151,19 +151,48 @@ protected: { const unsigned i = this->face().i; const unsigned j = this->face().j; + Scalar lambdaI, lambdaJ; - const Scalar lambdaI = - ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[i].saturation(wPhaseIdx), + if (GET_PROP_VALUE(TypeTag, ImplicitIsBox)) + { + lambdaI = + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[i].saturation(wPhaseIdx), elemVolVars[i].thermalConductivity(wPhaseIdx), elemVolVars[i].thermalConductivity(nPhaseIdx), problem.spatialParams().thermalConductivitySolid(element, this->fvGeometry_, i), problem.spatialParams().porosity(element, this->fvGeometry_, i)); - const Scalar lambdaJ = - ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[j].saturation(wPhaseIdx), + lambdaJ = + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[j].saturation(wPhaseIdx), elemVolVars[j].thermalConductivity(wPhaseIdx), elemVolVars[j].thermalConductivity(nPhaseIdx), problem.spatialParams().thermalConductivitySolid(element, this->fvGeometry_, j), problem.spatialParams().porosity(element, this->fvGeometry_, j)); + } + else + { + const Element& elementI = *this->fvGeometry_.neighbors[i]; + FVElementGeometry fvGeometryI; + fvGeometryI.subContVol[0].global = elementI.geometry().center(); + + lambdaI = + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[i].saturation(wPhaseIdx), + elemVolVars[i].thermalConductivity(wPhaseIdx), + elemVolVars[i].thermalConductivity(nPhaseIdx), + problem.spatialParams().thermalConductivitySolid(elementI, fvGeometryI, 0), + problem.spatialParams().porosity(elementI, fvGeometryI, 0)); + + const Element& elementJ = *this->fvGeometry_.neighbors[j]; + FVElementGeometry fvGeometryJ; + fvGeometryJ.subContVol[0].global = elementJ.geometry().center(); + + lambdaJ = + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[j].saturation(wPhaseIdx), + elemVolVars[j].thermalConductivity(wPhaseIdx), + elemVolVars[j].thermalConductivity(nPhaseIdx), + problem.spatialParams().thermalConductivitySolid(elementJ, fvGeometryJ, 0), + problem.spatialParams().porosity(elementJ, fvGeometryJ, 0)); + } + // -> harmonic mean lambdaEff_ = harmonicMean(lambdaI, lambdaJ); }