24#ifndef DUMUX_DISCRETIZATION_STAGGERED_FOURIERS_LAW_HH
25#define DUMUX_DISCRETIZATION_STAGGERED_FOURIERS_LAW_HH
37template<
class TypeTag, DiscretizationMethod discMethod>
38class FouriersLawImplementation;
44template <
class TypeTag>
49 using FVElementGeometry =
typename GridGeometry::LocalView;
50 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
53 using Element =
typename GridGeometry::GridView::template Codim<0>::Entity;
71 template<
class Problem>
72 static Scalar
flux(
const Problem& problem,
73 const Element& element,
74 const FVElementGeometry& fvGeometry,
75 const ElementVolumeVariables& elemVolVars,
76 const SubControlVolumeFace &scvf)
81 if (scvf.boundary() && problem.boundaryTypes(element, scvf).isOutflow(Indices::energyEqIdx))
84 const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
85 const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
86 const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
88 const Scalar insideTemperature = insideVolVars.temperature();
89 const Scalar outsideTemperature = outsideVolVars.temperature();
91 const Scalar insideLambda = insideVolVars.effectiveThermalConductivity() * insideVolVars.extrusionFactor();
92 const Scalar insideDistance = (insideScv.dofPosition() - scvf.ipGlobal()).two_norm();
96 flux = insideLambda * (insideTemperature - outsideTemperature) / insideDistance;
100 const auto& outsideScv = fvGeometry.scv(scvf.outsideScvIdx());
101 const Scalar outsideLambda = outsideVolVars.effectiveThermalConductivity() * outsideVolVars.extrusionFactor();
102 const Scalar outsideDistance = (outsideScv.dofPosition() - scvf.ipGlobal()).two_norm();
103 const Scalar avgLambda =
harmonicMean(insideLambda, outsideLambda, insideDistance, outsideDistance);
105 flux = avgLambda * (insideTemperature - outsideTemperature) / (insideDistance + outsideDistance);
108 flux *= Extrusion::area(scvf);
Define some often used mathematical functions.
The available discretization methods in Dumux.
Helper classes to compute the integration elements.
Classes related to flux variables caching.
DiscretizationMethod
The available discretization methods in Dumux.
Definition: method.hh:37
constexpr Scalar harmonicMean(Scalar x, Scalar y, Scalar wx=1.0, Scalar wy=1.0) noexcept
Calculate the (weighted) harmonic mean of two scalar values.
Definition: math.hh:68
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:177
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
forward declaration of the method-specific implementation
Definition: flux/fourierslaw.hh:37
Definition: fluxvariablescaching.hh:64
static Scalar flux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf)
Returns the heat flux within the porous medium (in J/s) across the given sub-control volume face.
Definition: flux/staggered/freeflow/fourierslaw.hh:72
Declares all properties used in Dumux.