mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-28 12:03:48 -06:00
tutorial decoupled fixed for releas
This commit is contained in:
parent
c7e0293de1
commit
330f89d037
@ -16,8 +16,8 @@ The problem which is solved in this tutorial is illustrated in figure \ref{tutor
|
|||||||
\psfrag{no flow}{no flow}
|
\psfrag{no flow}{no flow}
|
||||||
\psfrag{water}{\textbf{water}}
|
\psfrag{water}{\textbf{water}}
|
||||||
\psfrag{oil}{\textcolor{white}{\textbf{oil}}}
|
\psfrag{oil}{\textcolor{white}{\textbf{oil}}}
|
||||||
\psfrag{p_w = 2 x 10^5 [Pa]}{$p_w = 10^6$ [Pa]}
|
\psfrag{p_w = 2 x 10^5 [Pa]}{$p_w = 2 \times 10^5$ [Pa]}
|
||||||
\psfrag{p_w_initial = 2 x 10^5 [Pa]}{\textcolor{white}{\textbf{$\mathbf{p_{w_{initial}} = 10^6}$ [Pa]}}}
|
\psfrag{p_w_initial = 2 x 10^5 [Pa]}{\textcolor{white}{\textbf{$\mathbf{p_{w_{initial}} = 2 \times 10^5}$ [Pa]}}}
|
||||||
\psfrag{S_n = 0}{$S_w = 1$}
|
\psfrag{S_n = 0}{$S_w = 1$}
|
||||||
\psfrag{S_n_initial = 0}{\textcolor{white}{$\mathbf{S_{w_{initial}} = 0}$}}
|
\psfrag{S_n_initial = 0}{\textcolor{white}{$\mathbf{S_{w_{initial}} = 0}$}}
|
||||||
\psfrag{q_w = 0 [kg/m^2s]}{$q_w = 0$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$}
|
\psfrag{q_w = 0 [kg/m^2s]}{$q_w = 0$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$}
|
||||||
@ -38,7 +38,7 @@ First, in line \ref{tutorial-decoupled:include-begin} to \ref{tutorial-decoupled
|
|||||||
|
|
||||||
In line \ref{tutorial-decoupled:grid-begin} to \ref{tutorial-decoupled:grid-end} the geometry is defined and the grid is generated. The three variables of Type \texttt{Dune::FieldVector} define the lower left corner of the domain (\texttt{L}), the upper right corner of the domain (\texttt{H}) and the number of cells in $x$ and $y$ direction (\texttt{N}), where the dimensions are previously defined in line \ref{tutorial-decoupled:dim}. The grid of type \texttt{Dune::SGrid} is then generated in line \ref{tutorial-decoupled:grid-end}. For more information about the dune grid interface, the different grid types that are supported and the generation of different grids it is referred to the \textit{Dune Grid Interface HOWTO} \cite{DUNE-HP}.
|
In line \ref{tutorial-decoupled:grid-begin} to \ref{tutorial-decoupled:grid-end} the geometry is defined and the grid is generated. The three variables of Type \texttt{Dune::FieldVector} define the lower left corner of the domain (\texttt{L}), the upper right corner of the domain (\texttt{H}) and the number of cells in $x$ and $y$ direction (\texttt{N}), where the dimensions are previously defined in line \ref{tutorial-decoupled:dim}. The grid of type \texttt{Dune::SGrid} is then generated in line \ref{tutorial-decoupled:grid-end}. For more information about the dune grid interface, the different grid types that are supported and the generation of different grids it is referred to the \textit{Dune Grid Interface HOWTO} \cite{DUNE-HP}.
|
||||||
|
|
||||||
The second point mentioned at the beginning of this section was the definition of material properties and constitutive relationships. The fluid properties of the two fluid phases considered here are defined in lines \ref{tutorial-decoupled:water} and \ref{tutorial-decoupled:oil}. The fluid classes including different kinds of fluids (here: \texttt{Dune::Water} and \texttt{Dune::Oil}) can be found in the folder \texttt{material/fluids} in the directory \texttt{/dune-mux/dumux}-\texttt{/material/fluids}. The properties of the solid matrix are defined in a special soil class. The \texttt{soil} object is generated in line \ref{tutorial-decoupled:soil}. As can be seen, the class type is \texttt{Dune::TutorialSoil}, which is defined in the file \texttt{tutorial\_soilproperties\_decoupled.hh} in the folder \texttt{/tutorial}. A description of this file and the definition of a soil class including the soil parameters can be found in section \ref{tutorial-decoupled:description-soil-class}. Finally, in line \ref{tutorial-decoupled:twophaserelations} the information included in the fluid and soil objects is used to generate an object of type \texttt{Dune::TwoPhaseRelations}, which includes the constitutive relationships (capillary pressure-saturation relation, relative permeability-saturation relation, etc.). The file \texttt{twophaserelations.hh} can be found in the directory \texttt{/dune-mux/dumux/material}.
|
The second point mentioned at the beginning of this section was the definition of material properties and constitutive relationships. The fluid properties of the two fluid phases considered here are defined in lines \ref{tutorial-decoupled:water} and \ref{tutorial-decoupled:oil}. The fluid classes including different kinds of fluids (here: \texttt{Dune::Water} and \texttt{Dune::LowViscosityOil}) can be found in the folder \texttt{material/fluids} in the directory \texttt{/dune-mux/dumux}-\texttt{/material/fluids}. The properties of the solid matrix are defined in a special soil class. The \texttt{soil} object is generated in line \ref{tutorial-decoupled:soil}. As can be seen, the class type is \texttt{Dune::TutorialSoil}, which is defined in the file \texttt{tutorial\_soilproperties\_decoupled.hh} in the folder \texttt{/tutorial}. A description of this file and the definition of a soil class including the soil parameters can be found in section \ref{tutorial-decoupled:description-soil-class}. Finally, in line \ref{tutorial-decoupled:twophaserelations} the information included in the fluid and soil objects is used to generate an object of type \texttt{Dune::TwoPhaseRelations}, which includes the constitutive relationships (capillary pressure-saturation relation, relative permeability-saturation relation, etc.). The file \texttt{twophaserelations.hh} can be found in the directory \texttt{/dune-mux/dumux/material}.
|
||||||
|
|
||||||
The definition of boundary and initial conditions as well as source of sink terms is done by definition of a so-called \textit{problem} class. In case of this tutorial the problem class is defined in the file \texttt{tutorialproblem\_decoupled.hh} in the \texttt{/tutorial} folder. In the main file the problem object of type \texttt{Dune::TutorialProblemDecoupled} is then generated in line \ref{tutorial-decoupled:problem}. A further explanation of the definition of boundary and initial conditions, source and sink terms and the structure of the problem class can be found in section \ref{tutorial-decoupled:description-bc-ic}. Besides the definition of the boundary and initial conditions the problem class is also a kind of interface containing all the objects generated before (geometry, fluids, soil, constitutive relationships, etc.). Thus, as can be seen in line \ref{tutorial-decoupled:problem} all this objects are given as arguments when calling the constructor of the problem class.
|
The definition of boundary and initial conditions as well as source of sink terms is done by definition of a so-called \textit{problem} class. In case of this tutorial the problem class is defined in the file \texttt{tutorialproblem\_decoupled.hh} in the \texttt{/tutorial} folder. In the main file the problem object of type \texttt{Dune::TutorialProblemDecoupled} is then generated in line \ref{tutorial-decoupled:problem}. A further explanation of the definition of boundary and initial conditions, source and sink terms and the structure of the problem class can be found in section \ref{tutorial-decoupled:description-bc-ic}. Besides the definition of the boundary and initial conditions the problem class is also a kind of interface containing all the objects generated before (geometry, fluids, soil, constitutive relationships, etc.). Thus, as can be seen in line \ref{tutorial-decoupled:problem} all this objects are given as arguments when calling the constructor of the problem class.
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <dune/common/timer.hh>
|
#include <dune/common/timer.hh>
|
||||||
#include "dumux/fractionalflow/variableclass2p.hh"
|
#include "dumux/fractionalflow/variableclass2p.hh"
|
||||||
#include "dumux/material/fluids/water.hh"
|
#include "dumux/material/fluids/water.hh"
|
||||||
#include "dumux/material/fluids/oil.hh"
|
#include "dumux/material/fluids/lowviscosityoil.hh"
|
||||||
#include "tutorial_soilproperties_decoupled.hh"
|
#include "tutorial_soilproperties_decoupled.hh"
|
||||||
#include "dumux/material/twophaserelations.hh"
|
#include "dumux/material/twophaserelations.hh"
|
||||||
#include "tutorialproblem_decoupled.hh"
|
#include "tutorialproblem_decoupled.hh"
|
||||||
@ -45,14 +45,14 @@ int main(int argc, char** argv)
|
|||||||
typedef Dune::FieldVector<Grid::ctype,dim> FieldVector;
|
typedef Dune::FieldVector<Grid::ctype,dim> FieldVector;
|
||||||
Dune::FieldVector<int,dim> N(10); N[0] = 30;
|
Dune::FieldVector<int,dim> N(10); N[0] = 30;
|
||||||
FieldVector L(0);
|
FieldVector L(0);
|
||||||
FieldVector H(300); H[0] = 600;
|
FieldVector H(60); H[0] = 300;
|
||||||
Grid grid(N,L,H);
|
Grid grid(N,L,H);
|
||||||
GridView gridView(grid.levelView(0));/*@\label{tutorial-decoupled:grid-end}@*/
|
GridView gridView(grid.levelView(0));/*@\label{tutorial-decoupled:grid-end}@*/
|
||||||
|
|
||||||
|
|
||||||
// define fluid and solid properties and constitutive relationships
|
// define fluid and solid properties and constitutive relationships
|
||||||
Dune::Water wettingfluid; /*@\label{tutorial-decoupled:water}@*/
|
Dune::Water wettingfluid; /*@\label{tutorial-decoupled:water}@*/
|
||||||
Dune::Oil nonwettingfluid; /*@\label{tutorial-decoupled:oil}@*/
|
Dune::LowViscosityOil nonwettingfluid; /*@\label{tutorial-decoupled:oil}@*/
|
||||||
Dune::TutorialSoil<Grid, Scalar> soil; /*@\label{tutorial-decoupled:soil}@*/
|
Dune::TutorialSoil<Grid, Scalar> soil; /*@\label{tutorial-decoupled:soil}@*/
|
||||||
Dune::TwoPhaseRelations<Grid, Scalar> materialLaw(soil, wettingfluid, nonwettingfluid);/*@\label{tutorial-decoupled:twophaserelations}@*/
|
Dune::TwoPhaseRelations<Grid, Scalar> materialLaw(soil, wettingfluid, nonwettingfluid);/*@\label{tutorial-decoupled:twophaserelations}@*/
|
||||||
|
|
||||||
@ -66,15 +66,15 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
// create object including the discretisation of the pressure equation
|
// create object including the discretisation of the pressure equation
|
||||||
typedef Dune::FVTotalVelocity2P<GridView, Scalar, VariableClass, Problem> Diffusion;
|
typedef Dune::FVTotalVelocity2P<GridView, Scalar, VariableClass, Problem> Diffusion;
|
||||||
Diffusion diffusion(gridView, problem, "pw"); /*@\label{tutorial-decoupled:diffusion}@*/
|
Diffusion diffusion(gridView, problem, "pw","Sw"); /*@\label{tutorial-decoupled:diffusion}@*/
|
||||||
|
|
||||||
// create object including the space discretisation of the saturation equation
|
// create object including the space discretisation of the saturation equation
|
||||||
typedef Dune::FVSaturationWetting2P<GridView, Scalar, VariableClass, Problem> Transport;
|
typedef Dune::FVSaturationWetting2P<GridView, Scalar, VariableClass, Problem> Transport;
|
||||||
Transport transport(gridView, problem, "vt"); /*@\label{tutorial-decoupled:transport}@*/
|
Transport transport(gridView, problem, "vt"); /*@\label{tutorial-decoupled:transport}@*/
|
||||||
|
|
||||||
// some parameters used in the IMPES-object
|
// some parameters used in the IMPES-object
|
||||||
int iterFlag = 2;
|
int iterFlag = 0;
|
||||||
int nIter = 30;
|
int nIter = 2;
|
||||||
double maxDefect = 1e-5;
|
double maxDefect = 1e-5;
|
||||||
|
|
||||||
// create object including the IMPES (IMplicit Pressure Explicit Saturation) algorithm
|
// create object including the IMPES (IMplicit Pressure Explicit Saturation) algorithm
|
||||||
@ -83,10 +83,10 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
// some parameters needed for the TimeLoop-object
|
// some parameters needed for the TimeLoop-object
|
||||||
double tStart = 0; // start simulation at t = tStart
|
double tStart = 0; // start simulation at t = tStart
|
||||||
double tEnd = 1e8; // stop simulation at t = tEnd
|
double tEnd = 4e7; // stop simulation at t = tEnd
|
||||||
const char* fileName = "tutorial_decoupled"; // name of the output files
|
const char* fileName = "tutorial_decoupled"; // name of the output files
|
||||||
int modulo = 1; // define time step interval in which output files are generated
|
int modulo = 1; // define time step interval in which output files are generated
|
||||||
double cFLFactor = 0.9; // security factor for the Courant-Friedrichs-Lewy-Criterion
|
double cFLFactor = 0.99; // security factor for the Courant-Friedrichs-Lewy-Criterion
|
||||||
|
|
||||||
// create TimeLoop-object
|
// create TimeLoop-object
|
||||||
Dune::TimeLoop<Grid, IMPES> timeloop(tStart, tEnd, fileName, modulo, cFLFactor); /*@\label{tutorial-decoupled:timeloop}@*/
|
Dune::TimeLoop<Grid, IMPES> timeloop(tStart, tEnd, fileName, modulo, cFLFactor); /*@\label{tutorial-decoupled:timeloop}@*/
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
virtual Scalar sourcePress (const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:qpress}@*/
|
virtual Scalar sourcePress (const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:qpress}@*/
|
||||||
const LocalPosition& localPos)
|
const LocalPosition& localPos)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// function returning the boundary condition type for solution
|
// function returning the boundary condition type for solution
|
||||||
@ -90,10 +90,10 @@ public:
|
|||||||
{
|
{
|
||||||
if (globalPos[0] < eps_)
|
if (globalPos[0] < eps_)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1.0;
|
||||||
}
|
}
|
||||||
// all other boundaries
|
// all other boundaries
|
||||||
return 0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// function returning the Neumann boundary condition for the solution
|
// function returning the Neumann boundary condition for the solution
|
||||||
@ -106,7 +106,7 @@ public:
|
|||||||
return 3e-7;
|
return 3e-7;
|
||||||
}
|
}
|
||||||
// all other boundaries
|
// all other boundaries
|
||||||
return 0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// function returning the initial saturation
|
// function returning the initial saturation
|
||||||
@ -114,7 +114,7 @@ public:
|
|||||||
Scalar initSat (const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:initsat}@*/
|
Scalar initSat (const GlobalPosition& globalPos, const Element& e, /*@\label{tutorial-decoupled:initsat}@*/
|
||||||
const FieldVector<Scalar,dim>& xi) const
|
const FieldVector<Scalar,dim>& xi) const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user