25#ifndef DUMUX_DISCRETIZATION_BOX_FOURIERS_LAW_NONEQUILIBRIUM_HH
26#define DUMUX_DISCRETIZATION_BOX_FOURIERS_LAW_NONEQUILIBRIUM_HH
28#include <dune/common/float_cmp.hh>
40template <
class TypeTag, DiscretizationMethod discMethod>
41class FouriersLawNonEquilibriumImplementation;
47template <
class TypeTag>
53 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
59 using Element =
typename GridView::template Codim<0>::Entity;
61 static constexpr auto numEnergyEqFluid = getPropValue<TypeTag, Properties::NumEnergyEqFluid>();
62 static constexpr auto sPhaseIdx = ModelTraits::numFluidPhases();
65 static Scalar
flux(
const Problem& problem,
66 const Element& element,
67 const FVElementGeometry& fvGeometry,
68 const ElementVolumeVariables& elemVolVars,
69 const SubControlVolumeFace& scvf,
71 const ElementFluxVariablesCache& elemFluxVarsCache)
74 const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
75 const auto& outsideScv = fvGeometry.scv(scvf.outsideScvIdx());
76 const auto& insideVolVars = elemVolVars[insideScv];
77 const auto& outsideVolVars = elemVolVars[outsideScv];
78 Scalar insideLambda = 0.0;
79 Scalar outsideLambda = 0.0;
81 if (phaseIdx != sPhaseIdx)
84 if (numEnergyEqFluid < ModelTraits::numFluidPhases())
86 insideLambda += Deprecated::template effectiveThermalConductivity<ThermalConductivityModel>(
87 insideVolVars, problem.spatialParams(), element, fvGeometry, insideScv);
88 outsideLambda += Deprecated::template effectiveThermalConductivity<ThermalConductivityModel>(
89 outsideVolVars, problem.spatialParams(), element, fvGeometry, outsideScv);
93 insideLambda += insideVolVars.fluidThermalConductivity(phaseIdx)*insideVolVars.saturation(phaseIdx)*insideVolVars.porosity();
94 outsideLambda += outsideVolVars.fluidThermalConductivity(phaseIdx)*outsideVolVars.saturation(phaseIdx)*outsideVolVars.porosity();
100 insideLambda += insideVolVars.solidThermalConductivity()*(1.0-insideVolVars.porosity());
101 outsideLambda += outsideVolVars.solidThermalConductivity()*(1.0-outsideVolVars.porosity());
105 insideLambda *= insideVolVars.extrusionFactor();
106 outsideLambda *= outsideVolVars.extrusionFactor();
109 const auto lambda = problem.spatialParams().harmonicMean(insideLambda, outsideLambda, scvf.unitOuterNormal());
112 const auto& fluxVarsCache = elemFluxVarsCache[scvf];
114 Dune::FieldVector<Scalar, GridView::dimensionworld> gradTemp(0.0);
115 for (
auto&& scv : scvs(fvGeometry))
118 if (phaseIdx < numEnergyEqFluid)
119 gradTemp.axpy(elemVolVars[scv].temperatureFluid(phaseIdx), fluxVarsCache.gradN(scv.indexInElement()));
121 gradTemp.axpy(elemVolVars[scv].temperatureSolid(), fluxVarsCache.gradN(scv.indexInElement()));
125 return -1.0*
vtmv(scvf.unitOuterNormal(), lambda, gradTemp)*scvf.area();
Define some often used mathematical functions.
The available discretization methods in Dumux.
DiscretizationMethod
The available discretization methods in Dumux.
Definition: method.hh:37
Dune::DenseMatrix< MAT >::value_type vtmv(const Dune::DenseVector< V1 > &v1, const Dune::DenseMatrix< MAT > &M, const Dune::DenseVector< V2 > &v2)
Evaluates the scalar product of a vector v2, projected by a matrix M, with a vector v1.
Definition: math.hh:840
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
Definition: fourierslawnonequilibrium.hh:36
static Scalar flux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const int phaseIdx, const ElementFluxVariablesCache &elemFluxVarsCache)
Definition: box/fourierslawnonequilibrium.hh:65
Declares all properties used in Dumux.