mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4912 from totto82/fix_bccon
fix issue when BCPROP is not set initially
This commit is contained in:
commit
5a6af752e3
@ -1202,7 +1202,7 @@ public:
|
||||
values.setThermalFlow(context, spaceIdx, timeIdx, boundaryFluidState(globalDofIdx, indexInInside));
|
||||
else if (type == BCType::FREE || type == BCType::DIRICHLET)
|
||||
values.setFreeFlow(context, spaceIdx, timeIdx, boundaryFluidState(globalDofIdx, indexInInside));
|
||||
else
|
||||
else if (type == BCType::RATE)
|
||||
values.setMassRate(massrate, pvtRegionIdx);
|
||||
}
|
||||
}
|
||||
@ -1470,9 +1470,16 @@ public:
|
||||
const InitialFluidState boundaryFluidState(unsigned globalDofIdx, const int directionId) const
|
||||
{
|
||||
OPM_TIMEBLOCK_LOCAL(boundaryFluidState);
|
||||
const auto& bcprop = this->simulator().vanguard().schedule()[this->episodeIndex()].bcprop;
|
||||
if (bcprop.size() > 0) {
|
||||
FaceDir::DirEnum dir = FaceDir::FromIntersectionIndex(directionId);
|
||||
assert(bcindex_(dir)[globalDofIdx] > 0);
|
||||
const auto& bc = this->simulator().vanguard().schedule()[this->episodeIndex()].bcprop[bcindex_(dir)[globalDofIdx]];
|
||||
|
||||
// index == 0: no boundary conditions for this
|
||||
// global cell and direction
|
||||
if (bcindex_(dir)[globalDofIdx] == 0)
|
||||
return initialFluidStates_[globalDofIdx];
|
||||
|
||||
const auto& bc = bcprop[bcindex_(dir)[globalDofIdx]];
|
||||
if (bc.bctype == BCType::DIRICHLET )
|
||||
{
|
||||
InitialFluidState fluidState;
|
||||
@ -1568,6 +1575,7 @@ public:
|
||||
fluidState.checkDefined();
|
||||
return fluidState;
|
||||
}
|
||||
}
|
||||
return initialFluidStates_[globalDofIdx];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user