Commit dcf6299b authored by Klaus Mosthaf's avatar Klaus Mosthaf
Browse files

implemented naming conventions in problem files and spatial parameters

of 2p2c and 2p2cni box models


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@8178 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 5597514c
......@@ -64,7 +64,7 @@ SET_PROP(InjectionProblem, FluidSystem)
{ private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
static const bool useComplexRelations = false;
public:
public:
typedef Dumux::FluidSystems::H2ON2<Scalar, useComplexRelations> type;
};
......@@ -111,8 +111,8 @@ class InjectionProblem : public PorousMediaBoxProblem<TypeTag>
// copy some indices for convenience
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
enum {
wPhaseIdx = Indices::lPhaseIdx,
nPhaseIdx = Indices::gPhaseIdx,
wPhaseIdx = Indices::wPhaseIdx,
nPhaseIdx = Indices::nPhaseIdx,
H2OIdx = FluidSystem::H2OIdx,
......@@ -168,15 +168,15 @@ public:
exit(1);
}
/* Alternative syntax:
* typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree;
* const Dune::ParameterTree &tree = ParameterTree::tree();
* nTemperature_ = tree.template get<int>("FluidSystem.nTemperature");
*
* + We see what we do
* - Reporting whether it was used does not work
* - Overwriting on command line not possible
*/
/* Alternative syntax:
* typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree;
* const Dune::ParameterTree &tree = ParameterTree::tree();
* nTemperature_ = tree.template get<int>("FluidSystem.nTemperature");
*
* + We see what we do
* - Reporting whether it was used does not work
* - Overwriting on command line not possible
*/
eps_ = 1e-6;
......@@ -231,7 +231,7 @@ public:
{ return temperature_; };
void sourceAtPos(PrimaryVariables &values,
const GlobalPosition &globalPos) const
const GlobalPosition &globalPos) const
{
values = 0;
}
......@@ -282,7 +282,7 @@ public:
*
* \param values The neumann values for the conservation equations
* \param element The finite element
* \param fvElemGeom The finite-volume geometry in the box scheme
* \param fvGeometry The finite-volume geometry in the box scheme
* \param is The intersection between element and boundary
* \param scvIdx The local vertex index
* \param boundaryFaceIdx The index of the boundary face
......@@ -292,7 +292,7 @@ public:
*/
void neumann(PrimaryVariables &values,
const Element &element,
const FVElementGeometry &fvElemGeom,
const FVElementGeometry &fvGeometry,
const Intersection &is,
int scvIdx,
int boundaryFaceIdx) const
......@@ -317,7 +317,7 @@ public:
*
* \param values The initial values for the primary variables
* \param element The finite element
* \param fvElemGeom The finite-volume geometry in the box scheme
* \param fvGeometry The finite-volume geometry in the box scheme
* \param scvIdx The local vertex index
*
* For this method, the \a values parameter stores primary
......@@ -325,7 +325,7 @@ public:
*/
void initial(PrimaryVariables &values,
const Element &element,
const FVElementGeometry &fvElemGeom,
const FVElementGeometry &fvGeometry,
int scvIdx) const
{
const GlobalPosition &globalPos = element.geometry().corner(scvIdx);
......@@ -340,10 +340,10 @@ public:
* \param globalIdx The index of the global vertex
* \param globalPos The global position
*/
int initialPhasePresence(const Vertex &vert,
int initialPhasePresence(const Vertex &vertex,
int &globalIdx,
const GlobalPosition &globalPos) const
{ return Indices::lPhaseOnly; }
{ return Indices::wPhaseOnly; }
// \}
......
......@@ -55,12 +55,12 @@ SET_TYPE_PROP(InjectionSpatialParameters, SpatialParams, Dumux::InjectionSpatial
// Set the material Law
SET_PROP(InjectionSpatialParameters, MaterialLaw)
{
private:
private:
// define the material law which is parameterized by effective
// saturations
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef RegularizedBrooksCorey<Scalar> EffMaterialLaw;
public:
public:
// define the material law parameterized by absolute saturations
typedef EffToAbsLaw<EffMaterialLaw> type;
};
......@@ -86,11 +86,11 @@ class InjectionSpatialParameters : public BoxSpatialParameters<TypeTag>
dim=GridView::dimension,
dimWorld=GridView::dimensionworld,
wPhaseIdx = FluidSystem::lPhaseIdx
wPhaseIdx = FluidSystem::wPhaseIdx
};
typedef Dune::FieldVector<CoordScalar,dimWorld> GlobalPosition;
typedef Dune::FieldVector<CoordScalar,dimWorld> Vector;
typedef Dune::FieldVector<CoordScalar,dimWorld> DimVector;
typedef typename GET_PROP_TYPE(TypeTag, FluxVariables) FluxVariables;
typedef typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables) ElementVolumeVariables;
......@@ -105,10 +105,10 @@ public:
/*!
* \brief The constructor
*
* \param gv The grid view
* \param gridView The grid view
*/
InjectionSpatialParameters(const GridView &gv)
: ParentType(gv)
InjectionSpatialParameters(const GridView &gridView)
: ParentType(gridView)
{
layerBottom_ = 22.0;
......@@ -146,10 +146,10 @@ public:
*/
const Scalar intrinsicPermeability(const Element &element,
const FVElementGeometry &fvGeometry,
int scvIdx) const
const int scvIdx) const
{
const GlobalPosition &pos = fvGeometry.subContVol[scvIdx].global;
if (isFineMaterial_(pos))
const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
if (isFineMaterial_(globalPos))
return fineK_;
return coarseK_;
}
......@@ -164,10 +164,10 @@ public:
*/
Scalar porosity(const Element &element,
const FVElementGeometry &fvGeometry,
int scvIdx) const
const int scvIdx) const
{
const GlobalPosition &pos = fvGeometry.subContVol[scvIdx].global;
if (isFineMaterial_(pos))
const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
if (isFineMaterial_(globalPos))
return finePorosity_;
return coarsePorosity_;
}
......@@ -176,16 +176,16 @@ public:
/*!
* \brief return the parameter object for the Brooks-Corey material law which depends on the position
*
* \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
*/
* \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 MaterialLawParams& materialLawParams(const Element &element,
const FVElementGeometry &fvGeometry,
int scvIdx) const
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
const GlobalPosition &pos = fvGeometry.subContVol[scvIdx].global;
if (isFineMaterial_(pos))
const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
if (isFineMaterial_(globalPos))
return fineMaterialParams_;
return coarseMaterialParams_;
}
......@@ -202,7 +202,7 @@ public:
*/
double heatCapacity(const Element &element,
const FVElementGeometry &fvGeometry,
int scvIdx) const
const int scvIdx) const
{
return
790 // specific heat capacity of granite [J / (kg K)]
......@@ -231,14 +231,14 @@ public:
const Vector &tempGrad,
const Element &element,
const FVElementGeometry &fvGeometry,
int scvfIdx) const
const int faceIdx) const
{
static const Scalar lWater = 0.6;
static const Scalar lGranite = 2.8;
// arithmetic mean of the liquid saturation and the porosity
const int i = fvGeometry.subContVolFace[scvfIdx].i;
const int j = fvGeometry.subContVolFace[scvfIdx].j;
const int i = fvGeometry.subContVolFace[faceIdx].i;
const int j = fvGeometry.subContVolFace[faceIdx].j;
Scalar sW = std::max<Scalar>(0.0, (elemVolVars[i].saturation(wPhaseIdx) +
elemVolVars[j].saturation(wPhaseIdx)) / 2);
Scalar poro = (porosity(element, fvGeometry, i) +
......@@ -258,8 +258,8 @@ public:
}
private:
bool isFineMaterial_(const GlobalPosition &pos) const
{ return pos[dim-1] > layerBottom_; };
bool isFineMaterial_(const GlobalPosition &globalPos) const
{ return globalPos[dim-1] > layerBottom_; };
Scalar fineK_;
Scalar coarseK_;
......
......@@ -131,11 +131,14 @@ class WaterAirProblem : public PorousMediaBoxProblem<TypeTag>
#endif
// Phase State
lPhaseOnly = Indices::lPhaseOnly,
wPhaseOnly = Indices::wPhaseOnly,
// Grid and world dimension
dim = GridView::dimension,
dimWorld = GridView::dimensionworld
dimWorld = GridView::dimensionworld,
conti0EqIdx = Indices::conti0EqIdx,
contiNEqIdx = conti0EqIdx + Indices::nCompIdx
};
......@@ -186,7 +189,7 @@ public:
* \brief Returns the temperature within the domain.
*
* \param element The element
* \param fvElemGeom The finite-volume geometry in the box scheme
* \param fvGeometry The finite-volume geometry in the box scheme
* \param scvIdx The local vertex index (SCV index)
*
* This problem assumes a temperature of 10 degrees Celsius.
......@@ -198,7 +201,7 @@ public:
#endif
void sourceAtPos(PrimaryVariables &values,
const GlobalPosition &globalPos) const
const GlobalPosition &globalPos) const
{
values = 0;
}
......@@ -253,7 +256,7 @@ public:
*
* \param values The neumann values for the conservation equations
* \param element The finite element
* \param fvElemGeom The finite-volume geometry in the box scheme
* \param fvGeometry The finite-volume geometry in the box scheme
* \param is The intersection between element and boundary
* \param scvIdx The local vertex index
* \param boundaryFaceIdx The index of the boundary face
......@@ -263,10 +266,10 @@ public:
*/
void neumann(PrimaryVariables &values,
const Element &element,
const FVElementGeometry &fvElemGeom,
const FVElementGeometry &fvGeometry,
const Intersection &is,
int scvIdx,
int boundaryFaceIdx) const
const int scvIdx,
const int boundaryFaceIdx) const
{
const GlobalPosition &globalPos = element.geometry().corner(scvIdx);
values = 0;
......@@ -275,7 +278,7 @@ public:
if (globalPos[0] > 15 && globalPos[0] < 25 &&
globalPos[1] < eps_)
{
values[Indices::contiGEqIdx] = -1e-3;
values[contiNEqIdx] = -1e-3;
}
}
......@@ -291,7 +294,7 @@ public:
*
* \param values The initial values for the primary variables
* \param element The finite element
* \param fvElemGeom The finite-volume geometry in the box scheme
* \param fvGeometry The finite-volume geometry in the box scheme
* \param scvIdx The local vertex index
*
* For this method, the \a values parameter stores primary
......@@ -299,16 +302,16 @@ public:
*/
void initial(PrimaryVariables &values,
const Element &element,
const FVElementGeometry &fvElemGeom,
const FVElementGeometry &fvGeometry,
int scvIdx) const
{
const GlobalPosition &globalPos = element.geometry().corner(scvIdx);
const GlobalPosition &globalPos = element.geometry().corner(scvIdx);
initial_(values, globalPos);
#if !ISOTHERMAL
if (globalPos[0] > 20 && globalPos[0] < 30 && globalPos[1] < 30)
values[temperatureIdx] = 380;
if (globalPos[0] > 20 && globalPos[0] < 30 && globalPos[1] < 30)
values[temperatureIdx] = 380;
#endif
}
......@@ -323,7 +326,7 @@ public:
int &globalIdx,
const GlobalPosition &globalPos) const
{
return lPhaseOnly;
return wPhaseOnly;
}
private:
......
......@@ -53,12 +53,12 @@ SET_TYPE_PROP(WaterAirSpatialParameters, SpatialParams, Dumux::WaterAirSpatialPa
// Set the material Law
SET_PROP(WaterAirSpatialParameters, MaterialLaw)
{
private:
private:
// define the material law which is parameterized by effective
// saturations
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef RegularizedBrooksCorey<Scalar> EffMaterialLaw;
public:
public:
// define the material law parameterized by absolute saturations
typedef EffToAbsLaw<EffMaterialLaw> type;
};
......@@ -85,11 +85,11 @@ class WaterAirSpatialParameters : public BoxSpatialParameters<TypeTag>
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
enum {
lPhaseIdx = Indices::lPhaseIdx
wPhaseIdx = Indices::wPhaseIdx
};
typedef Dune::FieldVector<CoordScalar,dimWorld> GlobalPosition;
typedef Dune::FieldVector<CoordScalar,dimWorld> Vector;
typedef Dune::FieldVector<CoordScalar,dimWorld> DimVector;
typedef typename GET_PROP_TYPE(TypeTag, FluxVariables) FluxVariables;
typedef typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables) ElementVolumeVariables;
......@@ -104,10 +104,10 @@ public:
/*!
* \brief The constructor
*
* \param gv The grid view
* \param gridView The grid view
*/
WaterAirSpatialParameters(const GridView &gv)
: ParentType(gv)
WaterAirSpatialParameters(const GridView &gridView)
: ParentType(gridView)
{
layerBottom_ = 22.0;
......@@ -140,15 +140,15 @@ public:
* potential gradient.
*
* \param element The current finite element
* \param fvElemGeom The current finite volume geometry of the 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 &fvElemGeom,
int scvIdx) const
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
const GlobalPosition &pos = fvElemGeom.subContVol[scvIdx].global;
if (isFineMaterial_(pos))
const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
if (isFineMaterial_(globalPos))
return fineK_;
return coarseK_;
}
......@@ -157,16 +157,16 @@ public:
* \brief Define the porosity \f$[-]\f$ of the spatial parameters
*
* \param element The finite element
* \param fvElemGeom The finite volume geometry
* \param fvGeometry The finite volume geometry
* \param scvIdx The local index of the sub-control volume where
* the porosity needs to be defined
*/
double porosity(const Element &element,
const FVElementGeometry &fvElemGeom,
int scvIdx) const
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
const GlobalPosition &pos = fvElemGeom.subContVol[scvIdx].global;
if (isFineMaterial_(pos))
const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
if (isFineMaterial_(globalPos))
return finePorosity_;
else
return coarsePorosity_;
......@@ -176,16 +176,16 @@ public:
/*!
* \brief return the parameter object for the Brooks-Corey material law which depends on the position
*
* \param element The current finite element
* \param fvElemGeom The current finite volume geometry of the element
* \param scvIdx The index of the sub-control volume
*/
* \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 MaterialLawParams& materialLawParams(const Element &element,
const FVElementGeometry &fvElemGeom,
int scvIdx) const
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
const GlobalPosition &pos = fvElemGeom.subContVol[scvIdx].global;
if (isFineMaterial_(pos))
const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
if (isFineMaterial_(globalPos))
return fineMaterialParams_;
else
return coarseMaterialParams_;
......@@ -197,18 +197,18 @@ public:
* This is only required for non-isothermal models.
*
* \param element The finite element
* \param fvElemGeom The finite volume geometry
* \param fvGeometry The finite volume geometry
* \param scvIdx The local index of the sub-control volume where
* the heat capacity needs to be defined
*/
double heatCapacity(const Element &element,
const FVElementGeometry &fvElemGeom,
int scvIdx) const
const FVElementGeometry &fvGeometry,
const int scvIdx) const
{
return
790 // specific heat capacity of granite [J / (kg K)]
* 2700 // density of granite [kg/m^3]
* (1 - porosity(element, fvElemGeom, scvIdx));
* (1 - porosity(element, fvGeometry, scvIdx));
}
/*!
......@@ -218,32 +218,32 @@ public:
* This is only required for non-isothermal models.
*
* \param heatFlux The resulting heat flux vector
* \param fluxDat The flux variables
* \param vDat The volume variables
* \param tempGrad The temperature gradient
* \param fluxVars The flux variables
* \param elemVolVars The volume variables
* \param temperatureGrad The temperature gradient
* \param element The current finite element
* \param fvElemGeom The finite volume geometry of the current element
* \param scvfIdx The local index of the sub-control volume face where
* \param fvGeometry The finite volume geometry of the current element
* \param faceIdx The local index of the sub-control volume face where
* the matrix heat flux should be calculated
*/
void matrixHeatFlux(Vector &heatFlux,
const FluxVariables &fluxDat,
const ElementVolumeVariables &vDat,
const Vector &tempGrad,
void matrixHeatFlux(DimVector &heatFlux,
const FluxVariables &fluxVars,
const ElementVolumeVariables &elemVolVars,
const DimVector &temperatureGrad,
const Element &element,
const FVElementGeometry &fvElemGeom,
int scvfIdx) const
const FVElementGeometry &fvGeometry,
const int faceIdx) const
{
static const Scalar lWater = 0.6;
static const Scalar lGranite = 2.8;
// arithmetic mean of the liquid saturation and the porosity
const int i = fvElemGeom.subContVolFace[scvfIdx].i;
const int j = fvElemGeom.subContVolFace[scvfIdx].j;
Scalar Sl = std::max<Scalar>(0.0, (vDat[i].saturation(lPhaseIdx) +
vDat[j].saturation(lPhaseIdx)) / 2);
Scalar poro = (porosity(element, fvElemGeom, i) +
porosity(element, fvElemGeom, j)) / 2;
const int i = fvGeometry.subContVolFace[faceIdx].i;
const int j = fvGeometry.subContVolFace[faceIdx].j;
Scalar Sl = std::max<Scalar>(0.0, (elemVolVars[i].saturation(wPhaseIdx) +
elemVolVars[j].saturation(wPhaseIdx)) / 2);
Scalar poro = (porosity(element, fvGeometry, i) +
porosity(element, fvGeometry, j)) / 2;
Scalar lsat = pow(lGranite, (1-poro)) * pow(lWater, poro);
Scalar ldry = pow(lGranite, (1-poro));
......@@ -254,13 +254,13 @@ public:
// the matrix heat flux is the negative temperature gradient
// times the heat conductivity.
heatFlux = tempGrad;
heatFlux = temperatureGrad;
heatFlux *= -heatCond;
}
private:
bool isFineMaterial_(const GlobalPosition &pos) const
{ return pos[dim-1] > layerBottom_; };
bool isFineMaterial_(const GlobalPosition &globalPos) const
{ return globalPos[dim-1] > layerBottom_; };
Scalar fineK_;
Scalar coarseK_;
......
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