fix issue when BCPROP is not set initially

This commit is contained in:
Tor Harald Sandve 2023-10-06 09:42:00 +02:00
parent c3de02f18f
commit 72de9d3a9b
2 changed files with 16 additions and 11 deletions

View File

@ -467,7 +467,9 @@ public:
const IntensiveQuantities& insideIntQuants,
unsigned globalSpaceIdx)
{
if (bdyInfo.type == BCType::RATE) {
if (bdyInfo.type == BCType::NONE) {
bdyFlux = 0.0;
} else if (bdyInfo.type == BCType::RATE) {
computeBoundaryFluxRate(bdyFlux, bdyInfo);
} else if (bdyInfo.type == BCType::FREE || bdyInfo.type == BCType::DIRICHLET) {
computeBoundaryFluxFree(problem, bdyFlux, bdyInfo, insideIntQuants, globalSpaceIdx);

View File

@ -466,16 +466,19 @@ private:
}
}
neighborInfo_.appendRow(loc_nbinfo.begin(), loc_nbinfo.end());
for (unsigned bfIndex = 0; bfIndex < stencil.numBoundaryFaces(); ++bfIndex) {
const auto& bf = stencil.boundaryFace(bfIndex);
const int dir_id = bf.dirId();
const auto [type, massrateAD] = problem_().boundaryCondition(myIdx, dir_id);
// Strip the unnecessary (and zero anyway) derivatives off massrate.
VectorBlock massrate(0.0);
for (size_t ii = 0; ii < massrate.size(); ++ii) {
massrate[ii] = massrateAD[ii].value();
}
if (type != BCType::NONE) {
if (problem_().nonTrivialBoundaryConditions()) {
for (unsigned bfIndex = 0; bfIndex < stencil.numBoundaryFaces(); ++bfIndex) {
const auto& bf = stencil.boundaryFace(bfIndex);
const int dir_id = bf.dirId();
// not for NNCs
if (dir_id < 0)
continue;
const auto [type, massrateAD] = problem_().boundaryCondition(myIdx, dir_id);
// Strip the unnecessary (and zero anyway) derivatives off massrate.
VectorBlock massrate(0.0);
for (size_t ii = 0; ii < massrate.size(); ++ii) {
massrate[ii] = massrateAD[ii].value();
}
const auto& exFluidState = problem_().boundaryFluidState(myIdx, dir_id);
BoundaryConditionData bcdata{type,
massrate,