mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add THERMAL boundary conditions which keeps constant temperature on the boundary
This commit is contained in:
parent
467b88644e
commit
75bfe52611
@ -1592,10 +1592,14 @@ public:
|
|||||||
const auto& dirichlet = dirichlet_(dir)[globalDofIdx];
|
const auto& dirichlet = dirichlet_(dir)[globalDofIdx];
|
||||||
if (freebc_(dir)[globalDofIdx])
|
if (freebc_(dir)[globalDofIdx])
|
||||||
values.setFreeFlow(context, spaceIdx, timeIdx, boundaryFluidState(globalDofIdx, indexInInside));
|
values.setFreeFlow(context, spaceIdx, timeIdx, boundaryFluidState(globalDofIdx, indexInInside));
|
||||||
|
else if (thermalbc_(dir)[globalDofIdx])
|
||||||
|
values.setThermalFlow(context, spaceIdx, timeIdx, boundaryFluidState(globalDofIdx, indexInInside));
|
||||||
else if (std::get<0>(dirichlet) != BCComponent::NONE)
|
else if (std::get<0>(dirichlet) != BCComponent::NONE)
|
||||||
values.setFreeFlow(context, spaceIdx, timeIdx, boundaryFluidState(globalDofIdx, indexInInside));
|
values.setFreeFlow(context, spaceIdx, timeIdx, boundaryFluidState(globalDofIdx, indexInInside));
|
||||||
else
|
else {
|
||||||
|
// TODO account for enthalpy flux.
|
||||||
values.setMassRate(massratebc_(dir)[globalDofIdx], pvtRegionIdx);
|
values.setMassRate(massratebc_(dir)[globalDofIdx], pvtRegionIdx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2864,6 +2868,7 @@ private:
|
|||||||
|
|
||||||
massratebc_.resize(numElems, 0.0);
|
massratebc_.resize(numElems, 0.0);
|
||||||
freebc_.resize(numElems, false);
|
freebc_.resize(numElems, false);
|
||||||
|
thermalbc_.resize(numElems, false);
|
||||||
dirichlet_.resize(numElems, {BCComponent::NONE, 0.0,0.0});
|
dirichlet_.resize(numElems, {BCComponent::NONE, 0.0,0.0});
|
||||||
|
|
||||||
auto loopAndApply = [&cartesianToCompressedElemIdx,
|
auto loopAndApply = [&cartesianToCompressedElemIdx,
|
||||||
@ -2931,7 +2936,19 @@ private:
|
|||||||
if (initconfig.restartRequested()) {
|
if (initconfig.restartRequested()) {
|
||||||
throw std::logic_error("restart is not compatible with using free boundary conditions");
|
throw std::logic_error("restart is not compatible with using free boundary conditions");
|
||||||
}
|
}
|
||||||
} else if (type == BCType::DIRICHLET) {
|
} else if (type == BCType::THERMAL) {
|
||||||
|
std::vector<bool>& data = thermalbc_(bcface.dir);
|
||||||
|
loopAndApply(bcface,
|
||||||
|
[&data](int elemIdx) { data[elemIdx] = true; });
|
||||||
|
|
||||||
|
// TODO: either the real initial solution needs to be computed or read from the restart file
|
||||||
|
const auto& eclState = simulator.vanguard().eclState();
|
||||||
|
const auto& initconfig = eclState.getInitConfig();
|
||||||
|
if (initconfig.restartRequested()) {
|
||||||
|
throw std::logic_error("restart is not compatible with using free boundary conditions");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (type == BCType::DIRICHLET) {
|
||||||
const auto component = bcface.component;
|
const auto component = bcface.component;
|
||||||
const auto pressure = bcface.pressure;
|
const auto pressure = bcface.pressure;
|
||||||
const auto temperature = bcface.temperature;
|
const auto temperature = bcface.temperature;
|
||||||
@ -3075,6 +3092,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
BCData<bool> freebc_;
|
BCData<bool> freebc_;
|
||||||
|
BCData<bool> thermalbc_;
|
||||||
BCData<RateVector> massratebc_;
|
BCData<RateVector> massratebc_;
|
||||||
BCData<std::tuple<BCComponent, std::optional<double>, std::optional<double>>> dirichlet_;
|
BCData<std::tuple<BCComponent, std::optional<double>, std::optional<double>>> dirichlet_;
|
||||||
bool nonTrivialBoundaryConditions_ = false;
|
bool nonTrivialBoundaryConditions_ = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user