mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Align the thermal transmissibility computations with the diffusion computations.
This commit is contained in:
@@ -241,17 +241,16 @@ public:
|
|||||||
// for boundary intersections we also need to compute the thermal
|
// for boundary intersections we also need to compute the thermal
|
||||||
// half transmissibilities
|
// half transmissibilities
|
||||||
if (enableEnergy) {
|
if (enableEnergy) {
|
||||||
const auto& n = intersection.centerUnitOuterNormal();
|
Scalar transBoundaryEnergyIs;
|
||||||
const auto& inPos = elem.geometry().center();
|
computeHalfDiffusivity_(transBoundaryEnergyIs,
|
||||||
const auto& outPos = intersection.geometry().center();
|
faceAreaNormal,
|
||||||
const auto& d = outPos - inPos;
|
distanceVector_(faceCenterInside,
|
||||||
|
intersection.indexInInside(),
|
||||||
// eWoms expects fluxes to be area specific, i.e. we must *not*
|
elemIdx,
|
||||||
// the transmissibility with the face area here
|
axisCentroids),
|
||||||
Scalar thermalHalfTrans = std::abs(n*d)/(d*d);
|
1.0);
|
||||||
|
|
||||||
thermalHalfTransBoundary_[std::make_pair(elemIdx, boundaryIsIdx)] =
|
thermalHalfTransBoundary_[std::make_pair(elemIdx, boundaryIsIdx)] =
|
||||||
thermalHalfTrans;
|
transBoundaryEnergyIs;
|
||||||
}
|
}
|
||||||
|
|
||||||
++ boundaryIsIdx;
|
++ boundaryIsIdx;
|
||||||
@@ -268,19 +267,6 @@ public:
|
|||||||
const auto& outsideElem = intersection.outside();
|
const auto& outsideElem = intersection.outside();
|
||||||
unsigned outsideElemIdx = elemMapper.index(outsideElem);
|
unsigned outsideElemIdx = elemMapper.index(outsideElem);
|
||||||
|
|
||||||
// update the "thermal half transmissibility" for the intersection
|
|
||||||
if (enableEnergy) {
|
|
||||||
const auto& n = intersection.centerUnitOuterNormal();
|
|
||||||
Scalar A = intersection.geometry().volume();
|
|
||||||
|
|
||||||
const auto& inPos = elem.geometry().center();
|
|
||||||
const auto& outPos = intersection.geometry().center();
|
|
||||||
const auto& d = outPos - inPos;
|
|
||||||
|
|
||||||
(*thermalHalfTrans_)[directionalIsId_(elemIdx, outsideElemIdx)] =
|
|
||||||
A * (n*d)/(d*d);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned insideCartElemIdx = cartMapper.cartesianIndex(elemIdx);
|
unsigned insideCartElemIdx = cartMapper.cartesianIndex(elemIdx);
|
||||||
unsigned outsideCartElemIdx = cartMapper.cartesianIndex(outsideElemIdx);
|
unsigned outsideCartElemIdx = cartMapper.cartesianIndex(outsideElemIdx);
|
||||||
|
|
||||||
@@ -396,6 +382,31 @@ public:
|
|||||||
trans_[isId_(elemIdx, outsideElemIdx)] = trans;
|
trans_[isId_(elemIdx, outsideElemIdx)] = trans;
|
||||||
|
|
||||||
// update the "thermal half transmissibility" for the intersection
|
// update the "thermal half transmissibility" for the intersection
|
||||||
|
if (enableEnergy) {
|
||||||
|
|
||||||
|
Scalar halfDiffusivity1;
|
||||||
|
Scalar halfDiffusivity2;
|
||||||
|
|
||||||
|
computeHalfDiffusivity_(halfDiffusivity1,
|
||||||
|
faceAreaNormal,
|
||||||
|
distanceVector_(faceCenterInside,
|
||||||
|
intersection.indexInInside(),
|
||||||
|
elemIdx,
|
||||||
|
axisCentroids),
|
||||||
|
1.0);
|
||||||
|
computeHalfDiffusivity_(halfDiffusivity2,
|
||||||
|
faceAreaNormal,
|
||||||
|
distanceVector_(faceCenterOutside,
|
||||||
|
intersection.indexInOutside(),
|
||||||
|
outsideElemIdx,
|
||||||
|
axisCentroids),
|
||||||
|
1.0);
|
||||||
|
//TODO Add support for multipliers
|
||||||
|
(*thermalHalfTrans_)[directionalIsId_(elemIdx, outsideElemIdx)] = halfDiffusivity1;
|
||||||
|
(*thermalHalfTrans_)[directionalIsId_(outsideElemIdx, elemIdx)] = halfDiffusivity2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the "diffusive half transmissibility" for the intersection
|
||||||
if (updateDiffusivity) {
|
if (updateDiffusivity) {
|
||||||
|
|
||||||
Scalar halfDiffusivity1;
|
Scalar halfDiffusivity1;
|
||||||
|
|||||||
Reference in New Issue
Block a user