mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adapt to the recent three-phase material law cleanups in opm-material
This commit is contained in:
parent
9b5a5d7d6c
commit
2910a7542e
@ -28,11 +28,11 @@
|
|||||||
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
|
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
|
||||||
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
|
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
|
||||||
#include <opm/material/fluidsystems/H2OAirMesityleneFluidSystem.hpp>
|
#include <opm/material/fluidsystems/H2OAirMesityleneFluidSystem.hpp>
|
||||||
#include <opm/material/fluidmatrixinteractions/3p/3pParkerVanGenuchten.hpp>
|
#include <opm/material/fluidmatrixinteractions/ThreePhaseParkerVanGenuchten.hpp>
|
||||||
#include <opm/material/fluidmatrixinteractions/3pAdapter.hpp>
|
|
||||||
#include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
|
#include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
|
||||||
#include <opm/material/heatconduction/Somerton.hpp>
|
#include <opm/material/heatconduction/Somerton.hpp>
|
||||||
#include <opm/material/constraintsolvers/MiscibleMultiPhaseComposition.hpp>
|
#include <opm/material/constraintsolvers/MiscibleMultiPhaseComposition.hpp>
|
||||||
|
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
|
||||||
|
|
||||||
#include <ewoms/models/pvs/pvsproperties.hh>
|
#include <ewoms/models/pvs/pvsproperties.hh>
|
||||||
|
|
||||||
@ -79,19 +79,14 @@ private:
|
|||||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
||||||
|
|
||||||
enum { wPhaseIdx = FluidSystem::wPhaseIdx };
|
typedef Opm::ThreePhaseMaterialTraits<
|
||||||
enum { nPhaseIdx = FluidSystem::nPhaseIdx };
|
Scalar,
|
||||||
enum { gPhaseIdx = FluidSystem::gPhaseIdx };
|
/*wettingPhaseIdx=*/FluidSystem::wPhaseIdx,
|
||||||
|
/*nonWettingPhaseIdx=*/FluidSystem::nPhaseIdx,
|
||||||
// define the three-phase material law
|
/*gasPhaseIdx=*/FluidSystem::gPhaseIdx> Traits;
|
||||||
typedef Opm::ThreePParkerVanGenuchten<Scalar> ThreePLaw;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// wrap the three-phase law in an adaptor to make use the generic
|
typedef Opm::ThreePhaseParkerVanGenuchten<Traits> type;
|
||||||
// material law API
|
|
||||||
typedef Opm::ThreePAdapter<wPhaseIdx, nPhaseIdx, gPhaseIdx, ThreePLaw> type;
|
|
||||||
|
|
||||||
// typedef Opm::MpLinearMaterial<FluidSystem::numPhases, Scalar> type;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set the heat conduction law
|
// Set the heat conduction law
|
||||||
@ -212,9 +207,9 @@ public:
|
|||||||
finePorosity_ = 0.42;
|
finePorosity_ = 0.42;
|
||||||
coarsePorosity_ = 0.42;
|
coarsePorosity_ = 0.42;
|
||||||
|
|
||||||
// parameters for the capillary pressure law
|
// parameters for the capillary pressure law
|
||||||
#if 1
|
#if 1
|
||||||
// three-phase van Genuchten law
|
// three-phase Parker -- van Genuchten law
|
||||||
fineMaterialParams_.setVgAlpha(0.0005);
|
fineMaterialParams_.setVgAlpha(0.0005);
|
||||||
coarseMaterialParams_.setVgAlpha(0.005);
|
coarseMaterialParams_.setVgAlpha(0.005);
|
||||||
fineMaterialParams_.setVgN(4.0);
|
fineMaterialParams_.setVgN(4.0);
|
||||||
@ -223,11 +218,6 @@ public:
|
|||||||
coarseMaterialParams_.setkrRegardsSnr(true);
|
coarseMaterialParams_.setkrRegardsSnr(true);
|
||||||
fineMaterialParams_.setkrRegardsSnr(true);
|
fineMaterialParams_.setkrRegardsSnr(true);
|
||||||
|
|
||||||
coarseMaterialParams_.setKdNAPL(0.);
|
|
||||||
coarseMaterialParams_.setRhoBulk(1500.);
|
|
||||||
fineMaterialParams_.setKdNAPL(0.);
|
|
||||||
fineMaterialParams_.setRhoBulk(1500.);
|
|
||||||
|
|
||||||
// residual saturations
|
// residual saturations
|
||||||
fineMaterialParams_.setSwr(0.1201);
|
fineMaterialParams_.setSwr(0.1201);
|
||||||
fineMaterialParams_.setSwrx(0.1201);
|
fineMaterialParams_.setSwrx(0.1201);
|
||||||
@ -263,6 +253,9 @@ public:
|
|||||||
coarseMaterialParams_.setResidSat(gPhaseIdx, 0.0101);
|
coarseMaterialParams_.setResidSat(gPhaseIdx, 0.0101);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
fineMaterialParams_.finalize();
|
||||||
|
coarseMaterialParams_.finalize();
|
||||||
|
|
||||||
// initialize parameters for the heat conduction law
|
// initialize parameters for the heat conduction law
|
||||||
computeHeatCondParams_(heatCondParams_, finePorosity_);
|
computeHeatCondParams_(heatCondParams_, finePorosity_);
|
||||||
|
|
||||||
|
@ -27,8 +27,7 @@
|
|||||||
|
|
||||||
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
|
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
|
||||||
#include <opm/material/fluidsystems/H2OAirMesityleneFluidSystem.hpp>
|
#include <opm/material/fluidsystems/H2OAirMesityleneFluidSystem.hpp>
|
||||||
#include <opm/material/fluidmatrixinteractions/3p/3pParkerVanGenuchten.hpp>
|
#include <opm/material/fluidmatrixinteractions/ThreePhaseParkerVanGenuchten.hpp>
|
||||||
#include <opm/material/fluidmatrixinteractions/3pAdapter.hpp>
|
|
||||||
#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
|
#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
|
||||||
#include <opm/material/heatconduction/Somerton.hpp>
|
#include <opm/material/heatconduction/Somerton.hpp>
|
||||||
|
|
||||||
@ -81,17 +80,14 @@ private:
|
|||||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
||||||
|
|
||||||
enum { wPhaseIdx = FluidSystem::wPhaseIdx };
|
typedef Opm::ThreePhaseMaterialTraits<
|
||||||
enum { nPhaseIdx = FluidSystem::nPhaseIdx };
|
Scalar,
|
||||||
enum { gPhaseIdx = FluidSystem::gPhaseIdx };
|
/*wettingPhaseIdx=*/FluidSystem::wPhaseIdx,
|
||||||
|
/*nonWettingPhaseIdx=*/FluidSystem::nPhaseIdx,
|
||||||
// define the three-phase material law
|
/*gasPhaseIdx=*/FluidSystem::gPhaseIdx> Traits;
|
||||||
typedef Opm::ThreePParkerVanGenuchten<Scalar> ThreePLaw;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// wrap the three-phase law in an adaptor to make use the generic
|
typedef Opm::ThreePhaseParkerVanGenuchten<Traits> type;
|
||||||
// material law API
|
|
||||||
typedef Opm::ThreePAdapter<wPhaseIdx, nPhaseIdx, gPhaseIdx, ThreePLaw> type;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set the heat conduction law
|
// Set the heat conduction law
|
||||||
@ -220,15 +216,12 @@ public:
|
|||||||
materialParams_.setSnr(0.07);
|
materialParams_.setSnr(0.07);
|
||||||
materialParams_.setSgr(0.03);
|
materialParams_.setSgr(0.03);
|
||||||
|
|
||||||
// parameters for the 3phase van Genuchten law
|
// parameters for the three-phase van Genuchten law
|
||||||
materialParams_.setVgAlpha(0.0005);
|
materialParams_.setVgAlpha(0.0005);
|
||||||
materialParams_.setVgN(4.);
|
materialParams_.setVgN(4.);
|
||||||
materialParams_.setkrRegardsSnr(false);
|
materialParams_.setkrRegardsSnr(false);
|
||||||
|
|
||||||
// parameters for adsorption
|
materialParams_.finalize();
|
||||||
materialParams_.setKdNAPL(0.);
|
|
||||||
materialParams_.setRhoBulk(1500.);
|
|
||||||
|
|
||||||
materialParams_.checkDefined();
|
materialParams_.checkDefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,14 +273,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
template <class Context>
|
template <class Context>
|
||||||
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
|
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
|
||||||
{
|
{ return porosity_; }
|
||||||
// const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
|
|
||||||
// if (isFineMaterial_(pos))
|
|
||||||
// return finePorosity_;
|
|
||||||
// else
|
|
||||||
// return coarsePorosity_;
|
|
||||||
return porosity_;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \copydoc FvBaseMultiPhaseProblem::materialLawParams
|
* \copydoc FvBaseMultiPhaseProblem::materialLawParams
|
||||||
@ -411,9 +397,9 @@ private:
|
|||||||
|
|
||||||
// set pressures
|
// set pressures
|
||||||
const auto &matParams = materialLawParams(context, spaceIdx, timeIdx);
|
const auto &matParams = materialLawParams(context, spaceIdx, timeIdx);
|
||||||
Scalar Sw = invertPCGW_(pc, matParams);
|
Scalar Sw = matParams.Swr();
|
||||||
Scalar Swr = matParams.satResidual(wPhaseIdx);
|
Scalar Swr = matParams.Swr();
|
||||||
Scalar Sgr = matParams.satResidual(gPhaseIdx);
|
Scalar Sgr = matParams.Sgr();
|
||||||
if (Sw < Swr)
|
if (Sw < Swr)
|
||||||
Sw = Swr;
|
Sw = Swr;
|
||||||
if (Sw > 1 - Sgr)
|
if (Sw > 1 - Sgr)
|
||||||
@ -455,39 +441,8 @@ private:
|
|||||||
1 - fs.moleFraction(wPhaseIdx, H2OIdx));
|
1 - fs.moleFraction(wPhaseIdx, H2OIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Scalar invertPCGW_(Scalar pcIn, const MaterialLawParams &pcParams)
|
|
||||||
{
|
|
||||||
Scalar lower, upper;
|
|
||||||
int k;
|
|
||||||
int maxIt = 50;
|
|
||||||
Scalar bisLimit = 1.;
|
|
||||||
Scalar Sw, pcGW;
|
|
||||||
lower = 0.0;
|
|
||||||
upper = 1.0;
|
|
||||||
for (k = 1; k <= 25; k++) {
|
|
||||||
Sw = 0.5 * (upper + lower);
|
|
||||||
pcGW = MaterialLaw::pCGW(pcParams, Sw);
|
|
||||||
Scalar delta = pcGW - pcIn;
|
|
||||||
if (delta < 0.)
|
|
||||||
delta *= -1.;
|
|
||||||
if (delta < bisLimit) {
|
|
||||||
return (Sw);
|
|
||||||
}
|
|
||||||
if (k == maxIt) {
|
|
||||||
return (Sw);
|
|
||||||
}
|
|
||||||
if (pcGW > pcIn)
|
|
||||||
lower = Sw;
|
|
||||||
else
|
|
||||||
upper = Sw;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isFineMaterial_(const GlobalPosition &pos) const
|
bool isFineMaterial_(const GlobalPosition &pos) const
|
||||||
{
|
{ return 70. <= pos[0] && pos[0] <= 85. && 7.0 <= pos[1] && pos[1] <= 7.50; }
|
||||||
return 70. <= pos[0] && pos[0] <= 85. && 7.0 <= pos[1] && pos[1] <= 7.50;
|
|
||||||
}
|
|
||||||
|
|
||||||
DimMatrix fineK_;
|
DimMatrix fineK_;
|
||||||
DimMatrix coarseK_;
|
DimMatrix coarseK_;
|
||||||
|
Loading…
Reference in New Issue
Block a user