Commit 7082c0e0 authored by Alexander Kissinger's avatar Alexander Kissinger
Browse files

Changed error in output in the model file.

Changed cc files of the test to return 77 if alu or ug grid are not
installed
Changed doxygen doc in co2model and co2nimodel
Changed commments in all files



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9265 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent cdf977ca
......@@ -19,6 +19,11 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief Adaption of the BOX scheme to the two-phase two-component flow model without constraint solver.
*/
#ifndef DUMUX_CO2_MODEL_HH
#define DUMUX_CO2_MODEL_HH
......@@ -26,6 +31,20 @@
namespace Dumux
{
/*!
* \ingroup CO2Model
* \brief Adaption of the BOX scheme to the non-isothermal two-phase two-component flow model.
* See TwoPTwoCModel for reference to the equations used.
* The CO2 model is derived from the 2p2c model. In the CO2 model the phase switch criterion
* is different from the 2p2c model.
* The phase switch occurs when the equilibrium concentration
* of a component in a phase is exceeded, instead of the sum of the components in the virtual phase
* (the phase which is not present) being greater that unity as done in the 2p2c model.
* The CO2VolumeVariables do not use a constraint solver for calculating the mole fractions as is the
* case in the 2p2c model. Instead mole fractions are calculated in the FluidSystem with a given
* temperature, pressurem and salinity.
*
*/
template<class TypeTag>
class CO2Model: public TwoPTwoCModel<TypeTag>
......@@ -207,8 +226,8 @@ class CO2Model: public TwoPTwoCModel<TypeTag>
if(xwn > xwnMax)
{
std::cout << "wetting phase appears at vertex " << globalIdx
// non-wetting phase appears
std::cout << "non-wetting phase appears at vertex " << globalIdx
<< ", coordinates: " << globalPos << ", xwn > xwnMax: "
<< xwn << " > "<< xwnMax << std::endl;
......
......@@ -26,7 +26,13 @@
namespace Dumux
{
/*!
* \ingroup CO2Model
* \ingroup BoxVolumeVariables
* \brief Contains the quantities which are are constant within a
* finite volume in the non-isothermal two-phase, two-component
* model.
*/
template <class TypeTag>
class CO2VolumeVariables: public TwoPTwoCVolumeVariables<TypeTag>
{
......
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* Copyright (C) 2008-2009 by Andreas Lauser *
* Copyright (C) 2008-2009 by Melanie Darcis *
* Copyright (C) 2008-2009 by Klaus Mosthaf *
* Copyright (C) 2008 by Bernd Flemisch *
* Copyright (C) 2012 by *
* Institute for Modelling Hydraulic and Environmental Systems *
* University of Stuttgart, Germany *
* email: <givenname>.<name>@iws.uni-stuttgart.de *
......@@ -25,7 +22,7 @@
/*!
* \file
*
* \brief Adaption of the BOX scheme to the non-isothermal two-phase two-component flow model.
* \brief Adaption of the BOX scheme to the non-isothermal two-phase two-component flow model without constraint solver.
*/
#ifndef DUMUX_CO2NI_MODEL_HH
#define DUMUX_CO2NI_MODEL_HH
......@@ -34,63 +31,18 @@
namespace Dumux {
/*!
* \ingroup TwoPTwoCNIModel
* \ingroup CO2NIModel
* \brief Adaption of the BOX scheme to the non-isothermal two-phase two-component flow model.
* See TwoPTwoCNI model for reference to the equations.
* The CO2NI model is derived from the CO2 model. In the CO2 model the phase switch criterion
* is different from the 2p2c model.
* The phase switch occurs when the equilibrium concentration
* of a component in a phase is exceeded instead of the sum of the components in the virtual phase
* (the phase which is not present) being greater that unity as done in the 2p2c model.
* The CO2VolumeVariables do not use a constraint solver for calculating the mole fractions as is the
* case in the 2p2c model. Instead mole fractions are calculated in the FluidSystem with a given
* temperature, pressure and salinity.
*
* This model implements a non-isothermal two-phase flow of two compressible and partly miscible fluids
* \f$\alpha \in \{ w, n \}\f$. Thus each component \f$\kappa \{ w, a \}\f$ can be present in
* each phase.
* Using the standard multiphase Darcy approach a mass balance equation is
* solved:
* \f{eqnarray*}
&& \phi \frac{\partial (\sum_\alpha \varrho_\alpha X_\alpha^\kappa S_\alpha )}{\partial t}
- \sum_\alpha \text{div} \left\{ \varrho_\alpha X_\alpha^\kappa
\frac{k_{r\alpha}}{\mu_\alpha} \mbox{\bf K}
(\text{grad}\, p_\alpha - \varrho_{\alpha} \mbox{\bf g}) \right\}\\
&-& \sum_\alpha \text{div} \left\{{\bf D}_{\alpha, pm}^\kappa \varrho_{\alpha} \text{grad}\, X^\kappa_{\alpha} \right\}
- \sum_\alpha q_\alpha^\kappa = 0 \qquad \kappa \in \{w, a\} \, ,
\alpha \in \{w, n\}
* \f}
* For the energy balance, local thermal equilibrium is assumed which results in one
* energy conservation equation for the porous solid matrix and the fluids:
* \f{eqnarray*}
&& \phi \frac{\partial \left( \sum_\alpha \varrho_\alpha u_\alpha S_\alpha \right)}{\partial t}
+ \left( 1 - \phi \right) \frac{\partial (\varrho_s c_s T)}{\partial t}
- \sum_\alpha \text{div} \left\{ \varrho_\alpha h_\alpha
\frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K} \left( \text{grad}\,
p_\alpha
- \varrho_\alpha \mathbf{g} \right) \right\} \\
&-& \text{div} \left( \lambda_{pm} \text{grad} \, T \right)
- q^h = 0 \qquad \alpha \in \{w, n\}
\f}
*
* This is discretized using a fully-coupled vertex
* centered finite volume (box) scheme as spatial and
* the implicit Euler method as temporal discretization.
*
* By using constitutive relations for the capillary pressure \f$p_c =
* p_n - p_w\f$ and relative permeability \f$k_{r\alpha}\f$ and taking
* advantage of the fact that \f$S_w + S_n = 1\f$ and \f$X^\kappa_w + X^\kappa_n = 1\f$, the number of
* unknowns can be reduced to two.
* If both phases are present the primary variables are, like in the nonisothermal two-phase model, either \f$p_w\f$, \f$S_n\f$ and
* temperature or \f$p_n\f$, \f$S_w\f$ and temperature. The formulation which ought to be used can be
* specified by setting the <tt>Formulation</tt> property to either
* <tt>TwoPTwoCIndices::pWsN</tt> or <tt>TwoPTwoCIndices::pNsW</tt>. By
* default, the model uses \f$p_w\f$ and \f$S_n\f$.
* In case that only one phase (nonwetting or wetting phase) is present the second primary
* variable represents a mass fraction. The correct assignment of the second
* primary variable is performed by a phase state dependent primary variable switch. The phase state is stored for all nodes of the system. The following cases can be distinguished:
* <ul>
* <li>
* Both phases are present: The saturation is used (either\f$S_n\f$ or \f$S_w\f$, dependent on the chosen formulation).
* </li>
* <li>
* Only wetting phase is present: The mass fraction of air in the wetting phase \f$X^a_w\f$ is used.
* </li>
* <li>
* Only non-wetting phase is present: The mass fraction of water in the non-wetting phase, \f$X^w_n\f$, is used.
* </li>
* </ul>
*/
template<class TypeTag>
class CO2NIModel : public CO2Model<TypeTag>
......
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* Copyright (C) 2008-2009 by Melanie Darcis *
* Copyright (C) 2008-2010 by Andreas Lauser *
* Copyright (C) 2008-2009 by Klaus Mosthaf *
* Copyright (C) 2008-2009 by Bernd Flemisch *
* Copyright (C) 2012 by *
* Institute for Modelling Hydraulic and Environmental Systems *
* University of Stuttgart, Germany *
* email: <givenname>.<name>@iws.uni-stuttgart.de *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -37,7 +35,7 @@ namespace Dumux
{
/*!
* \ingroup TwoPTwoCNIModel
* \ingroup CO2NIModel
* \ingroup BoxVolumeVariables
* \brief Contains the quantities which are are constant within a
* finite volume in the non-isothermal two-phase, two-component
......
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* Copyright (C) 2008-2009 by Klaus Mosthaf *
* Copyright (C) 2008-2009 by Andreas Lauser *
* Copyright (C) 2008-2009 by Bernd Flemisch *
* Institute for Modelling Hydraulic and Environmental Systems *
* University of Stuttgart, Germany *
* email: <givenname>.<name>@iws.uni-stuttgart.de *
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -15,7 +10,7 @@
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
......
......@@ -22,7 +22,7 @@
/*!
* \file
*
* \brief Test for the 2p2c box model.
* \brief Test for the CO2 box model.
*/
#include "config.h"
#include "heterogeneousproblem.hh"
......@@ -66,6 +66,12 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if HAVE_ALUGRID || HAVE_UG
typedef TTAG(HeterogeneousProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
std::cout << "Test skipped, it needs ALUGrid or UG." << std::endl;
return 77;
#endif
}
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* Copyright (C) 2008-2009 by Klaus Mosthaf *
* Copyright (C) 2008-2009 by Andreas Lauser *
* Copyright (C) 2008-2009 by Bernd Flemisch *
* Institute for Modelling Hydraulic and Environmental Systems *
* University of Stuttgart, Germany *
* email: <givenname>.<name>@iws.uni-stuttgart.de *
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -15,7 +10,7 @@
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
......@@ -24,7 +19,7 @@
/*!
* \file
*
* \brief Definition of a problem, where air is injected under a low permeable layer.
* \brief Definition of a problem, where CO2 is injected under a reservoir.
*/
#ifndef DUMUX_HETEROGENEOUS_NI_PROBLEM_NI_HH
#define DUMUX_HETEROGENEOUS_NI_PROBLEM_NI_HH
......@@ -257,6 +252,9 @@ public:
}
}
/*!
* \brief Add enthalpy and peremeability to output.
*/
void addOutputVtkFields()
{
typedef Dune::BlockVector<Dune::FieldVector<double, 1> > ScalarField;
......@@ -310,10 +308,6 @@ public:
this->resultWriter().attachVertexData(*enthalpyN, "enthalpyN");
}
/*!
* \name Problem parameters
*/
// \{
/*!
* \brief The problem name.
......@@ -328,8 +322,6 @@ public:
*
* This problem assumes a temperature of 10 degrees Celsius.
*/
Scalar boxTemperature(const Element &element,
const FVElementGeometry &fvElemGeom,
int scvIdx) const
......@@ -344,12 +336,12 @@ public:
values = 0;
}
// \}
/*!
* \name Boundary conditions
*/
// \{
/*!
* \brief Specifies which kind of boundary condition should be
......
......@@ -25,9 +25,7 @@
* \brief Test for the 2p2c box model.
*/
#include "config.h"
//#include <dumux/config.h>
#include "heterogeneousproblemni.hh"
//#include "injectionproblemni.hh"
#include <dumux/common/start.hh>
/*!
......@@ -67,7 +65,12 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if HAVE_ALUGRID || HAVE_UG
typedef TTAG(HeterogeneousProblem) ProblemTypeTag;
// typedef TTAG(InjectionProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
std::cout << "Test skipped, it needs ALUGrid or UG." << std::endl;
return 77;
#endif
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment