Skip to content
Snippets Groups Projects
Commit 00467f85 authored by Timo Koch's avatar Timo Koch
Browse files

[richards] Use endPointPc and thus make sure pc >= 0

parent 14f7dc7e
No related branches found
No related tags found
Loading
...@@ -87,8 +87,9 @@ public: ...@@ -87,8 +87,9 @@ public:
const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol); const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
relativePermeabilityWetting_ = MaterialLaw::krw(materialParams, fluidState_.saturation(wPhaseIdx)); relativePermeabilityWetting_ = MaterialLaw::krw(materialParams, fluidState_.saturation(wPhaseIdx));
//! precompute the minimum capillary pressure (entry pressure) // precompute the minimum capillary pressure (entry pressure)
minPc_ = MaterialLaw::pc(materialParams, /*Sw=*/ 1.0); // needed to make sure we don't compute unphysical capillary pressures and thus saturations
minPc_ = MaterialLaw::endPointPc(materialParams);
pn_ = problem.nonWettingReferencePressure(); pn_ = problem.nonWettingReferencePressure();
porosity_ = problem.spatialParams().porosity(element, scv, elemSol); porosity_ = problem.spatialParams().porosity(element, scv, elemSol);
permeability_ = problem.spatialParams().permeability(element, scv, elemSol); permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
...@@ -113,8 +114,11 @@ public: ...@@ -113,8 +114,11 @@ public:
fluidState.setPressure(wPhaseIdx, priVars[pressureIdx]); fluidState.setPressure(wPhaseIdx, priVars[pressureIdx]);
// compute the capillary pressure to compute the saturation // compute the capillary pressure to compute the saturation
// the material law takes care of cases where pc gets negative // make sure that we the capillary pressure is not smaller than the minimum pc
const Scalar pc = problem.nonWettingReferencePressure() - fluidState.pressure(wPhaseIdx); // this would possibly return unphysical values from regularized material laws
using std::max;
const Scalar pc = max(MaterialLaw::endPointPc(materialParams),
problem.nonWettingReferencePressure() - fluidState.pressure(wPhaseIdx));
const Scalar sw = MaterialLaw::sw(materialParams, pc); const Scalar sw = MaterialLaw::sw(materialParams, pc);
fluidState.setSaturation(wPhaseIdx, sw); fluidState.setSaturation(wPhaseIdx, sw);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment