Commit a204e33c authored by Katherina Baber's avatar Katherina Baber
Browse files

implemented naming conventions

reviewed by Christoph


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@8271 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 6f36c2db
......@@ -53,12 +53,17 @@ struct OnePTwoCIndices
static const int comp1Idx = 1;
// Equation indices
static const int contiEqIdx = PVOffset + 0; //!< continuity equation index
static const int transEqIdx = PVOffset + 1; //!< transport equation index
static const int conti0EqIdx = PVOffset + 0; //!< continuity equation index
static const int transportEqIdx = PVOffset + 1; //!< transport equation index
static const int contiEqIdx = conti0EqIdx; //!< \deprecated use conti0EqIdx instead
static const int transEqIdx = transportEqIdx; //!< \deprecated use transportEqIdx instead
// primary variable indices
static const int pressureIdx = PVOffset + 0; //!< pressure
static const int massOrMoleFractionIdx = PVOffset + 1; //!< mole fraction of the second component
static const int transportCompIdx = PVOffset + 1; //!< mole fraction of the second component
static const int x1Idx = transportCompIdx; // \deprecated use transportCompIdx instead
static const int massOrMoleFractionIdx = transportCompIdx; // \deprecated use transportCompIdx instead
};
// \}
......
......@@ -84,8 +84,10 @@ protected:
comp1Idx = Indices::comp1Idx,
// indices of the equations
contiEqIdx = Indices::contiEqIdx,
transEqIdx = Indices::transEqIdx
conti0EqIdx = Indices::conti0EqIdx,
contiEqIdx = conti0EqIdx, // \deprecated use conti0EqIdx
transportEqIdx = Indices::transportEqIdx,
transEqIdx = transportEqIdx // \deprecated use transportEqIdx
};
//! property that defines whether mole or mass fractions are used
......
......@@ -62,7 +62,7 @@ class OnePTwoCVolumeVariables : public BoxVolumeVariables<TypeTag>
comp1Idx = Indices::comp1Idx,
pressureIdx = Indices::pressureIdx,
massOrMoleFractionIdx = Indices::massOrMoleFractionIdx
transportCompIdx = Indices::transportCompIdx
};
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
......@@ -126,20 +126,20 @@ public:
/*!
* \copydoc BoxModel::completeFluidState
*/
static void completeFluidState(const PrimaryVariables& primaryVariables,
static void completeFluidState(const PrimaryVariables& priVars,
const Problem& problem,
const Element& element,
const FVElementGeometry& elementGeometry,
const int scvIdx,
FluidState& fluidState)
{
Scalar T = Implementation::temperature_(primaryVariables, problem, element,
Scalar T = Implementation::temperature_(priVars, problem, element,
elementGeometry, scvIdx);
fluidState.setTemperature(T);
fluidState.setPressure(phaseIdx, primaryVariables[pressureIdx]);
fluidState.setPressure(phaseIdx, priVars[pressureIdx]);
Scalar x1 = primaryVariables[massOrMoleFractionIdx]; //mole or mass fraction of component 1
Scalar x1 = priVars[transportCompIdx]; //mole or mass fraction of component 1
if(!useMoles) //mass-fraction formulation
{
// convert mass to mole fractions
......
......@@ -40,7 +40,7 @@
#include <dumux/boxmodels/common/porousmediaboxproblem.hh>
#include <dumux/material/fluidsystems/h2on2liquidphasefluidsystem.hh>
#include "1p2coutflowspatialparameters.hh"
#include "1p2coutflowspatialparams.hh"
namespace Dumux
{
......@@ -80,7 +80,7 @@ public:
// Set the spatial parameters
SET_TYPE_PROP(OnePTwoCOutflowProblem,
SpatialParams,
Dumux::OnePTwoCOutflowSpatialParameters<TypeTag>);
Dumux::OnePTwoCOutflowSpatialParams<TypeTag>);
//Define whether mole(true) or mass (false) fractions are used
SET_BOOL_PROP(OnePTwoCOutflowProblem, UseMoles, false);
......@@ -135,11 +135,11 @@ class OnePTwoCOutflowProblem : public PorousMediaBoxProblem<TypeTag>
// indices of the primary variables
pressureIdx = Indices::pressureIdx,
massOrMoleFractionIdx = Indices::massOrMoleFractionIdx,
transportCompIdx = Indices::transportCompIdx,
// indices of the equations
contiEqIdx = Indices::contiEqIdx,
transEqIdx = Indices::transEqIdx
conti0EqIdx = Indices::conti0EqIdx,
transportEqIdx = Indices::transportEqIdx
};
......@@ -202,34 +202,34 @@ public:
//outflow condition for the transport equation at right boundary
if(globalPos[0] > this->bboxMax()[0] - eps_)
values.setOutflow(transEqIdx);
values.setOutflow(transportEqIdx);
}
/*!
* \brief Evaluate the boundary conditions for a Dirichlet
* boundary segment.
*
* For this method, the \a values parameter stores primary variables.
* For this method, the \a priVars parameter stores primary variables.
*/
void dirichlet(PrimaryVariables &values, const Vertex &vertex) const
void dirichlet(PrimaryVariables &priVars, const Vertex &vertex) const
{
const GlobalPosition globalPos = vertex.geometry().center();
initial_(values, globalPos);
initial_(priVars, globalPos);
//condition for the N2 molefraction at left boundary
if(globalPos[0] < eps_)
values[massOrMoleFractionIdx] = 2.0e-5;
priVars[transportCompIdx] = 2.0e-5;
}
/*!
* \brief Evaluate the boundary conditions for a Neumann
* boundary segment.
*
* For this method, the \a values parameter stores the mass flux
* For this method, the \a priVars parameter stores the mass flux
* in normal direction of each component. Negative values mean
* influx.
*/
void neumann(PrimaryVariables &values,
void neumann(PrimaryVariables &priVars,
const Element &element,
const FVElementGeometry &fvGeometry,
const Intersection &is,
......@@ -237,7 +237,7 @@ public:
const int boundaryFaceIdx) const
{
//const GlobalPosition &globalPos = element.geometry().corner(scvIdx);
values = 0;
priVars = 0;
}
// \}
......@@ -251,24 +251,24 @@ public:
* \brief Evaluate the source term for all phases within a given
* sub-control-volume.
*
* For this method, the \a values parameter stores the rate mass
* For this method, the \a priVars parameter stores the rate mass
* of a component is generated or annihilate per volume
* unit. Positive values mean that mass is created, negative ones
* mean that it vanishes.
*/
void sourceAtPos(PrimaryVariables &values,
void sourceAtPos(PrimaryVariables &priVars,
const GlobalPosition &globalPos) const
{
values = Scalar(0.0);
priVars = Scalar(0.0);
}
/*!
* \brief Evaluate the initial value for a control volume.
*
* For this method, the \a values parameter stores primary
* For this method, the \a priVars parameter stores primary
* variables.
*/
void initial(PrimaryVariables &values,
void initial(PrimaryVariables &priVars,
const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
......@@ -276,18 +276,18 @@ public:
const GlobalPosition &globalPos
= element.geometry().corner(scvIdx);
initial_(values, globalPos);
initial_(priVars, globalPos);
}
// \}
private:
// the internal method for the initial condition
void initial_(PrimaryVariables &values,
void initial_(PrimaryVariables &priVars,
const GlobalPosition &globalPos) const
{
values[pressureIdx] = 2e5 - 1e5*globalPos[0];//0.0; //initial condition for the pressure
values[massOrMoleFractionIdx] = 0.0; //initial condition for the N2 molefraction
priVars[pressureIdx] = 2e5 - 1e5*globalPos[0];//0.0; //initial condition for the pressure
priVars[transportCompIdx] = 0.0; //initial condition for the N2 molefraction
}
const Scalar eps_;
......
......@@ -25,140 +25,26 @@
*
* \brief Definition of the spatial parameters for the 1p2c
* outlfow problem.
* DEPRECATED use OnePTwoCOutflowSpatialParams
*/
#ifndef DUMUX_1P2C_OUTFLOW_SPATIAL_PARAMETERS_HH
#define DUMUX_1P2C_OUTFLOW_SPATIAL_PARAMETERS_HH
#include <dumux/material/spatialparameters/boxspatialparameters1p.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include "1p2coutflowspatialparams.hh"
#warning include 1p2coutflowspatialparams.hh instead
namespace Dumux
{
/*!
* \ingroup OnePTwoCBoxModel
* \ingroup BoxTestProblems
*
* \brief Definition of the spatial parameters for the 1p2c
* outflow problem.
*/
template<class TypeTag>
class OnePTwoCOutflowSpatialParameters : public BoxSpatialParametersOneP<TypeTag>
class OnePTwoCOutflowSpatialParameters : public OnePTwoCOutflowSpatialParams<TypeTag>
{
typedef BoxSpatialParametersOneP<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename Grid::ctype CoordScalar;
enum {
dim=GridView::dimension,
dimWorld=GridView::dimensionworld
};
typedef Dune::FieldVector<CoordScalar,dimWorld> GlobalPosition;
typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector;
typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
typedef typename GridView::template Codim<0>::Entity Element;
//typedef LinearMaterial<Scalar> EffMaterialLaw;
public:
DUMUX_DEPRECATED_MSG("use OnePTwoCOutflowSpatialParams instead")
OnePTwoCOutflowSpatialParameters(const GridView &gridView)
: ParentType(gridView)
{
permeability_ = 1e-10;
porosity_ = 0.4;
tortuosity_ = 0.28;
}
~OnePTwoCOutflowSpatialParameters()
{}
/*!
* \brief Update the spatial parameters with the flow solution
* after a timestep.
*
* \param globalSolution the global solution vector
*/
void update(const SolutionVector &globalSolution)
{
};
/*!
* \brief Define the intrinsic permeability \f$\mathrm{[m^2]}\f$.
*
* \param element The current finite element
* \param fvGeometry The current finite volume geometry of the element
* \param scvIdx The index of the sub-control volume
*/
const Scalar intrinsicPermeability(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
return permeability_;
}
/*!
* \brief Define the porosity \f$\mathrm{[-]}\f$.
*
* \param element The finite element
* \param fvGeometry The finite volume geometry
* \param scvIdx The local index of the sub-control volume where
*/
double porosity(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
return porosity_;
}
/*!
* \brief Define the tortuosity \f$\mathrm{[-]}\f$.
*
* \param element The finite element
* \param fvGeometry The finite volume geometry
* \param scvIdx The local index of the sub-control volume where
*/
double tortuosity(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
return tortuosity_;
}
/*!
* \brief Define the dispersivity.
*
* \param element The finite element
* \param fvGeometry The finite volume geometry
* \param scvIdx The local index of the sub-control volume where
*/
double dispersivity(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
return 0;
}
bool useTwoPointGradient(const Element &element,
const int vertexI,
const int vertexJ) const
{
return false;
}
private:
Scalar permeability_;
Scalar porosity_;
Scalar tortuosity_;
: OnePTwoCOutflowSpatialParams<TypeTag>(gridView)
};
}
#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 *
* 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 *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* 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 *
* GNU General Public License for more details. *
* *
* 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 Definition of the spatial parameters for the 1p2c
* outlfow problem.
*/
#ifndef DUMUX_1P2C_OUTFLOW_SPATIAL_PARAMS_HH
#define DUMUX_1P2C_OUTFLOW_SPATIAL_PARAMS_HH
#include <dumux/material/spatialparams/boxspatialparams1p.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
namespace Dumux
{
/*!
* \ingroup OnePTwoCBoxModel
* \ingroup BoxTestProblems
*
* \brief Definition of the spatial parameters for the 1p2c
* outflow problem.
*/
template<class TypeTag>
class OnePTwoCOutflowSpatialParams : public BoxSpatialParamsOneP<TypeTag>
{
typedef BoxSpatialParamsOneP<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename Grid::ctype CoordScalar;
enum {
dim=GridView::dimension,
dimWorld=GridView::dimensionworld
};
typedef Dune::FieldVector<CoordScalar,dimWorld> GlobalPosition;
typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector;
typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
typedef typename GridView::template Codim<0>::Entity Element;
//typedef LinearMaterial<Scalar> EffMaterialLaw;
public:
OnePTwoCOutflowSpatialParams(const GridView &gridView)
: ParentType(gridView)
{
permeability_ = 1e-10;
porosity_ = 0.4;
tortuosity_ = 0.28;
}
~OnePTwoCOutflowSpatialParams()
{}
/*!
* \brief Update the spatial parameters with the flow solution
* after a timestep.
*
* \param globalSolution the global solution vector
*/
void update(const SolutionVector &globalSolution)
{
};
/*!
* \brief Define the intrinsic permeability \f$\mathrm{[m^2]}\f$.
*
* \param element The current finite element
* \param fvGeometry The current finite volume geometry of the element
* \param scvIdx The index of the sub-control volume
*/
const Scalar intrinsicPermeability(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
return permeability_;
}
/*!
* \brief Define the porosity \f$\mathrm{[-]}\f$.
*
* \param element The finite element
* \param fvGeometry The finite volume geometry
* \param scvIdx The local index of the sub-control volume where
*/
double porosity(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
return porosity_;
}
/*!
* \brief Define the tortuosity \f$\mathrm{[-]}\f$.
*
* \param element The finite element
* \param fvGeometry The finite volume geometry
* \param scvIdx The local index of the sub-control volume where
*/
double tortuosity(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
return tortuosity_;
}
/*!
* \brief Define the dispersivity.
*
* \param element The finite element
* \param fvGeometry The finite volume geometry
* \param scvIdx The local index of the sub-control volume where
*/
double dispersivity(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
return 0;
}
bool useTwoPointGradient(const Element &element,
const int vertexI,
const int vertexJ) const
{
return false;
}
private:
Scalar permeability_;
Scalar porosity_;
Scalar tortuosity_;
};
}
#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