mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
refactor the boundary condition handling slightly
instead of passing a "minimal" fluid state that defines the thermodynamic conditions on the domain boundary and the models calculating everything they need based on this, it is now assumed that all quantities needed by the code that computes the boundary fluxes are defined. This simplifies the boundary flux computation code, it allows to get rid of the `paramCache` argument for these methods and to potentially speed things up because quantities do not get re-calculated unconditionally. on the flipside, this requires slightly more effort to define the conditions at the boundary on the problem level and it makes it less obvious which quantities are actually used. That said, one now has the freedom to shoot oneself into the foot more easily when specifying boundary conditions and also tools like valgrind or ASAN will normally complain about undefined quantities if this happens.
This commit is contained in:
@@ -177,6 +177,7 @@ class FingerProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
|
||||
|
||||
enum {
|
||||
// number of phases
|
||||
numPhases = FluidSystem::numPhases,
|
||||
|
||||
// phase indices
|
||||
wettingPhaseIdx = FluidSystem::wettingPhaseIdx,
|
||||
@@ -520,6 +521,14 @@ private:
|
||||
Scalar pn = 1e5;
|
||||
fs.setPressure(nonWettingPhaseIdx, pn);
|
||||
fs.setPressure(wettingPhaseIdx, pn);
|
||||
|
||||
typename FluidSystem::template ParameterCache<Scalar> paramCache;
|
||||
paramCache.updateAll(fs);
|
||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
|
||||
fs.setDensity(phaseIdx, FluidSystem::density(fs, paramCache, phaseIdx));
|
||||
fs.setViscosity(phaseIdx, FluidSystem::viscosity(fs, paramCache, phaseIdx));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DimMatrix K_;
|
||||
|
Reference in New Issue
Block a user