75 static Scalar
flux(
const Problem& problem,
76 const Element& element,
77 const FVElementGeometry& fvGeometry,
78 const ElementVolumeVariables& elemVolVars,
79 const SubControlVolumeFace& scvf,
80 const ElementFluxVarsCache& elemFluxVarCache)
83 if (!scvf.interiorBoundary())
84 return ParentType::flux(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarCache);
87 if ( !Dune::FloatCmp::eq(xi, 1.0, 1e-6) )
88 DUNE_THROW(Dune::NotImplemented,
"Xi != 1.0 cannot be used with the Box-Facet-Coupling scheme");
91 const auto& fluxVarCache = elemFluxVarCache[scvf];
92 const auto& shapeValues = fluxVarCache.shapeValues();
93 const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
94 const auto& insideVolVars = elemVolVars[insideScv];
97 const auto bcTypes = problem.interiorBoundaryTypes(element, scvf);
98 if (bcTypes.hasOnlyNeumann())
101 const auto& facetVolVars = problem.couplingManager().getLowDimVolVars(element, scvf);
105 for (
const auto& scv : scvs(fvGeometry))
106 T += elemVolVars[scv].temperature()*shapeValues[scv.indexInElement()][0];
112 const auto a = facetVolVars.extrusionFactor();
113 auto gradT = scvf.unitOuterNormal();
114 gradT *= dim == dimWorld ? 0.5*a : 0.5*sqrt(a);
115 gradT /= gradT.two_norm2();
116 gradT *= (facetVolVars.temperature() - T);
118 return -1.0*scvf.area()
119 *insideVolVars.extrusionFactor()
120 *
vtmv(scvf.unitOuterNormal(),
121 facetVolVars.effectiveThermalConductivity(),
126 else if (bcTypes.hasOnlyDirichlet())
129 std::vector<Scalar> temperatures(element.subEntities(dim));
130 for (
const auto& scv : scvs(fvGeometry))
131 temperatures[scv.localDofIndex()] = elemVolVars[scv].temperature();
134 for (
const auto& scvfJ : scvfs(fvGeometry))
135 if (scvfJ.interiorBoundary() && scvfJ.facetIndexInElement() == scvf.facetIndexInElement())
136 temperatures[ fvGeometry.scv(scvfJ.insideScvIdx()).localDofIndex() ]
137 = problem.couplingManager().getLowDimVolVars(element, scvfJ).temperature();
140 Dune::FieldVector<Scalar, dimWorld> gradT(0.0);
141 for (
const auto& scv : scvs(fvGeometry))
142 gradT.axpy(temperatures[scv.localDofIndex()], fluxVarCache.gradN(scv.indexInElement()));
145 return -1.0*scvf.area()
146 *insideVolVars.extrusionFactor()
147 *
vtmv(scvf.unitOuterNormal(),
148 insideVolVars.effectiveThermalConductivity(),
154 DUNE_THROW(Dune::NotImplemented,
"Mixed boundary types are not supported");
160 const Element& element,
161 const FVElementGeometry& fvGeometry,
162 const ElementVolumeVariables& elemVolVars,
163 const SubControlVolumeFace& scvf,
164 const FluxVarCache& fluxVarCache,
165 unsigned int phaseIdx)
167 DUNE_THROW(Dune::NotImplemented,
"transmissibilty computation for BoxFacetCouplingFouriersLaw");