mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
replace the 1p and 2p(ni) box models by the immiscible(ni) model
the immiscible(ni) model is a model that is independent on the number of phases and assumes immiscibility. this change is along the lines of the previous commit for the compositional primary variable switching model.
This commit is contained in:
parent
e52f2d72f8
commit
4a0aaecead
@ -1,7 +1,8 @@
|
|||||||
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||||
// vi: set et ts=4 sw=4 sts=4:
|
// vi: set et ts=4 sw=4 sts=4:
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Copyright (C) 2008-2009 by Melanie Darcis, Klaus Mosthaf *
|
* Copyright (C) 2008-2009 by Melanie Darcis *
|
||||||
|
* Copyright (C) 2008-2009 by Klaus Mosthaf *
|
||||||
* Copyright (C) 2009-2012 by Andreas Lauser *
|
* Copyright (C) 2009-2012 by Andreas Lauser *
|
||||||
* Institute for Modelling Hydraulic and Environmental Systems *
|
* Institute for Modelling Hydraulic and Environmental Systems *
|
||||||
* University of Stuttgart, Germany *
|
* University of Stuttgart, Germany *
|
||||||
@ -29,7 +30,7 @@
|
|||||||
#define DUMUX_TUTORIAL_PROBLEM_COUPLED_HH // guardian macro /*@\label{tutorial-coupled:guardian2}@*/
|
#define DUMUX_TUTORIAL_PROBLEM_COUPLED_HH // guardian macro /*@\label{tutorial-coupled:guardian2}@*/
|
||||||
|
|
||||||
// The numerical model
|
// The numerical model
|
||||||
#include <dumux/boxmodels/2p/2pmodel.hh>
|
#include <dumux/boxmodels/immiscible/immisciblemodel.hh>
|
||||||
|
|
||||||
// The components that are used
|
// The components that are used
|
||||||
#include <dumux/material/components/h2o.hh>
|
#include <dumux/material/components/h2o.hh>
|
||||||
@ -56,7 +57,7 @@ class TutorialProblemCoupled;
|
|||||||
|
|
||||||
namespace Properties {
|
namespace Properties {
|
||||||
// Create a new type tag for the problem
|
// Create a new type tag for the problem
|
||||||
NEW_TYPE_TAG(TutorialProblemCoupled, INHERITS_FROM(BoxTwoP)); /*@\label{tutorial-coupled:create-type-tag}@*/
|
NEW_TYPE_TAG(TutorialProblemCoupled, INHERITS_FROM(BoxImmiscibleTwoPhase)); /*@\label{tutorial-coupled:create-type-tag}@*/
|
||||||
|
|
||||||
// Set the "Problem" property
|
// Set the "Problem" property
|
||||||
SET_PROP(TutorialProblemCoupled, Problem) /*@\label{tutorial-coupled:set-problem}@*/
|
SET_PROP(TutorialProblemCoupled, Problem) /*@\label{tutorial-coupled:set-problem}@*/
|
||||||
@ -153,10 +154,6 @@ class TutorialProblemCoupled
|
|||||||
enum { contiWEqIdx = Indices::conti0EqIdx + wPhaseIdx };
|
enum { contiWEqIdx = Indices::conti0EqIdx + wPhaseIdx };
|
||||||
enum { contiNEqIdx = Indices::conti0EqIdx + nPhaseIdx };
|
enum { contiNEqIdx = Indices::conti0EqIdx + nPhaseIdx };
|
||||||
|
|
||||||
// indices of the primary variables
|
|
||||||
enum { pwIdx = Indices::pwIdx };
|
|
||||||
enum { SnIdx = Indices::SnIdx };
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TutorialProblemCoupled(TimeManager &timeManager)
|
TutorialProblemCoupled(TimeManager &timeManager)
|
||||||
: ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
|
: ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
|
||||||
@ -240,9 +237,7 @@ public:
|
|||||||
int spaceIdx, int timeIdx) const
|
int spaceIdx, int timeIdx) const
|
||||||
{ return materialParams_; }
|
{ return materialParams_; }
|
||||||
|
|
||||||
/*!
|
//! Evaluate the boundary conditions.
|
||||||
* \brief Evaluate the boundary conditions.
|
|
||||||
*/
|
|
||||||
template <class Context>
|
template <class Context>
|
||||||
void boundary(BoundaryRateVector &values, const Context &context, int spaceIdx, int timeIdx) const
|
void boundary(BoundaryRateVector &values, const Context &context, int spaceIdx, int timeIdx) const
|
||||||
{
|
{
|
||||||
@ -293,8 +288,23 @@ public:
|
|||||||
template <class Context>
|
template <class Context>
|
||||||
void initial(PrimaryVariables &values, const Context &context, int spaceIdx, int timeIdx) const
|
void initial(PrimaryVariables &values, const Context &context, int spaceIdx, int timeIdx) const
|
||||||
{
|
{
|
||||||
values[pwIdx] = 200.0e3; // 200 kPa = 2 bar
|
ImmiscibleFluidState<Scalar, FluidSystem> fs;
|
||||||
values[SnIdx] = 1.0;
|
|
||||||
|
// the domain is initially fully saturated by oil
|
||||||
|
Scalar Sw = 0.0;
|
||||||
|
fs.setSaturation(wPhaseIdx, Sw);
|
||||||
|
fs.setSaturation(nPhaseIdx, 1.0 - Sw);
|
||||||
|
|
||||||
|
// the temperature is given by the temperature() method
|
||||||
|
fs.setTemperature(temperature(context, spaceIdx, timeIdx));
|
||||||
|
|
||||||
|
// set pressure of the wetting phase to 200 kPa = 2 bar
|
||||||
|
Scalar pC[numPhases];
|
||||||
|
MaterialLaw::capillaryPressures(pC, materialLawParams(context, spaceIdx, timeIdx), fs);
|
||||||
|
fs.setPressure(wPhaseIdx, 200e3);
|
||||||
|
fs.setPressure(nPhaseIdx, 200e3 + pC[nPhaseIdx] - pC[nPhaseIdx]);
|
||||||
|
|
||||||
|
values.assignNaive(fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user